RFR: 8261441: JFR: Filename expansion [v7]
Erik Gahlin
egahlin at openjdk.java.net
Wed Jun 23 10:00:28 UTC 2021
On Wed, 23 Jun 2021 08:26:18 GMT, Denghui Dong <ddong at openjdk.org> wrote:
>> Denghui Dong has updated the pull request incrementally with one additional commit since the last revision:
>>
>> update
>
> src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/AbstractDCmd.java line 298:
>
>> 296: } else if (nc == 't') {
>> 297: if (time == null) {
>> 298: time = new SimpleDateFormat("yyyy-MM-dd_HH-mm-ss").format(new Date());
>
> I use the current time here so that different filenames could be generated for multiple dumps of one process.
There is a method, jdk.internal.Utils::formatDateTime, which is used to generate a filename if a directory is specified (instead of file). It would be good if the same format and method could be used with '%t'. That method would avoid loading the SimpleDateFormat class and other time/formatting related classes.
The filename is now expanded when the recording is started, but when you use 'filename=directory', it is generated when the file is written. It would be good if the same could be true with '%t' and '%p'. It might look a bit strange with JFR.check, but I think that is OK.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4550
More information about the hotspot-jfr-dev
mailing list