]> Cypherpunks repositories - gostls13.git/commit
internal/trace: be stricter about allowed events in v2 trace versions
authorMichael Anthony Knyszek <mknyszek@google.com>
Fri, 24 Jan 2025 20:56:47 +0000 (20:56 +0000)
committerGopher Robot <gobot@golang.org>
Mon, 10 Feb 2025 20:14:44 +0000 (12:14 -0800)
commit715754ba86665b860c7245759149f1e86c24ee8d
tree886ceb54765b637940013c275e5668805eea4060
parent0f62125487d572168b71be7acb3b9efead55b37c
internal/trace: be stricter about allowed events in v2 trace versions

Currently all v2 trace versions, Go 1.22 and Go 1.23, share a full set
of specs. This is mostly OK, but it means quite a few events will be
accepted for 1.22 traces that should be rejected. This change fixes that
by limiting which event specs are returned by version.Version.Specs for
Go 1.22.

While we're here, let's be stricter about event names too, and move
tracev2.EventString to be a method on the version, so we can be more
precise. An intended consequence of this move is that tracev2 no longer
depends on fmt, since we will want the runtime to depend on tracev2 in
the near future.

Change-Id: If7285460c8ba59ab73da00993b7b12e61cdfe6a9
Reviewed-on: https://go-review.googlesource.com/c/go/+/644219
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/go/build/deps_test.go
src/internal/trace/batch.go
src/internal/trace/event.go
src/internal/trace/order.go
src/internal/trace/reader.go
src/internal/trace/tracev2/event.go
src/internal/trace/version/version.go