Skip to content

Commit 70e5fb8

Browse files
authored
Merge pull request #1471 from Sreekala-Gopakumar/1469XXFltRcrd
Added -XX:[+|-]FlightRecorder` option - JFR
2 parents 8eeb8bc + a4f6051 commit 70e5fb8

File tree

3 files changed

+81
-0
lines changed

3 files changed

+81
-0
lines changed

docs/version0.49.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ The following new features and notable changes since version 0.48.0 are included
2929
- [Change to the shared classes cache generation number](#change-to-the-shared-classes-cache-generation-number)
3030
- [New shared classes cache suboption added to adjust the number of startup hints that can be stored](#new-shared-classes-cache-suboption-added-to-adjust-the-number-of-startup-hints-that-can-be-stored)
3131
- [`subAllocator` related `-Xgc` options are added to control the compressed reference allocation](#suballocator-related-xgc-options-are-added-to-control-the-compressed-reference-allocation)
32+
- ![Start of content that applies to Java 11 (LTS) and later](cr/java11plus.png) [New `-XX:[+|-]FlightRecorder` option added](#new-xx-flightrecorder-option-added) ![End of content that applies only to Java 11 and later](cr/java_close.png)
3233

3334
## Features and changes
3435

@@ -66,6 +67,12 @@ The VM can use compressed references to decrease the size of Java objects and ma
6667

6768
For more information, see [Compressed references](allocation.md#compressed-references).
6869

70+
### ![Start of content that applies to Java 11 (LTS) and later](cr/java11plus.png) New `-XX:[+|-]FlightRecorder` option added
71+
72+
This release supports, as a technical preview, the Java Flight Recorder (JFR) tool that is available for OpenJDK 11 and later running on Linux® x86 and Linux on AArch64 only.
73+
74+
You can collect profiling and diagnostic information with the JFR tool. You can enable or disable the JFR tool in the VM with the [`-XX:[+|-]FlightRecorder`](xxflightrecorder.md) option. ![End of content that applies only to Java 11 and later](cr/java_close.png)
75+
6976
## Known problems and full release information
7077

7178
To see known problems and a complete list of changes between Eclipse OpenJ9 v0.48.0 and v0.49.0 releases, see the [Release notes](https://github.com/eclipse-openj9/openj9/blob/master/doc/release-notes/0.49/0.49.md).

docs/xxflightrecorder.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<!--
2+
* Copyright (c) 2017, 2024 IBM Corp. and others
3+
*
4+
* This program and the accompanying materials are made
5+
* available under the terms of the Eclipse Public License 2.0
6+
* which accompanies this distribution and is available at
7+
* https://www.eclipse.org/legal/epl-2.0/ or the Apache
8+
* License, Version 2.0 which accompanies this distribution and
9+
* is available at https://www.apache.org/licenses/LICENSE-2.0.
10+
*
11+
* This Source Code may also be made available under the
12+
* following Secondary Licenses when the conditions for such
13+
* availability set forth in the Eclipse Public License, v. 2.0
14+
* are satisfied: GNU General Public License, version 2 with
15+
* the GNU Classpath Exception [1] and GNU General Public
16+
* License, version 2 with the OpenJDK Assembly Exception [2].
17+
*
18+
* [1] https://www.gnu.org/software/classpath/license.html
19+
* [2] https://openjdk.org/legal/assembly-exception.html
20+
*
21+
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 OR GPL-2.0-only WITH OpenJDK-assembly-exception-1.0
22+
-->
23+
24+
# -XX:[+|-]FlightRecorder
25+
26+
**Linux&reg; on x86, Linux on AArch64**
27+
28+
![Start of content that applies to Java 11 (LTS) and later](cr/java11plus.png) This option enables or disables the Java Flight Recorder (JFR) tool in the VM. This built-in profiling and troubleshooting tool in the VM collects profiling and diagnostic information.
29+
30+
:fontawesome-solid-pencil:{: .note aria-hidden="true"} **Note:** Support for the JFR tool is currently provided as a technical preview. All JFR-related `jcmd` options might change in future releases.
31+
32+
## Syntax
33+
34+
-XX:[+|-]FlightRecorder
35+
36+
| Setting | Effect | Default |
37+
|------------------------------------|---------|:----------------------------------------------------------------------------------:|
38+
| `-XX:+FlightRecorder` | Enable | :fontawesome-solid-check:{: .yes aria-hidden="true"}<span class="sr-only">yes</span> |
39+
| `-XX:-FlightRecorder` | Disable | |
40+
41+
## Explanation
42+
43+
If the JFR tool is enabled in the VM with the `-XX:+FlightRecorder` option, then you can trigger profile and diagnostic recording with the [`jcmd`](https://eclipse.dev/openj9/docs/tool_jcmd/) tool. Recording does not start automatically, it must be triggered.
44+
45+
To start a recording, specify the following command:
46+
47+
```
48+
jcmd <vmid | display name | 0> JFR.start [filename=<file_name_with_path>] [duration=<time_with_unit_of_time>]
49+
50+
```
51+
where:
52+
53+
- Optional parameters are shown in brackets, [ ].
54+
55+
- `filename=<file_name_with_path>` specifies the name of the file and its location where the recording is saved. The file name should have a `.jfr` extension. If a file name is not specified, the recording is saved in the `defaultJ9recording.jfr` file in the process working directory by default.
56+
57+
- `duration=<time_with_unit_of_time>` specifies the duration of the recording. Units of time are `s` (seconds), `m` (minutes), `h` (hours), and `d` (days). You can specify only one unit of time, for example, 54s, 12m, 1h, or 2d. If the duration is not specified, the tool continues to record until the recording is manually stopped or the VM is shut down.
58+
59+
Example:
60+
61+
```
62+
jcmd 1234 JFR.start filename=/path/ABCD.jfr duration=4s
63+
64+
```
65+
66+
![End of content that applies to Java 11 (LTS) and later](cr/java_close.png)
67+
68+
## See Also
69+
70+
- [What's new in version 0.49.0](version0.49.md#new-xx-flightrecorder-option-added)
71+
72+
73+
<!-- ==== END OF TOPIC ==== xxflightrecorder.md ==== -->

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,7 @@ nav:
409409
- "-XX:[+|-]EnableExtendedHCR" : xxenableextendedhcr.md
410410
- "-XX:[+|-]EnsureHashed" : xxensurehashed.md
411411
- "-XX:[+|-]ExitOnOutOfMemoryError" : xxexitonoutofmemoryerror.md
412+
- "-XX:[+|-]FlightRecorder" : xxflightrecorder.md
412413
- "-XX:[+|-]GlobalLockReservation" : xxgloballockreservation.md
413414
- "-XX:[+|-]HandleSIGABRT" : xxhandlesigabrt.md
414415
- "-XX:[+|-]HandleSIGUSR2" : xxhandlesigusr2.md

0 commit comments

Comments
 (0)