]> Cypherpunks repositories - gostls13.git/commit
internal/trace: use the correct stack for goroutine naming in v2 traces
authorMichael Anthony Knyszek <mknyszek@google.com>
Tue, 21 Nov 2023 17:33:20 +0000 (17:33 +0000)
committerMichael Knyszek <mknyszek@google.com>
Tue, 21 Nov 2023 21:27:05 +0000 (21:27 +0000)
commit351d8520a6e55cbadc1714ad62405699ee172c5e
tree3fc3d25c4f3a86729d6130cfb0fc90691f162b89
parent450ecbe90508f56684b69e39823d4da155846932
internal/trace: use the correct stack for goroutine naming in v2 traces

Currently goroutine names are determined (for v2 traces) by
internal/tracev/2.Event.Stack, but this is wrong in general. For
example, if we end up seeing a transition from GoNotExist->GoRunnable
(goroutine creation) then we're taking the stack from the creator, not
the created goroutine (which is what we're naming at that point).

Use the StateTransition.Stack instead. This is always the correct one to
use because we're always naming the goroutine that the state transition
is for.

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