aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/mprof.go
diff options
context:
space:
mode:
authorRhys Hiltner <rhys.hiltner@gmail.com>2024-05-29 16:41:10 +0000
committerGopher Robot <gobot@golang.org>2024-05-30 17:52:17 +0000
commitca7d300509626e2071f3f5babc2e9c121d806fec (patch)
tree97fb321d32c640f525ea4713bc04be9a676bf6c1 /src/runtime/mprof.go
parente6b8b2f3e236e8646962c68e172c304e11e9a8f0 (diff)
downloadgo-ca7d300509626e2071f3f5babc2e9c121d806fec.tar.xz
Revert "runtime: remove GODEBUG=runtimecontentionstacks"
This reverts commit 87e930f7289136fad1310d4b63dd4127e409bac5 (CL 585639) Reason for revert: This is part of a patch series that changed the handling of contended lock2/unlock2 calls, reducing the maximum throughput of contended runtime.mutex values, and causing a performance regression on applications where that is (or became) the bottleneck. Updates #66999 Updates #67585 Change-Id: I1e286d2a16d16e4af202cd5dc04b2d9c4ee71b32 Reviewed-on: https://go-review.googlesource.com/c/go/+/589097 Reviewed-by: Than McIntosh <thanm@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Pratt <mpratt@google.com> Auto-Submit: Rhys Hiltner <rhys.hiltner@gmail.com>
Diffstat (limited to 'src/runtime/mprof.go')
-rw-r--r--src/runtime/mprof.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/runtime/mprof.go b/src/runtime/mprof.go
index fd0a018724..93d49275c9 100644
--- a/src/runtime/mprof.go
+++ b/src/runtime/mprof.go
@@ -915,6 +915,11 @@ func (prof *mLockProfile) captureStack() {
}
prof.stack[0] = logicalStackSentinel
+ if debug.runtimeContentionStacks.Load() == 0 {
+ prof.stack[1] = abi.FuncPCABIInternal(_LostContendedRuntimeLock) + sys.PCQuantum
+ prof.stack[2] = 0
+ return
+ }
var nstk int
gp := getg()