RFR: 8271949: dumppath in -XX:FlightRecorderOptions does not affect [v4]

Markus Grönlund mgronlun at openjdk.java.net
Tue Sep 14 10:14:05 UTC 2021


On Sat, 4 Sep 2021 01:27:16 GMT, Yasumasa Suenaga <ysuenaga 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
>
> Yasumasa Suenaga has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Set absolute path to JFR emergency dump path
>  - Check write permission on JFR emergency dump path in configuration

"I guess you mentioned to the description in JfrConfigureFlightRecorderDCmd::_dump_path. As you know it is one-liner help message, so I think it is prefer to simple. In addition, I don't change semantics of dumppath (and don't change this description)."

I do think the semantics have changed. From invariantly writing the emergency dump to the $PWD, to instead attempting to do it at a user-provided location, which comes with a new set of challenges.

"I cannot understand it well, but I guess you pointed "current directory" might be change since startup (start recording). But the same problem exists in current implementation because emergency dump path would be created by os::get_current_directory(), and it will be called when emergency dump happens."

I do not understand this comment. My point about a mismatch is that options "repository" and "dumppath" behave differently when you specify a relative path. "repository" starts out from the $PWD, "dumppath" does not.

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

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


More information about the hotspot-jfr-dev mailing list