jfr print [options] file
To print metadata information about flight recording events:
jfr metadata file
To assemble chunk files into a flight recording file:
jfr assemble repository file
To disassemble a flight recording file into chunk files:
jfr disassmble [options] file
To view the summary statistics for a flight recording file:
jfr summary file
Flight recording files are created and saved as binary formatted files. Having a tool that can extract the contents from a flight recording and manipulate the contents and translate them into human readable format helps developers to debug performance issues with Java applications.
jfr print [--xml|--json] [--categories <filters>] [--events <filters>] [--stack-depth <depth>] <file>
The default format for printing the contents of the flight recording file is human readable form unless either xml or json is specified. These options provide machine-readable output that can be further parsed or processed by user created scripts.
Use jfr --help print to see example usage of filters.
To reduce the amount of data displayed, it is possible to filter out events or categories of events. The filter operates on the symbolic name of an event, set by using the @Name annotation, or the category name, set by using the @Category annotation. If multiple filters are used, events from both filters will be included. If no filter is used, all the events will be printed. If a combination of a category filter and event filter is used, the selected events will be the union of the two filters.
For example, to show all GC events and the CPULoad event, the following command could be used:
jfr print --categories GC --events CPULoad recording.jfr
Event values are formatted according to the content types that are being used. For example, a field with the jdk.jfr.Percentage annotation that has the value 0.52 is formatted as 52%.
Stack traces are by default truncated to 5 frames, but the number can be increased/decreased using the --stack-depth command-line option.
The syntax is:
jfr summary <file>
jfr metadata <file>
The syntax is:
jfr assemble <repository> <file>
Flight recording information is written in chunks. A chunk contains all of the information necessary for parsing. A chunk typically contains events useful for troubleshooting. If a JVM should crash, these chunks can be recovered and used to create a flight recording file using this jfr assemble command. These chunk files are concatenated in chronological order and chunk files that are not finished (.part) are excluded.
jfr disassemble [--max-chunks <chunks>] [--output <directory>] <file>
This function can be useful for repairing a broken file by removing the faulty chunk. It can also be used to reduce the size of a file that is too large to transfer. The resulting chunk files are named myfile_1.jfr, myfile_2.jfr, etc. If needed, the resulting file names will be padded with zeros to preserve chronological order. For example, the chunk file name is myfile_001.jfr if the recording consists of more than 100 chunks.
To get help on any of the jfr subcommands, use:
jfr <--help|help> [subcommand]
[subcommand] is any of: