aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorNick Ripley <nick.ripley@datadoghq.com>2025-12-02 19:46:39 +0000
committerMichael Knyszek <mknyszek@google.com>2026-01-23 08:26:04 -0800
commit6b7206feb2df3116bd5c471813353ffec1ff25fe (patch)
tree3efb8613192aaa200e14f3c78c2a8384dd4e1ca3 /src/runtime
parent23f7ba554d0e3ffbe18d04e79c34984e050869e1 (diff)
downloadgo-6b7206feb2df3116bd5c471813353ffec1ff25fe.tar.xz
runtime: remove logical stack sentinel for runtime lock stacks
When CL 533258 added frame pointer support for the block and mutex profiles, it deferred skipping/inline expansion, similar to the execution tracer. The first frame indicated whether this expansion was needed by holding either the number of frames to skip (implying inline expansion) or the logicalStackSentinel placeholder to indicate that no extra handling is needed. However, CL 598515 switched to doing the skipping/inline expansion at sample time. After this, the sentinel value is unused. This CL removes the sentinel from runtime lock profiling, correcting an oversight from that CL. This didn't cause any problems since post-processing would just ignore the bogus sentinel value; this is just a cleanup. Change-Id: Idbec11f57ac7a57426cd8a064782c4fe6a6a6964 Reviewed-on: https://go-review.googlesource.com/c/go/+/726040 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Carlos Amedee <carlos@golang.org>
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/mprof.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/runtime/mprof.go b/src/runtime/mprof.go
index 7d761720b5..0452b1b605 100644
--- a/src/runtime/mprof.go
+++ b/src/runtime/mprof.go
@@ -731,8 +731,6 @@ func (prof *mLockProfile) captureStack() {
}
prof.haveStack = true
- prof.stack[0] = logicalStackSentinel
-
var nstk int
gp := getg()
sp := sys.GetCallerSP()
@@ -740,7 +738,7 @@ func (prof *mLockProfile) captureStack() {
systemstack(func() {
var u unwinder
u.initAt(pc, sp, 0, gp, unwindSilentErrors|unwindJumpStack)
- nstk = 1 + tracebackPCs(&u, skip, prof.stack[1:])
+ nstk = tracebackPCs(&u, skip, prof.stack)
})
if nstk < len(prof.stack) {
prof.stack[nstk] = 0
@@ -782,7 +780,6 @@ func (prof *mLockProfile) storeSlow() {
saveBlockEventStack(cycles, rate, prof.stack[:nstk], mutexProfile)
if lost > 0 {
lostStk := [...]uintptr{
- logicalStackSentinel,
abi.FuncPCABIInternal(_LostContendedRuntimeLock) + sys.PCQuantum,
}
saveBlockEventStack(lost, rate, lostStk[:], mutexProfile)