RFR: 8271949: dumppath in -XX:FlightRecorderOptions does not affect

Yasumasa Suenaga ysuenaga at openjdk.java.net
Mon Aug 30 06:44:32 UTC 2021


On Mon, 30 Aug 2021 06:10:45 GMT, Denghui Dong <ddong at openjdk.org> wrote:

>> We set `dumppath` in `-XX:FlightRecorderOptions` or `JFR.configure dumppath` jcmd when we want to set emergency dump path. However they do not afffect.
>> 
>> ### -XX:FlightRecorderOptions
>> 
>> 
>> $ java -XX:FlightRecorderOptions=dumppath=`pwd` -XX:StartFlightRecording -Xlog:exceptions=info --version
>> [0.032s][info][exceptions] Exception <a 'java/lang/IllegalArgumentException'{0x00000007470163b8}: Unknown argument 'dumppath' in diagnostic command.> (0x00000007470163b8)
>> thrown [open/src/hotspot/share/services/diagnosticFramework.cpp, line 215]
>> for thread 0x00007f4f700236a0
>> [0.033s][error][arguments ] Unknown argument 'dumppath' in diagnostic command.
>> Error occurred during initialization of VM
>> Failure when starting JFR on_create_vm_2
>> 
>> 
>> ### jcmd
>> 
>> `jcmd` shows the configuration change was succeeded, but it would not affect.
>> 
>> 
>> $ jcmd 1046 JFR.configure dumppath=/tmp
>> 1046:
>> Dump path: /tmp
>
> src/jdk.jfr/share/classes/jdk/jfr/internal/Options.java line 51:
> 
>> 49:     private static final boolean DEFAULT_SAMPLE_THREADS = true;
>> 50:     private static final long DEFAULT_MAX_CHUNK_SIZE = 12 * 1024 * 1024;
>> 51:     private static final SafePath DEFAULT_DUMP_PATH = new SafePath(".");
> 
> Why do need to change DEFAULT_DUMP_PATH here?

Emergency dump will be dumped on current work directory now. This default value does not effect. So I changed it to current behavior, and it is nature because other dumps (hs_err, cireplay) are also dumped on current directory.

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

PR: https://git.openjdk.java.net/jdk/pull/5019


More information about the hotspot-jfr-dev mailing list