Graal: Profile libjvmcicompiler.so

Created on 6 Dec 2019  路  3Comments  路  Source: oracle/graal

Hi,

I ran a few test cases on graalvm-ce-java8-linux-amd64-19.3.0 and saw that libjvmcicompiler.so takes 3.5% to 5% CPU time based on the different test cases. I was wondering what happened in this library so I used a profile VTune to take a look. However, I can only see the function addresses instead of function names inside this lib. Maybe the symbols are stripped out. Maybe I need to try other profilers. My questions are:

  1. How to profile this lib libjvmcicompiler.so?
  2. What is this library?
  3. How to make this library use less CPU(e.g. PGO)?

Any suggestions are appreciated.

Most helpful comment

libjvmcicompiler.so is the GraalVM compiler compiled to a native library using GraalVM Native Image. It's not quite accurate to refer to it as the "C2 compiler". It's an alternative to the C2 compiler that replaces it as the top-tier JIT compiler in GraalVM. For more details, check out https://medium.com/graalvm/libgraal-graalvm-compiler-as-a-precompiled-graalvm-native-image-26e354bee5c.

All 3 comments

I did some research about libjvmcicompiler and found following source: https://openjdk.java.net/jeps/8223220

To my understanding the lib is the C2 (Graal)-Compiler as a native executable. The Graal-Jit-Compiler is developed in Java and was compiled to a native binary via the SubstrateVM. I do not know how this happens, but it is probably created with the PGO-Feat from SubstrateVM.

If libjvmcicompiler is the C2 values between 3.5% and 5% are remarkable. On a serious application you most likely see 10-15% cpu util. for profiling and jitting code. This are values, which I see in my applications.

How to profile this lib libjvmcicompiler.so?

Did you try using perf (http://www.brendangregg.com/FlameGraphs/cpuflamegraphs.html#perf) to profile the application? Maybe the symbols are stripped from libjvmcicompiler. Last time I used perf on a executable created with SubstrateVM, the symbols were not broken and I could see the method-names.

libjvmcicompiler.so is the GraalVM compiler compiled to a native library using GraalVM Native Image. It's not quite accurate to refer to it as the "C2 compiler". It's an alternative to the C2 compiler that replaces it as the top-tier JIT compiler in GraalVM. For more details, check out https://medium.com/graalvm/libgraal-graalvm-compiler-as-a-precompiled-graalvm-native-image-26e354bee5c.

Please re-open if your questions are not answered.

Was this page helpful?
0 / 5 - 0 ratings