System profilers, like DTrace and Linux perf_events, are able to profile stack traces from the JVM. Now, symbols aside (that's another problem), both DTrace and perf_events collect many stacks that are only 1 frame. These are partial, incomplete stacks.
I've tried DTrace jstack(), and Linux perf_events with both frame pointer and dwarf stack unwinding.
I believe this is due to hotspot compiling optimized frames. Is there a way to disable this optimization, so that standard system profilers (like Solaris DTrace, and Linux perf) work?
I've already tried the following options: -XX:+DeoptimizeRandom -XX:MaxInlineSize=0 -XX:-OmitStackTraceInFastThrow -XX:+UnlockDiagnosticVMOptions -XX:+ShowHiddenFrames
This is a JVM issue, and is best described by bug:
https://bugs.openjdk.java.net/browse/JDK-6276264
While that describes the problem with DTrace jstack(), I believe the same optimization (using the frame pointer as a register) is breaking perf_events.
This may be fixed in JDK 9. See:
http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2014-June/014842.html
Thanks to the hotspot developers for answering this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With