-
Notifications
You must be signed in to change notification settings - Fork 8
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
@pstats
frequently reports 0 cpu cycles
#50
Comments
Maybe all your PMU counters are getting used up? |
That seems likely, but I still thought the effective running time calculation should have given us an indication (i.e. |
@Zentrik I'm worried this might be related to the usage of If I apply this diff: diff --git a/src/LinuxPerf.jl b/src/LinuxPerf.jl
index 7326cb3..a5b1742 100644
--- a/src/LinuxPerf.jl
+++ b/src/LinuxPerf.jl
@@ -1138,9 +1138,9 @@ macro pstats(args...)
@debug dump_groups(groups)
bench = make_bench_threaded(groups, threads = $(opts.threads))
try
- enable_all!()
+ enable!(bench)
val = $(esc(expr))
- disable_all!()
+ disable!(bench)
# trick the compiler not to eliminate the code
@static if isdefined(Base, :donotdelete)
Base.donotdelete(val) then the problem appears to go away. Maybe the global disable is not accounting for being in the middle of a measurement, etc. so the timers become inaccurate? |
It's possible this is a kernel bug, so it'd be good to check on more HW / kernel versions to see if this is fixed on newer kernels or different hardware. |
This happens for me about ~20-50% of the time.
I'm not sure why it thinks it measured 47% of the running time but measured no cycles at all.
The text was updated successfully, but these errors were encountered: