From f9ba2cff2286d378eca28c841bea8488c69fc30e Mon Sep 17 00:00:00 2001 From: Rhys Hiltner Date: Thu, 16 May 2024 15:48:36 -0700 Subject: runtime: improve runtime-internal mutex profile tests 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. For #64253 For #66999 Change-Id: I784c8beedc39de564dc8cee42060a5d5ce55de39 Reviewed-on: https://go-review.googlesource.com/c/go/+/586237 Auto-Submit: Rhys Hiltner Reviewed-by: Carlos Amedee LUCI-TryBot-Result: Go LUCI Reviewed-by: Michael Pratt --- src/runtime/export_test.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/runtime/export_test.go') diff --git a/src/runtime/export_test.go b/src/runtime/export_test.go index d55da1028d..abc6b62a34 100644 --- a/src/runtime/export_test.go +++ b/src/runtime/export_test.go @@ -39,6 +39,8 @@ var Atoi32 = atoi32 var ParseByteCount = parseByteCount var Nanotime = nanotime +var Cputicks = cputicks +var CyclesPerSecond = pprof_cyclesPerSecond var NetpollBreak = netpollBreak var Usleep = usleep -- cgit v1.3