Skip to content

Commit abfd578

Browse files
mknyszekgopherbot
authored andcommitted
[release-branch.go1.22] runtime: fix EvFrequency event value on Windows in the new tracer
The value produced for the EvFrequency event on Windows is missing the fact that the cputicks clock gets divided. This results in durations that are consistently wrong by the same factor (about 256). For #65997. Fixes #66201. Change-Id: I930cbfce3499d435c20699f41c11e3227d84f911 Reviewed-on: https://go-review.googlesource.com/c/go/+/567937 LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Michael Knyszek <[email protected]> Reviewed-by: Michael Pratt <[email protected]> (cherry picked from commit 707eba9) Reviewed-on: https://go-review.googlesource.com/c/go/+/570195 Reviewed-by: Than McIntosh <[email protected]>
1 parent 7fb7acb commit abfd578

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/runtime/trace2time.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func traceClockNow() traceTime {
6161
func traceClockUnitsPerSecond() uint64 {
6262
if osHasLowResClock {
6363
// We're using cputicks as our clock, so we need a real estimate.
64-
return uint64(ticksPerSecond())
64+
return uint64(ticksPerSecond() / traceTimeDiv)
6565
}
6666
// Our clock is nanotime, so it's just the constant time division.
6767
// (trace clock units / nanoseconds) * (1e9 nanoseconds / 1 second)

0 commit comments

Comments
 (0)