Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
runtime/pprof: CPU profiles incorrect for kernels with broken setitimer support #13841
Comments
rsc
added this to the Unplanned milestone
Jan 6, 2016
Jan 6, 2016
This was referenced
Sent a change to skip the test on dragonfly too: https://go-review.googlesource.com/18306 after failures: http://build.golang.org/log/9e126b69f4629739f0c7951ce4d42cc46db54a31 |
Added Dragonfly, thanks. |
bradfitz
referenced this issue
Jan 8, 2016
Closed
runtime/pprof: disable profiling test on Windows too? #13871
FreeBSD has the same problem as OpenBSD and DragonflyBSD, but by default runs at 1000Hz, so the problem is less noticeable. |
I don't believe the description of OpenBSD is entirely accurate. In particular, OpenBSD's "hard clock" interrupt runs at 100Hz (i.e., 10ms clock tick intervals) on all CPUs supported by Go. Also, I don't see any evidence that OpenBSD's kernel cares about whether the process was running for the full time slice; only that it was running when the interrupt fired. The process may only have actually run for the last 1ms of the clock slice, but it will still have its timer credited for the full 10ms. Lastly, I'm not sure it's relevant to the runtime/pprof tests, but for completeness: OpenBSD sends SIGPROF to the process, not the thread. It's just that it favors sending to the running thread when possible. If the interrupted thread has blocked SIGPROF and the process has other threads that are not blocking SIGPROF, the kernel will send SIGPROF to one of those instead. |
pushed a commit
that referenced
this issue
Feb 2, 2016
alk
referenced this issue
Feb 20, 2016
Open
runtime/pprof: details of Linux SIGPROF delivery may cause very skewed profiles #14434
tdfbsd
commented
Jul 8, 2016
From Matt Dillon on Dragonfly: That one really isn't a bug. DragonFly will profile at any point (not just on a full tick), but we use a low resolution profiling timer so the collected statistics will not be very good for short tests. |
rsc commentedJan 6, 2016
As of Go 1.6, pprof's CPU profiles are known to be incorrect on a few systems due to what are arguably kernel bugs. This issue documents those systems.
The text below distinguishes a profile being incomplete (missing profile samples for code that was running) from being incorrect (containing samples for code that wasn't running).
set hires_tick = 1
to/etc/system
can mitigate this problem somewhat by reducing the clock tick to 1ms.Please comment on this issue only if the text above is incomplete or incorrect; we will keep this top-level comment up to date.