57571
|
1 |
.\" Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
|
|
2 |
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
3 |
.\"
|
|
4 |
.\" This code is free software; you can redistribute it and/or modify it
|
|
5 |
.\" under the terms of the GNU General Public License version 2 only, as
|
|
6 |
.\" published by the Free Software Foundation.
|
|
7 |
.\"
|
|
8 |
.\" This code is distributed in the hope that it will be useful, but WITHOUT
|
|
9 |
.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
10 |
.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
11 |
.\" version 2 for more details (a copy is included in the LICENSE file that
|
|
12 |
.\" accompanied this code).
|
|
13 |
.\"
|
|
14 |
.\" You should have received a copy of the GNU General Public License version
|
|
15 |
.\" 2 along with this work; if not, write to the Free Software Foundation,
|
|
16 |
.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
17 |
.\"
|
|
18 |
.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
19 |
.\" or visit www.oracle.com if you need additional information or have any
|
|
20 |
.\" questions.
|
|
21 |
.\"
|
|
22 |
.\" Automatically generated by Pandoc 2.3.1
|
|
23 |
.\"
|
|
24 |
.TH "JFR" "1" "2019" "JDK 13" "JDK Commands"
|
|
25 |
.hy
|
|
26 |
.SH NAME
|
|
27 |
.PP
|
|
28 |
jfr \- parse and print Flight Recorder files
|
|
29 |
.SH SYNOPSIS
|
|
30 |
.PP
|
|
31 |
To print the contents of a flight recording to standard out:
|
|
32 |
.PP
|
|
33 |
\f[CB]jfr\f[R] \f[CB]print\f[R] [\f[I]options\f[R]] \f[I]file\f[R]
|
|
34 |
.PP
|
|
35 |
To print metadata information about flight recording events:
|
|
36 |
.PP
|
|
37 |
\f[CB]jfr\f[R] \f[CB]metadata\f[R] \f[I]file\f[R]
|
|
38 |
.PP
|
|
39 |
To assemble chunk files into a flight recording file:
|
|
40 |
.PP
|
|
41 |
\f[CB]jfr\f[R] \f[CB]assemble\f[R] \f[I]repository\f[R] \f[I]file\f[R]
|
|
42 |
.PP
|
|
43 |
To disassemble a flight recording file into chunk files:
|
|
44 |
.PP
|
|
45 |
\f[CB]jfr\f[R] \f[CB]disassmble\f[R] [\f[I]options\f[R]] \f[I]file\f[R]
|
|
46 |
.PP
|
|
47 |
To view the summary statistics for a flight recording file:
|
|
48 |
.PP
|
|
49 |
\f[CB]jfr\f[R] \f[CB]summary\f[R] \f[I]file\f[R]
|
|
50 |
.TP
|
|
51 |
.B \f[I]options\f[R]
|
|
52 |
Optional: Specifies command\-line options separated by spaces.
|
|
53 |
See the individual subcomponent sections for descriptions of the
|
|
54 |
available options.
|
|
55 |
.RS
|
|
56 |
.RE
|
|
57 |
.TP
|
|
58 |
.B \f[I]file\f[R]
|
|
59 |
Specifies the name of the target flight recording file
|
|
60 |
(\f[CB]\&.jfr\f[R]).
|
|
61 |
.RS
|
|
62 |
.RE
|
|
63 |
.TP
|
|
64 |
.B \f[I]repository\f[R]
|
|
65 |
Specifies the location of the chunk files which are to be assembled into
|
|
66 |
a flight recording.
|
|
67 |
.RS
|
|
68 |
.RE
|
|
69 |
.SH DESCRIPTION
|
|
70 |
.PP
|
|
71 |
The \f[CB]jfr\f[R] command provides a tool for interacting with flight
|
|
72 |
recorder files (\f[CB]\&.jfr\f[R]).
|
|
73 |
The main function is to filter, summarize and output flight recording
|
|
74 |
files into human readable format.
|
|
75 |
There is also support for merging and splitting recording files.
|
|
76 |
.PP
|
|
77 |
Flight recording files are created and saved as binary formatted files.
|
|
78 |
Having a tool that can extract the contents from a flight recording and
|
|
79 |
manipulate the contents and translate them into human readable format
|
|
80 |
helps developers to debug performance issues with Java applications.
|
|
81 |
.SS Subcommands
|
|
82 |
.PP
|
|
83 |
The \f[CB]jfr\f[R] command has several subcommands:
|
|
84 |
.IP \[bu] 2
|
|
85 |
\f[CB]print\f[R]
|
|
86 |
.IP \[bu] 2
|
|
87 |
\f[CB]summary\f[R]
|
|
88 |
.IP \[bu] 2
|
|
89 |
\f[CB]assemble\f[R]
|
|
90 |
.IP \[bu] 2
|
|
91 |
\f[CB]disassemble\f[R]
|
|
92 |
.IP \[bu] 2
|
|
93 |
\f[CB]metadata\f[R]
|
|
94 |
.SS \f[CB]jfr\ print\f[R] subcommand
|
|
95 |
.PP
|
|
96 |
Use \f[CB]jfr\ print\f[R] to print the contents of a flight recording file
|
|
97 |
to standard out.
|
|
98 |
The syntax is:
|
|
99 |
.PP
|
|
100 |
\f[CB]jfr\ print\f[R] [\f[CB]\-\-xml\f[R]|\f[CB]\-\-json\f[R]]
|
|
101 |
[\f[CB]\-\-categories\f[R] <\f[I]filters\f[R]>] [\f[CB]\-\-events\f[R]
|
|
102 |
<\f[I]filters\f[R]>] [\f[CB]\-\-stack\-depth\f[R] <\f[I]depth\f[R]>]
|
|
103 |
<\f[I]file\f[R]>
|
|
104 |
.PP
|
|
105 |
where:
|
|
106 |
.TP
|
|
107 |
.B \f[CB]\-\-xml\f[R]
|
|
108 |
Print the recording in XML format
|
|
109 |
.RS
|
|
110 |
.RE
|
|
111 |
.TP
|
|
112 |
.B \f[CB]\-\-json\f[R]
|
|
113 |
Print the recording in JSON format
|
|
114 |
.RS
|
|
115 |
.RE
|
|
116 |
.TP
|
|
117 |
.B \f[CB]\-\-categories\f[R] <\f[I]filters\f[R]>
|
|
118 |
Select events matching a category name.
|
|
119 |
The filter is a comma\-separated list of names, simple and/or qualified,
|
|
120 |
and/or quoted glob patterns
|
|
121 |
.RS
|
|
122 |
.RE
|
|
123 |
.TP
|
|
124 |
.B \f[CB]\-\-events\f[R] <\f[I]filters\f[R]>
|
|
125 |
Select events matching an event name.
|
|
126 |
The filter is a comma\-separated list of names, simple and/or qualified,
|
|
127 |
and/or quoted glob patterns
|
|
128 |
.RS
|
|
129 |
.RE
|
|
130 |
.TP
|
|
131 |
.B \f[CB]\-\-stack\-depth\f[R] <\f[I]depth\f[R]>
|
|
132 |
Number of frames in stack traces, by default 5
|
|
133 |
.RS
|
|
134 |
.RE
|
|
135 |
.TP
|
|
136 |
.B <\f[I]file\f[R]>
|
|
137 |
Location of the recording file (\f[CB]\&.jfr\f[R])
|
|
138 |
.RS
|
|
139 |
.RE
|
|
140 |
.PP
|
|
141 |
The default format for printing the contents of the flight recording
|
|
142 |
file is human readable form unless either \f[CB]xml\f[R] or \f[CB]json\f[R]
|
|
143 |
is specified.
|
|
144 |
These options provide machine\-readable output that can be further
|
|
145 |
parsed or processed by user created scripts.
|
|
146 |
.PP
|
|
147 |
Use \f[CB]jfr\ \-\-help\ print\f[R] to see example usage of filters.
|
|
148 |
.PP
|
|
149 |
To reduce the amount of data displayed, it is possible to filter out
|
|
150 |
events or categories of events.
|
|
151 |
The filter operates on the symbolic name of an event, set by using the
|
|
152 |
\f[CB]\@Name\f[R] annotation, or the category name, set by using the
|
|
153 |
\f[CB]\@Category\f[R] annotation.
|
|
154 |
If multiple filters are used, events from both filters will be included.
|
|
155 |
If no filter is used, all the events will be printed.
|
|
156 |
If a combination of a category filter and event filter is used, the
|
|
157 |
selected events will be the union of the two filters.
|
|
158 |
.PP
|
|
159 |
For example, to show all GC events and the CPULoad event, the following
|
|
160 |
command could be used:
|
|
161 |
.PP
|
|
162 |
\f[CB]jfr\ print\ \-\-categories\ GC\ \-\-events\ CPULoad\ recording.jfr\f[R]
|
|
163 |
.PP
|
|
164 |
Event values are formatted according to the content types that are being
|
|
165 |
used.
|
|
166 |
For example, a field with the \f[CB]jdk.jfr.Percentage\f[R] annotation
|
|
167 |
that has the value 0.52 is formatted as 52%.
|
|
168 |
.PP
|
|
169 |
Stack traces are by default truncated to 5 frames, but the number can be
|
|
170 |
increased/decreased using the \f[CB]\-\-stack\-depth\f[R] command\-line
|
|
171 |
option.
|
|
172 |
.SS \f[CB]jfr\ summary\f[R] subcommand
|
|
173 |
.PP
|
|
174 |
Use \f[CB]jfr\ summary\f[R] to print statistics for a recording.
|
|
175 |
For example, a summary can illustrate the number of recorded events and
|
|
176 |
how much disk space they used.
|
|
177 |
This is useful for troubleshooting and understanding the impact of event
|
|
178 |
settings.
|
|
179 |
.PP
|
|
180 |
The syntax is:
|
|
181 |
.PP
|
|
182 |
\f[CB]jfr\ summary\f[R] <\f[I]file\f[R]>
|
|
183 |
.PP
|
|
184 |
where:
|
|
185 |
.TP
|
|
186 |
.B <\f[I]file\f[R]>
|
|
187 |
Location of the flight recording file (\f[CB]\&.jfr\f[R])
|
|
188 |
.RS
|
|
189 |
.RE
|
|
190 |
.SS \f[CB]jfr\ metadata\f[R] subcommand
|
|
191 |
.PP
|
|
192 |
Use \f[CB]jfr\ metadata\f[R] to view information about events, such as
|
|
193 |
event names, categories and field layout within a flight recording file.
|
|
194 |
The syntax is:
|
|
195 |
.PP
|
|
196 |
\f[CB]jfr\ metadata\f[R] <\f[I]file\f[R]>
|
|
197 |
.PP
|
|
198 |
where:
|
|
199 |
.TP
|
|
200 |
.B <\f[I]file\f[R]>
|
|
201 |
Location of the flight recording file (\f[CB]\&.jfr\f[R])
|
|
202 |
.RS
|
|
203 |
.RE
|
|
204 |
.SS jfr \f[CB]assemble\f[R] subcommand
|
|
205 |
.PP
|
|
206 |
Use jfr \f[CB]assemble\f[R] to assemble chunk files into a recording file.
|
|
207 |
.PP
|
|
208 |
The syntax is:
|
|
209 |
.PP
|
|
210 |
\f[CB]jfr\ assemble\f[R] <\f[I]repository\f[R]> <\f[I]file\f[R]>
|
|
211 |
.PP
|
|
212 |
where:
|
|
213 |
.TP
|
|
214 |
.B <\f[I]repository\f[R]>
|
|
215 |
Directory where the repository containing chunk files is located
|
|
216 |
.RS
|
|
217 |
.RE
|
|
218 |
.TP
|
|
219 |
.B <\f[I]file\f[R]>
|
|
220 |
Location of the flight recording file (\f[CB]\&.jfr\f[R])
|
|
221 |
.RS
|
|
222 |
.RE
|
|
223 |
.PP
|
|
224 |
Flight recording information is written in chunks.
|
|
225 |
A chunk contains all of the information necessary for parsing.
|
|
226 |
A chunk typically contains events useful for troubleshooting.
|
|
227 |
If a JVM should crash, these chunks can be recovered and used to create
|
|
228 |
a flight recording file using this \f[CB]jfr\ assemble\f[R] command.
|
|
229 |
These chunk files are concatenated in chronological order and chunk
|
|
230 |
files that are not finished (.part) are excluded.
|
|
231 |
.SS \f[CB]jfr\ disassemble\f[R] subcommand
|
|
232 |
.PP
|
|
233 |
Use \f[CB]jfr\ disassemble\f[R] to decompose a flight recording file into
|
|
234 |
its chunk file pieces.
|
|
235 |
The syntax is:
|
|
236 |
.PP
|
|
237 |
\f[CB]jfr\ disassemble\f[R] [\f[CB]\-\-max\-chunks\f[R] <\f[I]chunks\f[R]>]
|
|
238 |
[\f[CB]\-\-output\f[R] <\f[I]directory\f[R]>] <\f[I]file\f[R]>
|
|
239 |
.PP
|
|
240 |
where:
|
|
241 |
.TP
|
|
242 |
.B \f[CB]\-\-output\f[R] <\f[I]directory\f[R]>
|
|
243 |
The location to write the disassembled file, by default the current
|
|
244 |
directory
|
|
245 |
.RS
|
|
246 |
.RE
|
|
247 |
.TP
|
|
248 |
.B \f[CB]\-\-max\-chunks\f[R] <\f[I]chunks\f[R]>
|
|
249 |
Maximum number of chunks per file, by default 5.
|
|
250 |
The chunk size varies, but is typically around 15 MB.
|
|
251 |
.RS
|
|
252 |
.RE
|
|
253 |
.TP
|
|
254 |
.B \f[CB]\-\-max\-size\f[R] <\f[I]size\f[R]>
|
|
255 |
Maximum number of bytes per file.
|
|
256 |
.RS
|
|
257 |
.RE
|
|
258 |
.TP
|
|
259 |
.B <\f[I]file\f[R]>
|
|
260 |
Location of the flight recording file (\f[CB]\&.jfr\f[R])
|
|
261 |
.RS
|
|
262 |
.RE
|
|
263 |
.PP
|
|
264 |
This function can be useful for repairing a broken file by removing the
|
|
265 |
faulty chunk.
|
|
266 |
It can also be used to reduce the size of a file that is too large to
|
|
267 |
transfer.
|
|
268 |
The resulting chunk files are named \f[CB]myfile_1.jfr\f[R],
|
|
269 |
\f[CB]myfile_2.jfr\f[R], etc.
|
|
270 |
If needed, the resulting file names will be padded with zeros to
|
|
271 |
preserve chronological order.
|
|
272 |
For example, the chunk file name is \f[CB]myfile_001.jfr\f[R] if the
|
|
273 |
recording consists of more than 100 chunks.
|
|
274 |
.SS jfr version and help subcommands
|
|
275 |
.PP
|
|
276 |
Use \f[CB]jfr\ \-\-version\f[R] or \f[CB]jfr\ version\f[R] to view the
|
|
277 |
version string information for this jfr command.
|
|
278 |
.PP
|
|
279 |
To get help on any of the jfr subcommands, use:
|
|
280 |
.PP
|
|
281 |
\f[CB]jfr\ <\-\-help|help>\f[R] [\f[I]subcommand\f[R]]
|
|
282 |
.PP
|
|
283 |
where:
|
|
284 |
.PP
|
|
285 |
[\f[I]subcommand\f[R]] is any of:
|
|
286 |
.IP \[bu] 2
|
|
287 |
\f[CB]print\f[R]
|
|
288 |
.IP \[bu] 2
|
|
289 |
\f[CB]metadata\f[R]
|
|
290 |
.IP \[bu] 2
|
|
291 |
\f[CB]summary\f[R]
|
|
292 |
.IP \[bu] 2
|
|
293 |
\f[CB]assemble\f[R]
|
|
294 |
.IP \[bu] 2
|
|
295 |
\f[CB]disassemble\f[R]
|