async-profiler / async-profiler

Sampling CPU and HEAP profiler for Java featuring AsyncGetCallTrace + perf_events

Home Page:https://github.com/async-profiler/async-profiler/releases

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OpenJDK 11 is unsupported?

victornoel opened this issue · comments

Hi,

I am using openjdk 11 and when trying to profile heap allocation (with -e alloc), I get the following error:

VMStructs unavailable. Unsupported JVM?

I am using it on Archlinux (which doesn't include debug symbols unfortunately, see https://bugs.archlinux.org/task/60955)

openjdk 11.0.3 2019-04-16
OpenJDK Runtime Environment (build 11.0.3+4)
OpenJDK 64-Bit Server VM (build 11.0.3+4, mixed mode)

My process is running with the following JVM args as recommended in the README:

 -XX:+UnlockDiagnosticVMOptions -XX:+DebugNonSafepoints

Is this expected or am I missing something?

Async-profiler does support OpenJDK 11, and it is known to work on Arch Linux.
I don't have this configuration at hand right now, I'll check it a bit later.

Have you tried the most recent async-profiler built from master?

@apangin actually, after rebuilding the JDK with debug symbols, it worked.

Maybe the error message could be improved?

@apangin actually, after rebuilding the JDK with debug symbols, it worked.

Maybe the error message could be improved?

Actually, the error message in the application log is more specific:

WARNING: Install JVM debug symbols to improve profile accuracy

BTW, there is async-profiler package in AUR.

It looks like debug symbols are broken in the current package: https://bugs.archlinux.org/task/60955

$ gdb /usr/lib/jvm/java-11-openjdk/lib/server/libjvm.so
...
Reading symbols from /usr/lib/jvm/java-11-openjdk/lib/server/libjvm.so...
warning: the debug information found in "/usr/lib/jvm/java-11-openjdk/lib/server/libjvm.debuginfo" does not match "/usr/lib/jvm/java-11-openjdk/lib/server/libjvm.so" (CRC mismatch).

(no debugging symbols found)...done.

@incubos the message in the application log is not related. When you do cpu profiling for example, the message appears, but async-profiler works well (even if accuracy is improved if you have debug symbols).

My problem was with alloc profiling, which doesn't work at all without debug symbols.

Also, I already linked to the archlinux bug in the description of the current issue, we are aware of it :)

This is true that allocation profiling requires debug symbols.
However, the profiler's error message is clear about that. For example, on CentOS or Ubuntu it prints

No AllocTracer symbols found. Are JDK debug symbols installed?

So, I believe the problem is specific to Arch Linux, and is probably related to OpenJDK build environment. Normally even stripped libjvm.so binary should contain public VMStructs symbols. Otherwise regular utilities based on Serviceability Agent (e.g. jhsdb) will not work either.