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)