RFR: 8351266: JFR: -XX:StartFlightRecording:report-on-exit

Erik Gahlin egahlin at openjdk.org
Sun Mar 9 23:50:49 UTC 2025


Could I have a review of an enhancement that prints 'jfr view' when the JVM exits? The purpose is to simplify usage and avoid the need to dump to a file.

For more details, see the [CSR](https://bugs.openjdk.org/browse/JDK-8351370) 

Example usage:

    $ java -XX:StartFlightRecording:report-on-exit=hot-methods ...
    [0.166s][info][jfr,startup] Started recording 1. No limit specified, using maxsize=250MB as default.
    [0.166s][info][jfr,startup] 
    [0.166s][info][jfr,startup] Use jcmd 66977 JFR.dump name=1 filename=FILEPATH to copy recording data to file.
    
                                              Java Methods that Executes the Most
    
    Method                                                                                                  Samples Percent
    ------------------------------------------------------------------------------------------------------- ------- -------
    sun.java2d.marlin.Renderer._endRendering(int, int)                                                          120  33.99%
    sun.java2d.marlin.MarlinTileGenerator.getAlphaRLE(byte[], int, int)                                          22   6.23%
    sun.awt.image.PNGImageDecoder.produceImage()                                                                 19   5.38%
    sun.java2d.marlin.MarlinCache.copyAARowRLE_WithBlockFlags(int[], int[], int, int, int)                       14   3.97%
    sun.java2d.marlin.MarlinTileGenerator.getAlphaNoRLE(byte[], int, int)                                         7   1.98%
    sun.java2d.marlin.Renderer.copyAARow(int[], int, int, int, boolean)                                           7   1.98%
    sun.awt.image.PNGImageDecoder.filterRow(byte[], byte[], int, int, int)                                        7   1.98%
    sun.java2d.marlin.MarlinCache.copyAARowNoRLE(int[], int, int, int)                                            5   1.42%
    sun.java2d.pipe.BufferedContext.validate(...)                                                                 5   1.42%
    java.awt.GradientPaintContext.clipFillRaster(int[], int, int, int, int, double, double, double)               3   0.85%

Testing: jdk/jdk/jfr

-------------

Commit messages:
 - Initial

Changes: https://git.openjdk.org/jdk/pull/23958/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23958&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8351266
  Stats: 292 lines in 15 files changed: 275 ins; 3 del; 14 mod
  Patch: https://git.openjdk.org/jdk/pull/23958.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23958/head:pull/23958

PR: https://git.openjdk.org/jdk/pull/23958


More information about the hotspot-jfr-dev mailing list