-
Notifications
You must be signed in to change notification settings - Fork 896
Allow users to control the clock implementation #723
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
Comments
There is already a JVM option |
Oh, I was unaware of that. Thank you for the pointer. I'll give this a go early next week and will report back. |
I thought a bit more about Given that additional context, would you be open for me to work on a PR that allows to control the clock from the command line when invoking async profiler or is this a feature that you'd rather not include? |
I implemented the feature myself: it's quite simple, but requires changes in multiple places that may not be obvious from the first glance. Use Be careful when using the option in |
I did a test now of the latest
Thanks for the hint! In our use case that's fine though as we only capture CPU samples via async profiler. |
We run async profiler and
perf sched record
to gather CPU and scheduler stack traces respectively. For async profiler we use-o jfr
. We then postprocess and merge both output files into a combined view which allows us to see what code was on CPU and the reason why it went off CPU (and at which point).A key issue is alignment of timestamps. While we can configure a specific clock source with
perf sched record
(e.g.perf sched record -k CLOCK_MONOTONIC
), the clock source in async profiler is not configurable and dependent on the CPU architecture, which defaults tordtsc
on Intel CPUs andOS::nanotime
(which isCLOCK_MONOTONIC
in Linux) for all others.In order to align timestamps of multiple data sources we would like to have control over the clock source in async profiler similar to
perf sched record
via a command line switch. Just being able to force usage ofOS::nanotime
would be sufficient, there is no need to implement new clock sources. I did a proof of concept by simply settingTSC_SUPPORTED
tofalse
which allowed us to align the timestamps.I'm happy to work on a PR but I first wanted to gauge whether there is interest for this feature.
The text was updated successfully, but these errors were encountered: