]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: cpu profiler to use high resolution timers on Windows
authorqmuntal <quimmuntal@gmail.com>
Mon, 31 Jul 2023 15:33:40 +0000 (17:33 +0200)
committerQuim Muntal <quimmuntal@gmail.com>
Wed, 2 Aug 2023 15:25:43 +0000 (15:25 +0000)
commita09ea59198faf85d41da6699220319089c98d86b
tree6c7a8cfd266fd917b2466ebb68073e655110fa27
parent54e9d6d5efdd03a75574f78e8cf379a9eec79f6d
runtime: cpu profiler to use high resolution timers on Windows

The CPU profiler skip samples if the sampling rate is too high
for the system timer resolution. This CL uses high resolution
timers on Windows when available, to avoid this problem.

Note that the default sampling rate (100Hz) is already too high
for the Windows timer resolution (15.6ms), so this CL also improves
the default Windows sampling coverage.

Not adding regression tests, as they would be too flaky.

Fixes #61665

Change-Id: Ifdadabc9ebaf56f397eac517bd0e5f1502b956b3
Reviewed-on: https://go-review.googlesource.com/c/go/+/514375
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Quim Muntal <quimmuntal@gmail.com>
Reviewed-by: David Chase <drchase@google.com>
src/runtime/os_windows.go