chrishantha / jfr-flame-graph

Get Method Sampling from Java Flight Recorder Dump and convert to FlameGraph compatible format.
Apache License 2.0
261 stars 63 forks source link

InvalidFlrFileException on parsing attempt #2

Closed jodzga closed 9 years ago

jodzga commented 9 years ago

I am getting the following exception:

$ ./run.sh -f flight_recording_18060comlinkedinparseqexamplesimplePerfFuseExample12801.jfr -o ~/dev/temp/flame.txt Exception in thread "main" java.lang.RuntimeException: com.jrockit.mc.flightrecorder.internal.parser.binary.InvalidFlrFileException at com.jrockit.mc.flightrecorder.FlightRecordingLoader.loadFile(FlightRecordingLoader.java:194) at org.wso2.jmc.JFRToFlameGraphWriter.write(JFRToFlameGraphWriter.java:57) at org.wso2.jmc.Application.main(Application.java:33) Caused by: com.jrockit.mc.flightrecorder.internal.parser.binary.InvalidFlrFileException at com.jrockit.mc.flightrecorder.internal.parser.binary.ChunkHeader.(ChunkHeader.java:23) at com.jrockit.mc.flightrecorder.FlightRecordingLoader$ChunkBuffer.readHeader(FlightRecordingLoader.java:230) at com.jrockit.mc.flightrecorder.FlightRecordingLoader.(FlightRecordingLoader.java:79) at com.jrockit.mc.flightrecorder.FlightRecordingLoader.loadFile(FlightRecordingLoader.java:157) at com.jrockit.mc.flightrecorder.FlightRecordingLoader.loadFile(FlightRecordingLoader.java:192) ... 2 more

Have you run into this issue? I can open the flr file without a problem using JMC. I am using jdk1.8.0_60 and JMC 5.5.0.165303.

chrishantha commented 9 years ago

I haven't seen this issue before. Is it same for all JFR files? Are you running "jfr-flame-graph" from the same Java version? The run.sh uses "java" command directly, so, please check that.

jodzga commented 9 years ago

It turned out that flr dump was gzipped. Looks like at least flr dumps obtained by Eclipse JMC plugin are gzipped.

mgruendler commented 7 years ago

I had the same problem with dumps which were created from Mission Control. Uncompressing the file with gzip -d solved the problem.

mgruendler commented 7 years ago

If you are interested, I have provided a pull request that decompresses flight recorder files in case they are compressed.

chrishantha commented 7 years ago

Hi @jodzga,

Now there is an option to decompress the JFR file. I merged @mgruendler's PR #6

Thanks a lot for reporting the issue.