Can't see flame graph from jfr file with JMC or FlameViewer

502 views Asked by At

I've generated a .jfr file with

mvn test -Dtest=DataRunnerIT -DargLine="XX:StartFlightRecording,filename=flight.jfr"

I can confirm that the .jfr file is ok because I've opened it with the Profiler of IntelliJ IDEA Ultimate and the graph is properly rendered.

Now I would like to see this flame graph with a free tool but I can't have it rendered, see below. What am I doing wrong ?

JMC

I've installed JDK 17 Amazon Corretto (on Ubunutu 22.04) and there is no jmc in /bin, which is apparently normal. I've downloaded JMC from jdk.java.net/jmc/8/ and added these lines to the native jmc.ini, as mentioned in the doc:

-vm
/usr/lib/jvm/java-17-amazon-corretto/bin

I can start JMC and open my .jfr file. Some graphs are displayed but the flame graph at the bottom remains blank: JDK Mission Control

FlameViewer

Using the FlameViewer IntelliJ plugin when I upload my .jfr file I get File was not sent, tested with Firefox and Chromium: enter image description here EDIT: I've just discovered these logs related to FlameViewer:

java.lang.NullPointerException: Cannot invoke "java.util.Map.entrySet()" because "stacks" is null
    at com.github.kornilova203.flameviewer.converters.cflamegraph.JfrToStacksConverter.removePackageInParameters(JfrToStacksConverter.java:34)
2

There are 2 answers

2
Hirt On

It could be a problem related to the SWT browser component.

Do you get anything on the console from JMC? Any exceptions? Does any of the other views that are based on the browser component work (like the graph view, or the hierarchical edge bundling view)? If none of the other browser based views work, then it's likely a problem with getting the SWT Browser component to work.

See if this helps: https://www.eclipse.org/swt/faq.php#browserlinux.

0
ThCollignon On

About JMC, from the menu Window > Show View > Other > Mission Control, the Flame View is greyed out:

JMC menu

From the JMC 8 User Guide:

Note:Stack trace graph views such as Graph, Flame, Heat map, and Dependency are currently supported on Linux and Mac.

While Graph View and Heatmap View are available on Windows. It may not be the case for the Flame View yet.

I haven't tested on Linux/Mac.

On Windows I've finally managed to display a flame graph, using IntelliJ plugin Java JFR Profiler.