Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added -XX:[+|-]FlightRecorder` option - JFR #1471

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Sreekala-Gopakumar
Copy link
Contributor

#1469

New -XX:[+|-]FlightRecorder option and other related topics updated.

Closes #1469
Signed-off-by: Sreekala Gopakumar [email protected]

@Sreekala-Gopakumar
Copy link
Contributor Author

Jenkins doc stage

```
where:

`filename=...` specifies the name of the file where the recording must be saved. This parameter is optional.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the filename if filename= isn't specified?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it uses the default defaultJ9recording.jfr file name

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have to specify any directory location of this default file?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default file will be created in the process working directory


`filename=...` specifies the name of the file where the recording must be saved. This parameter is optional.

`duration=..` specifies the duration of the recording. Units are seconds (s), minutes (m), hours (h), and days (d). This parameter is optional. ![End of content that applies to Java 11 (LTS) and later](cr/java_close.png)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the duration if duration= isn't specified?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tajila - Will it continue to record until the recording is manually stopped or the VM is shut down? Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tajila - Will it continue to record until the recording is manually stopped or the VM is shut down? Thanks!

Yes, this is the case

*
* 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
-->

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should add somewhere that this is a tech preview and all options may change in a future release

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by "all options may change"? Which other options? Here we are only discussing the -XXFlightRecorder option, isn't it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I should be more specific. The jcmd options may change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we say "... JFR related jcmd options might change"?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

@Sreekala-Gopakumar
Copy link
Contributor Author

Jenkins doc stage

@Sreekala-Gopakumar
Copy link
Contributor Author

Jenkins doc stage

@Sreekala-Gopakumar
Copy link
Contributor Author

Jenkins doc stage

@Sreekala-Gopakumar
Copy link
Contributor Author

@tajila @pshipton - Please check and let me know if any further changes are required. Thanks!


`filename=...` specifies the name of the file where the recording must be saved. This parameter is optional. If a file name is not specified, the recording is saved in the `defaultJ9recording.jfr` file in the process working directory by default.

`duration=..` specifies the duration of the recording. Units are seconds (s), minutes (m), hours (h), and days (d). This parameter is optional. If the duration is not specified, the tool continues to record until the recording is manually stopped or the VM is shut down. ![End of content that applies to Java 11 (LTS) and later](cr/java_close.png)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should have an example. Can you specify, for example, both hours and minutes, how is this done? 1h30m?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tajila - Could you please provide an example of JFR jcmd command with both these parameters? Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It only accepts 1 unit of time. Ie 12m, 1h, 54s or 2d

eclipse-openj9#1469

New `-XX:[+|-]FlightRecorder` option and other related topics updated. Reviews comments incorporated.

Closes eclipse-openj9#1469
Signed-off-by: Sreekala Gopakumar [email protected]
@Sreekala-Gopakumar
Copy link
Contributor Author

Jenkins doc stage

@Sreekala-Gopakumar
Copy link
Contributor Author

Sreekala-Gopakumar commented Jan 17, 2025

@tajila @pshipton - I have made some changes based on the assumption that

  • '[ ]' is not a part of the command
  • the command is actually
    jcmd <JDK_ID> JFR.start filename=<file_name_with_path> duration=<time_with_unit_of_time>
    So, an example can be
    jcmd 1234 JFR.start filename=/path/ABCD.jfr duration=4s

We use < > to specify the parameter values in a command not [ ]. So for consistency's sake I have changed it.

Please check and let me know if the changes are ok. Thanks!

@pshipton
Copy link
Member

It should be jcmd <JDK_ID> JFR.start [filename=<file_name_with_path>] [duration=<time_with_unit_of_time>]

The [ ] indicates that a part is optional. It's used in other places in the doc, such as https://eclipse.dev/openj9/docs/tool_jcmd/#java-diagnostic-command-jcmd-tool

To start a recording, specify the following command:

```
jcmd <JDK_ID> JFR.start filename=<file_name_with_path> duration=<time_with_unit_of_time>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be consistent with https://eclipse.dev/openj9/docs/tool_jcmd/#java-diagnostic-command-jcmd-tool, it should be <vmid | display name | 0> rather than <JDK_ID>.

```
where:

- `filename=<file_name_with_path>` specifies the name of the file and its location where the recording must be saved. The file name should have a `.jfr` extension. This parameter is optional. If a file name is not specified, the recording is saved in the `defaultJ9recording.jfr` file in the process working directory by default.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest "where the recording is saved" rather than "must be saved".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add documentation for JFR options
3 participants