aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/export_test.go
diff options
context:
space:
mode:
authorRhys Hiltner <rhys.hiltner@gmail.com>2024-05-16 15:48:36 -0700
committerGopher Robot <gobot@golang.org>2025-05-07 12:22:19 -0700
commit591c4b50c0d8c61087c30261efd5e97668625e06 (patch)
tree015f4eec7e2ecd267a6e1cc750950db3e0c87a64 /src/runtime/export_test.go
parent4d0f955a5e2a7c3310f15983b643ff5bf5fc1351 (diff)
downloadgo-591c4b50c0d8c61087c30261efd5e97668625e06.tar.xz
runtime: verify attribution of mutex delay
Have the test use the same clock (cputicks) as the profiler, and use the test's own measurements as hard bounds on the magnitude to expect in the profile. Compare the depiction of two users of the same lock: one where the critical section is fast, one where it is slow. Confirm that the profile shows the slow critical section as a large source of delay (with #66999 fixed), rather than showing the fast critical section as a large recipient of delay. Previously reviewed as https://go.dev/cl/586237. For #66999 Change-Id: Ic2d78cc29153d5322577d84abdc448e95ed8f594 Reviewed-on: https://go-review.googlesource.com/c/go/+/667616 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Auto-Submit: Rhys Hiltner <rhys.hiltner@gmail.com>
Diffstat (limited to 'src/runtime/export_test.go')
-rw-r--r--src/runtime/export_test.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/runtime/export_test.go b/src/runtime/export_test.go
index 980066df70..520b060599 100644
--- a/src/runtime/export_test.go
+++ b/src/runtime/export_test.go
@@ -40,6 +40,8 @@ var Atoi32 = atoi32
var ParseByteCount = parseByteCount
var Nanotime = nanotime
+var Cputicks = cputicks
+var CyclesPerSecond = pprof_cyclesPerSecond
var NetpollBreak = netpollBreak
var Usleep = usleep