13

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

Brendan Gregg
  • 965
  • 8
  • 10

1 Answers1

7

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.

Brendan Gregg
  • 965
  • 8
  • 10