]> git.feebdaed.xyz Git - 0xmirror/go.git/commit
runtime: use m.profStack in traceStack
authorMichael Anthony Knyszek <mknyszek@google.com>
Wed, 19 Nov 2025 23:42:06 +0000 (23:42 +0000)
committerGopher Robot <gobot@golang.org>
Mon, 24 Nov 2025 21:20:13 +0000 (13:20 -0800)
commit7fbd141de506e331ef3f5910b505ece91a012e4a
treecc4ad79b0f3e0fbbb47f4254c4313c65795a4681
parent0bc192368ac603614dc3f240e751f539d91a1db2
runtime: use m.profStack in traceStack

Turns out we spend a few percent of the trace event writing path in just
zero-initializing the stack space for pcBuf. We don't need zero
initialization, since we're going to write over whatever we actually
use. Use m.profStack instead, which is already sized correctly.

A side-effect of this change is that trace stacks now obey the GODEBUG
profstackdepth where they previously ignored it. The name clearly
doesn't match, but this is a positive: there's no reason the maximum
stack depth shouldn't apply to every diagnostic.

Change-Id: Ia654d3d708f15cbb2e1d95af196ae10b07a65df2
Reviewed-on: https://go-review.googlesource.com/c/go/+/723062
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
src/runtime/tracestack.go