aboutsummaryrefslogtreecommitdiff
path: root/src/encoding/binary
diff options
context:
space:
mode:
authorRhys Hiltner <rhys.hiltner@gmail.com>2024-05-21 23:17:13 -0700
committerGopher Robot <gobot@golang.org>2024-05-22 14:34:20 +0000
commit8ab131fb1256a4a795c610e145c022e22e2d1567 (patch)
tree48ee552c8fd03cc1489e41e76fec7178a454c187 /src/encoding/binary
parent1d3d7d395e6081c0cdc437c56c4c0318b70fb685 (diff)
downloadgo-8ab131fb1256a4a795c610e145c022e22e2d1567.tar.xz
runtime: split mutex profile clocks
Mutex contention measurements work with two clocks: nanotime for use in runtime/metrics, and cputicks for the runtime/pprof profile. They're subject to different sampling rates: the runtime/metrics view is always enabled, but the profile is adjustable and is turned off by default. They have different levels of overhead: it can take as little as one instruction to read cputicks while nanotime calls are more elaborate (although some platforms implement cputicks as a nanotime call). The use of the timestamps is also different: the profile's view needs to attach the delay in some Ms' lock2 calls to another M's unlock2 call stack, but the metric's view is only an int64. Treat them differently. Don't bother threading the nanotime clock through to the unlock2 call, measure and report it directly within lock2. Sample nanotime at a constant gTrackingPeriod. Don't consult any clocks unless the mutex is actually contended. Continue liberal use of cputicks for now. For #66999 Change-Id: I1c2085ea0e695bfa90c30fadedc99ced9eb1f69e Reviewed-on: https://go-review.googlesource.com/c/go/+/586796 TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Rhys Hiltner <rhys.hiltner@gmail.com> Reviewed-by: Michael Pratt <mpratt@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Run-TryBot: Rhys Hiltner <rhys.hiltner@gmail.com> Reviewed-by: Carlos Amedee <carlos@golang.org>
Diffstat (limited to 'src/encoding/binary')
0 files changed, 0 insertions, 0 deletions