xctrace command line tool [1] allows trace various aspects of program execution (like context switches, virtual memory ops) as well as sampling CPU PMU counters.
On macOS, there's no replacement for the perf_events-based perfnorm profiler, but it could be built around xctrace tool.
Unfortunately, xctrace does not provide any default settings to sample PMU counters, like it does for regular profiling, so some workarounds need to be applied in order to make the profiler work without any additional user inputs.
[1] https://keith.github.io/xcode-man-pages/xctrace.1.html
On macOS, there's no replacement for the perf_events-based perfnorm profiler, but it could be built around xctrace tool.
Unfortunately, xctrace does not provide any default settings to sample PMU counters, like it does for regular profiling, so some workarounds need to be applied in order to make the profiler work without any additional user inputs.
[1] https://keith.github.io/xcode-man-pages/xctrace.1.html
- relates to
-
CODETOOLS-7903696 JMH: Add xctrace-based perfasm profiler for macOS
- Resolved
- links to
-
Commit(master) openjdk/jmh/c2931c90
-
Review(master) openjdk/jmh/131