aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/runtime1.go
diff options
context:
space:
mode:
authorFelix Geisendörfer <felix.geisendoerfer@datadoghq.com>2024-04-27 13:41:05 +0200
committerAustin Clements <austin@google.com>2024-05-21 14:38:56 +0000
commit66cc2b7ca760d62294584d6680df65892cf7a8cf (patch)
tree829a235416aa5419b89ab6c96ebef0211fa3fd00 /src/runtime/runtime1.go
parent1b9dc3e178be578cf1d8c06fe371283a58bdd93f (diff)
downloadgo-66cc2b7ca760d62294584d6680df65892cf7a8cf.tar.xz
runtime: make profstackdepth a GODEBUG option
Allow users to decrease the profiling stack depth back to 32 in case they experience any problems with the new default of 128. Users may also use this option to increase the depth up to 1024. Change-Id: Ieaab2513024915a223239278dd97a6e161dde1cf Reviewed-on: https://go-review.googlesource.com/c/go/+/581917 Reviewed-by: Austin Clements <austin@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Diffstat (limited to 'src/runtime/runtime1.go')
-rw-r--r--src/runtime/runtime1.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/runtime/runtime1.go b/src/runtime/runtime1.go
index c54ba19d07..3bbea46aff 100644
--- a/src/runtime/runtime1.go
+++ b/src/runtime/runtime1.go
@@ -330,6 +330,7 @@ var debug struct {
tracefpunwindoff int32
traceadvanceperiod int32
traceCheckStackOwnership int32
+ profstackdepth int32
// debug.malloc is used as a combined debug check
// in the malloc function and should be set
@@ -379,6 +380,7 @@ var dbgvars = []*dbgVar{
{name: "invalidptr", value: &debug.invalidptr},
{name: "madvdontneed", value: &debug.madvdontneed},
{name: "panicnil", atomic: &debug.panicnil},
+ {name: "profstackdepth", value: &debug.profstackdepth, def: 128},
{name: "runtimecontentionstacks", atomic: &debug.runtimeContentionStacks},
{name: "sbrk", value: &debug.sbrk},
{name: "scavtrace", value: &debug.scavtrace},
@@ -434,6 +436,7 @@ func parsedebugvars() {
parsegodebug(godebug, nil)
debug.malloc = (debug.inittrace | debug.sbrk) != 0
+ debug.profstackdepth = min(debug.profstackdepth, maxProfStackDepth)
setTraceback(gogetenv("GOTRACEBACK"))
traceback_env = traceback_cache