RFR: 8271949: dumppath in -XX:FlightRecorderOptions does not affect [v7]
Yasumasa Suenaga
ysuenaga at openjdk.java.net
Thu Oct 14 10:45:11 UTC 2021
On Thu, 14 Oct 2021 10:21:23 GMT, Markus Grönlund <mgronlun at openjdk.org> wrote:
>> Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Clear _path_buffer when emergency dump fallbacks
>
> Looks good.
>
> Can you please add the following diff. It adds a warning to let users know that it was not possible to create the file in their preferred location. It complements the warning written at start time, with up-to-date information should a problem have arisen at dump time.
> <pre>
>
> diff --git a/src/hotspot/share/jfr/recorder/repository/jfrEmergencyDump.cpp b/src/hotspot/share/jfr/recorder/repository/jfrEmergencyDump.cpp
> index 91d2be766da..c00bed02b52 100644
> --- a/src/hotspot/share/jfr/recorder/repository/jfrEmergencyDump.cpp
> +++ b/src/hotspot/share/jfr/recorder/repository/jfrEmergencyDump.cpp
> @@ -140,8 +140,8 @@ bool JfrEmergencyDump::open_emergency_dump_file() {
>
> bool result = open_emergency_dump_fd(create_emergency_dump_path());
> if (!result && *_dump_path != '\0') {
> - // Attempt to create emergency dump to current directory
> - // if we couldn't create it on `dumppath=`.
> + log_warning(jfr)("Unable to create an emergency dump file at the location set by dumppath=%s", _dump_path);
> + // Fallback. Try to create it in the current directory.
> *_dump_path = '\0';
> *_path_buffer = '\0';
> result = open_emergency_dump_fd(create_emergency_dump_path());
>
> </pre>
Thanks @mgronlun !
I pushed your change to this PR.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5019
More information about the hotspot-jfr-dev
mailing list