-
Notifications
You must be signed in to change notification settings - Fork 4
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
Individual thread sampling with JVMCI can return negative numbers #9
Comments
Would you, please, provide concrete data here and the JVM configuration? Are the negative data arbitrary numbers or do they look like PAPI error codes? I suspect this means that we are measuring one thread several times and the second event set could not be started... |
I just took the Graal 1.0.0 release candidate on OpenJDK, current ScalaBench (652052961d26c63518995de19f7329374fc26fbe) and agent (12c6f8b), run it on my laptop and saw this:
|
Perhaps another observation. It seems that in cases where there are more negative numbers present in the same output line, they are the same numbers: xalan,15650,643145035,4980000000,1937,51952,2985997795,2985997795,2985997795 |
After some investigation, the reason is the counter access code in PAPI. The perf_event component uses interpolation when querying the counter values, adding the actual value of the PMC register to the kernel reported offset. Problem is, the current value of the PMC register is read in the context of the thread doing PAPI_read (), but the kernel reported offset comes from a different context, and the computation therefore does not make sense. There are some code paths through PAPI_read () that bypass the interpolation, for example when PAPI is compiled with --enable-perfevent-rdpmc=no, but that will slow down reading for all perf_event counters so not sure if we want it. On the other hand, setting the inherit flag disables the interpolation too, so perhaps we already do not have it on the main counters we use ? Check _pe_read () in components/perf_event/perf_event.c. |
In some of the ScalaBench measurements with JVMCI merge threads turned OFF, the values in the instruction count column are occassionally negative. This could be a problem in the ScalaBench sampling helper class, but since it does very little with the data, it is more likely an agent issue.
The text was updated successfully, but these errors were encountered: