]> Cypherpunks repositories - gostls13.git/commit
internal/trace: reduce event size by packing goroutine statuses
authorNick Ripley <nick.ripley@datadoghq.com>
Fri, 26 Jul 2024 19:16:24 +0000 (15:16 -0400)
committerGopher Robot <gobot@golang.org>
Mon, 29 Jul 2024 14:38:04 +0000 (14:38 +0000)
commit705f9848ef42da0ccb15849d69c5ba6687007a2e
tree9eb455ca9ed97a9b3aff2cd6e1437ea65c587b7d
parent8173a29aaa670a7b958f05a96a74933ee3ec4469
internal/trace: reduce event size by packing goroutine statuses

The trace parser was using an otherwise-unused event argument to hold an
extra goroutine state argument for the GoStatus & GoStatusStack events.
This is needed because the execution tracer just records the "after" for
state transitions, but we want to have both the "before" and "after"
states available in the StateTransition info for the parsed event. When
GoStatusStack was added, the size of the argument array was increased to
still have room for the extra status. However, statuses are currently
only 1 byte, and the status argument is 8 bytes, so there is plenty of
room to pack the "before" and "after" statuses in a single argument. Do
that instead to avoid the need for an extra argument.

Change-Id: I6886eeb14fb8e5e046b6afcc5b19e04218bcacd4
Reviewed-on: https://go-review.googlesource.com/c/go/+/601455
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/internal/trace/base.go
src/internal/trace/event.go
src/internal/trace/order.go