commit | be819d1f06fcf3b4af438c99ca3ef8827ec116b1 | [log] [tgz] |
---|---|---|
author | Michael Anthony Knyszek <mknyszek@google.com> | Fri Dec 15 20:33:41 2023 +0000 |
committer | Gopher Robot <gobot@golang.org> | Wed Jan 03 18:33:07 2024 +0000 |
tree | 4d8faa0bd1d14df590bf34753159ff5a93a04525 | |
parent | 02704c960a9be2620264d7b99499c640e03da6b6 [diff] |
trace: add experimental flight recorder API This change adds an experimental flight recorder API that lives outside the Go runtime. It implements the same API as the proposed API, but has a few caveats because it exists outside the runtime. Firstly, because the conceptual circular buffer lives outside the runtime, this flight recorder has slightly more overhead than a runtime-internal implementation would. Specifically, all the trace data needs to be copied out of the runtime and gently processed, and this process needs to happen continuously. Peak memory use is also going to be higher because of this copying. Secondly, the flight recorder needs to flush the runtime's buffers twice in a row in order to obtain the snapshot it wants. This is because the signal in the trace that a generation is done is either that the trace stream ends or a batch with a new generation value appears. Flushing twice in a row ensures that the generation we actually wanted done is complete, at the cost of an additional flush. The overhead of this should be minimal in practice, but it does mean that the actual flush operation will have a substantially longer latency than with a runtime-internal implementation. This is OK because that latency doesn't actually affect any properties of the resulting snapshot; it's purely latency to the caller. This problem could have been avoided with an explicit in-band signal that a generation has been flushed, which we may want to consider adding in the future. For #63185. Change-Id: I7a94e2cddcfbf19a4140b398c188c3d59f8b9c9e Reviewed-on: https://go-review.googlesource.com/c/exp/+/550257 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>
This subrepository holds experimental and deprecated (in the old
directory) packages.
The idea for this subrepository originated as the pkg/exp
directory of the main repository, but its presence there made it unavailable to users of the binary downloads of the Go installation. The subrepository has therefore been created to make it possible to go get
these packages.
Warning: Packages here are experimental and unreliable. Some may one day be promoted to the main repository or other subrepository, or they may be modified arbitrarily or even disappear altogether.
In short, code in this subrepository is not subject to the Go 1 compatibility promise. (No subrepo is, but the promise is even more likely to be violated by go.exp than the others.)
Caveat emptor.