Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8359271

JFR: Help text for-XX:StartFlightRecording:report-on-exit should explain option can be repeated

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • 25, 26
    • hotspot
    • None
    • jfr
    • behavioral
    • minimal
    • The `report-on-exit` option is introduced in JDK 25 and is therefore not yet in use. The help text amendment intent is to clarify that the option can be specified multiple times, for multiple views.
    • add/remove/modify command line option

      Summary

      Update the documentation/specification of the option -XX:StartFlightRecording:report-on-exit to emphasize that it can be specified multiple times.

      Problem

      The option -XX:StartFlightRecording:report-on-exit was added in JDK 25, making it convenient to display a jfr view when the application exits. Please see CSR JDK-8351370 for details. Unfortunately, the documentation is unclear whether this option can be specified multiple times for displaying multiple views.

      Most options passed to -XX:StartFlightRecording can't be repeated, and therefore, users may also expect this to be the case for report-on-exit. For example, the following is what happens if filename is specified twice:

      $ java -XX:StartFlightRecording:filename=recording.jfr,filename=recording2.jfr ...
      [0.033s][error][jfr,startup] Option filename can only be specified once

      Solution

      Add the following sentence to the -XX:StartFlightRecording:report-on-exit option, emphasizing that the option can be specified multiple times:

      "To specify more than one view, use the report-on-exit parameter repeatedly, for each view."

      This sentence is similar to the description of the -XX:StartFlightRecording:settings option, which is also an option that can be specified multiple times.

      Specification

      src/java.base/share/man/java.md

           `report-on-exit=`*identifier*
           :   Specifies the name of the view to display when the Java Virtual Machine
      -        (JVM) shuts down. This option is not available if the disk option is set
      -        to false. For a list of available views, see `jfr help view`. By default,
      -        no report is generated.
      +        (JVM) shuts down. To specify more than one view, use the `report-on-exit`
      +        parameter repeatedly, for each view. This option is not available if the disk
      +        option is set to false. For a list of available views, see `jfr help view`.
      +        By default, no report is generated.

            egahlin Erik Gahlin
            egahlin Erik Gahlin
            Markus Grönlund
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: