RFR: 8334492: DiagnosticCommands (jcmd) should accept %p in output filenames and substitute PID [v2]
Thomas Stuefe
stuefe at openjdk.org
Wed Jul 17 14:24:54 UTC 2024
On Wed, 17 Jul 2024 14:02:01 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> Sonia Zaldana Calles has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Updating copyright headers
>
> src/hotspot/share/code/codeCache.cpp line 1800:
>
>> 1798: jio_snprintf(fname, sizeof(fname), "/tmp/perf-%d.map",
>> 1799: os::current_process_id());
>> 1800: }
>
> Arguably one could just do
>
> constexpr char[] filename_default = "/tmp/perf-%p.map";
> Arguments::copy_expand_pid(filename == nullptr ? filename_default : filename, .....);
This pattern can be followed in all cases where we have default filenames
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20198#discussion_r1681149193
More information about the core-libs-dev
mailing list