]> Cypherpunks repositories - gostls13.git/commit
runtime: allow experimental trace batches to be reused
authorAustin Clements <austin@google.com>
Mon, 24 Jun 2024 16:19:00 +0000 (12:19 -0400)
committerGopher Robot <gobot@golang.org>
Fri, 26 Jul 2024 18:46:28 +0000 (18:46 +0000)
commit2a3e2e9b297955d811f62b1861906a831951ef0e
tree045200bd464afcced68da0e86bcfd09844b96bc9
parentfac95803ebe49b95fe93f9f8034bace69cb60119
runtime: allow experimental trace batches to be reused

Currently, we can only cache regular trace event buffers on each M. As
a result, calling unsafeTraceExpWriter will, in effect, always return
a new trace batch, with all of the overhead that entails.

This extends that cache to support buffers for experimental trace
data. This way, unsafeTraceExpWriter can return a partially used
buffer, which the caller can continue to extend. This gives the caller
control over when these buffers get flushed and reuses all of the
existing trace buffering mechanism.

This also has the consequence of simplifying the experimental batch
infrastructure a bit. Now, traceWriter needs to know the experiment ID
anyway, which means there's no need for a separate traceExpWriter
type.

Change-Id: Idc2100176c5d02e0fbb229dc8aa4aea2b1cf5231
Reviewed-on: https://go-review.googlesource.com/c/go/+/594595
Auto-Submit: Austin Clements <austin@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/runtime/trace.go
src/runtime/tracebuf.go
src/runtime/traceexp.go
src/runtime/traceruntime.go
src/runtime/tracetype.go