JFR(1)
β¨ NAME β¨
okay so bestie, welcome to JFR(1) β aka jfr, straight from the JDK Commands β and it's literally the tool to print and manipulate Flight Recorder files π
β¨
π SYNOPSIS π
Here's the whole group-chat lineup, no cap. Each one is its own little main-character moment π
To print the contents of a flight recording to standard out:
jfr print [options] file
To display aggregated event data on standard out:
jfr view [options] file
To configure a .jfc settings file:
jfr configure [options]
To print metadata information about flight recording events:
jfr metadata [file]
To view the summary statistics for a flight recording file:
jfr summary file
To remove events from a flight recording file:
jfr scrub [options] 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
yes, bestie, that last one is spelled disassmble in the original β keep it exactly like that, iykyk π«Ά
πΈ the little arguments, explained πΈ
optionsβ Optional: Specifies command-line options separated by spaces. See the individual subcomponent sections for descriptions of the available options πfileβ Specifies the name of the target flight recording file (.jfr) π¦repositoryβ Specifies the location of the chunk files which are to be assembled into a flight recording π
π DESCRIPTION π
okay so the jfr command is literally your little bestie for interacting with flight recorder files (.jfr). Its main character job is to filter, summarize, and output flight recording files into human-readable format. It also has support for scrubbing, merging, and splitting recording files. no cap.
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 debug performance issues with Java applications. that's the whole point, bestie π
β¨ Subcommands β¨
The jfr command has several subcommands:
printviewconfiguremetadatasummaryscrubassembledisassemble
π jfr print subcommand π
Use jfr print to print the contents of a flight recording file to standard out. so iconic.
The syntax is:
jfr print [--xml|--json] [--categories <filters>] [--events <filters>] [--stack-depth <depth>] <file>
where:
--xmlβ Print the recording in XML format.--jsonβ Print the recording in JSON format.--categories <filters>β Select events matching a category name. The filter is a comma-separated list of names, simple and/or qualified, and/or quoted glob patterns.--events <filters>β Select events matching an event name. The filter is a comma-separated list of names, simple and/or qualified, and/or quoted glob patterns.--stack-depth <depth>β Number of frames in stack traces, by default5.<file>β Location of the recording file (.jfr).
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. periodt.
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%. cute.
Stack traces are by default truncated to 5 frames, but the number can be increased/decreased using the --stack-depth command-line option.
π¦ jfr view subcommand π¦
Use jfr view to aggregate and display event data on standard out. very main character energy.
The syntax is:
jfr view [--verbose] [--width <integer>] [--truncate <mode>] [--cell-height <integer>] <view> <file>
where:
--verboseβ Displays the query that makes up the view.--width <integer>β The width of the view in characters. Default value depends on the view.--truncate <mode>β How to truncate content that exceeds space in a table cell. Mode can be'beginning'or'end'. Default value is'end'.--cell-height <integer>β Maximum number of rows in a table cell. Default value depends on the view.<view>β Name of the view or event type to display. Usejfr --help viewto see a list of available views.<file>β Location of the recording file (.jfr).
The <view> parameter can be an event type name. Use the jfr view types <file> to see a list. To display all views, use jfr view all-views <file>. To display all events, use jfr view all-events <file>. slay.
πΈ jfr configure subcommand πΈ
Use jfr configure to configure a .jfc settings file. yes bestie, settings tea β
The syntax is:
jfr configure [--interactive] [--verbose] [--input ] [--output ] [option=value]* [event-setting=value]*
--interactiveβ Interactive mode where the configuration is determined by a set of questions.--verboseβ Displays the modified settings.--input <files>β A comma-separated list of.jfcfiles from which the new configuration is based. If no file is specified, the default file in the JDK is used (default.jfc). If'none'is specified, the new configuration starts empty.--output <file>β The filename of the generated output file. If not specified, the filenamecustom.jfcwill be used.option=valueβ The option value to modify. To see available options, usejfr help configure.event-setting=valueβ The event setting value to modify. Use the form:<event-name>#<setting-name>=<value>To add a new event setting, prefix the event name with'+'.
The whitespace delimiter can be omitted for timespan values, i.e. 20ms. For more information about the settings syntax, see Javadoc of the jdk.jfr package.
π§ jfr metadata subcommand π§
Use jfr metadata to display information about events, such as event names, categories, and field layout within a flight recording file. iykyk.
The syntax is:
jfr metadata [--categories ] [--events ] []
--categories <filter>β Select events matching a category name. The filter is a comma-separated list of names, simple and/or qualified, and/or quoted glob patterns.--events <filter>β Select events matching an event name. The filter is a comma-separated list of names, simple and/or qualified, and/or quoted glob patterns.<file>β Location of the recording file (.jfr).
If the parameter is omitted, metadata from the JDK where the 'jfr' tool is located will be used.
π jfr summary subcommand π
Use jfr summary to print statistics for a recording. For example, a summary can illustrate the number of recorded events and how much disk space they used. This is useful for troubleshooting and understanding the impact of event settings. honestly kinda iconic for debugging.
The syntax is:
jfr summary <file>
where:
<file>β Location of the flight recording file (.jfr).
π jfr scrub subcommand π
Use jfr scrub to remove sensitive contents from a file or to reduce its size. privacy queen behavior.
The syntax is:
jfr scrub [--include-events <filter>] [--exclude-events <filter>] [--include-categories <filter>] [--exclude-categories <filter>] [--include-threads <filter>] [--exclude-threads <filter>] <input-file> [<output-file>]
--include-events <filter>β Select events matching an event name.--exclude-events <filter>β Exclude events matching an event name.--include-categories <filter>β Select events matching a category name.--exclude-categories <filter>β Exclude events matching a category name.--include-threads <filter>β Select events matching a thread name.--exclude-threads <filter>β Exclude events matching a thread name.<input-file>β The input file to read events from.<output-file>β The output file to write filter events to. If no file is specified, it will be written to the same path as the input file, but with"-scrubbed"appended to the filename.
The filter is a comma-separated list of names, simple and/or qualified, and/or quoted glob patterns. If multiple filters are used, they are applied in the specified order.
π₯ jfr assemble subcommand π₯
Use jfr assemble to assemble chunk files into a recording file. putting the pieces back together, bestie π§©
The syntax is:
jfr assemble <repository> <file>
where:
<repository>β Directory where the repository containing chunk files is located.<file>β Location of the flight recording file (.jfr).
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. no cap, that .part exclusion matters.
π jfr disassemble subcommand π
Use jfr disassemble to decompose a flight recording file into its chunk file pieces. breaking it down like a group chat screenshot π
The syntax is:
jfr disassemble [--max-chunks <chunks>] [--output <directory>] <file>
where:
--output <directory>β The location to write the disassembled file, by default the current directory.--max-chunks <chunks>β Maximum number of chunks per file, by default5. The chunk size varies, but is typically around15 MB.--max-size <size>β Maximum number of bytes per file.<file>β Location of the flight recording file (.jfr).
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. obsessed with the zero-padding detail, honestly.
π jfr version and help subcommands π
Use jfr --version or jfr version to view the version string information for this jfr command.
To get help on any of the jfr subcommands, use:
jfr <--help|help> [subcommand]
where [subcommand] is any of:
printviewconfiguremetadatasummaryscrubassembledisassemble
π
cute little footer tea: this pageβs source/version is JDK 21, its date is 2023, and its manual-page tag is JFR(1). thatβs the whole vibe, bestie! π
π¦ where this page comes from
- centos-stream 10: java-21-openjdk-devel-fastdebug 1:21.0.12.1.1-2.1.el10 Β· ASL 1.1 and ASL 2.0 and BSD and BSD with advertising and GPL+ and GPLv2 and GPLv2 with exceptions and IJG and LGPLv2+ and MIT and MPLv2.0 and Public Domain and W3C and zlib and ISC and FTL and RSA
- Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms