-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
runtime/pprof: CPU profiles incorrect for kernels with broken setitimer support #13841
Comments
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. |
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. |
Updates #13841 Change-Id: I121bce054e2756c820c76444e51357f474b7f3d6 Reviewed-on: https://go-review.googlesource.com/19161 Reviewed-by: Russ Cox <rsc@golang.org>
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. |
Hi Russ, do you want to add #57722 to the list at the top? |
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.
The text was updated successfully, but these errors were encountered: