]> Cypherpunks repositories - gostls13.git/commitdiff
internal/trace: clarify which StateTransition events have stacks
authorFelix Geisendörfer <felix.geisendoerfer@datadoghq.com>
Sun, 6 Jul 2025 15:16:10 +0000 (17:16 +0200)
committerGopher Robot <gobot@golang.org>
Tue, 12 Aug 2025 18:42:13 +0000 (11:42 -0700)
Clarify that EvGoDestroy, EvGoSyscallEnd and EvGoSyscallEndBlocked do
not have a stack trace by removing the code that tries to assign an
empty stack.

Change-Id: I6a6a696479ac7f753b3c6f6f48d8b9b67f6e3b95
Reviewed-on: https://go-review.googlesource.com/c/go/+/694621
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

src/internal/trace/event.go

index f9c40010c4b535620caaff7ebae17b8705092795..efc9ae50937f51803cefefeb6334773080e20528 100644 (file)
@@ -625,7 +625,6 @@ func (e Event) StateTransition() StateTransition {
                s = goStateTransition(GoID(e.base.args[0]), GoRunnable, GoRunning)
        case tracev2.EvGoDestroy:
                s = goStateTransition(e.ctx.G, GoRunning, GoNotExist)
-               s.Stack = e.Stack() // This event references the resource the event happened on.
        case tracev2.EvGoDestroySyscall:
                s = goStateTransition(e.ctx.G, GoSyscall, GoNotExist)
        case tracev2.EvGoStop:
@@ -646,10 +645,8 @@ func (e Event) StateTransition() StateTransition {
                s.Stack = e.Stack() // This event references the resource the event happened on.
        case tracev2.EvGoSyscallEnd:
                s = goStateTransition(e.ctx.G, GoSyscall, GoRunning)
-               s.Stack = e.Stack() // This event references the resource the event happened on.
        case tracev2.EvGoSyscallEndBlocked:
                s = goStateTransition(e.ctx.G, GoSyscall, GoRunnable)
-               s.Stack = e.Stack() // This event references the resource the event happened on.
        case tracev2.EvGoStatus, tracev2.EvGoStatusStack:
                packedStatus := e.base.args[2]
                from, to := packedStatus>>32, packedStatus&((1<<32)-1)