如何禁用Java堆栈帧优化,或使用系统分析器禁用概要文件堆栈?

时间:2023-01-02 18:01:20

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.

系统分析器,如DTrace和Linux perf_events,能够分析JVM的堆栈跟踪。现在,除了符号(这是另一个问题)之外,DTrace和perf_events收集了很多只有一帧的堆栈。这些是部分的,不完整的堆栈。

I've tried DTrace jstack(), and Linux perf_events with both frame pointer and dwarf stack unwinding.

我尝试了DTrace jstack()和Linux perf_events,使用了帧指针和矮人堆栈展开。

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?

我认为这是由于热点编译优化的帧。是否有一种方法可以禁用这种优化,从而使标准的系统分析器(如Solaris DTrace和Linux perf)工作?

I've already tried the following options: -XX:+DeoptimizeRandom -XX:MaxInlineSize=0 -XX:-OmitStackTraceInFastThrow -XX:+UnlockDiagnosticVMOptions -XX:+ShowHiddenFrames

我已经尝试了以下选项:-XX:+DeoptimizeRandom -XX:MaxInlineSize=0 -XX:-OmitStackTraceInFastThrow -XX:+ unlockdiagnostics vmoptions -XX:+ showhiddenframe

1 个解决方案

#1


6  

This is a JVM issue, and is best described by bug:

这是一个JVM问题,最好用bug来描述:

https://bugs.openjdk.java.net/browse/JDK-6276264

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.

虽然这描述了DTrace jstack()的问题,但我认为相同的优化(使用框架指针作为寄存器)是破坏perf_events。

This may be fixed in JDK 9. See:

这可以在JDK 9中修复。看到的:

http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2014-June/014842.html

http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2014-June/014842.html

Thanks to the hotspot developers for answering this.

感谢hotspot开发人员的响应。

#1


6  

This is a JVM issue, and is best described by bug:

这是一个JVM问题,最好用bug来描述:

https://bugs.openjdk.java.net/browse/JDK-6276264

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.

虽然这描述了DTrace jstack()的问题,但我认为相同的优化(使用框架指针作为寄存器)是破坏perf_events。

This may be fixed in JDK 9. See:

这可以在JDK 9中修复。看到的:

http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2014-June/014842.html

http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2014-June/014842.html

Thanks to the hotspot developers for answering this.

感谢hotspot开发人员的响应。