RFR: 8298526: The detection state allows records in the stopped state to be closed when JFR.stop [v6]
xpbob
duke at openjdk.org
Mon Dec 19 03:07:49 UTC 2022
On Sun, 18 Dec 2022 14:07:24 GMT, Erik Gahlin <egahlin at openjdk.org> wrote:
>> Thanks for review
>> @egahlin
>> I test 2 cases can be recorded normally
>> 1.
>>
>> jcmd 18365 JFR.start duration=30s
>> 18365:
>> Started recording 1. The result will be written to:
>
>> test 2 cases can be recorded normally 1.
>
> Looks like the logic can be simplified to something like this. The generated filename will not be a directory.
>
> recording.setSettings(s);
> SafePath safePath = null;
>
> + // Generate dump filename if user has specified a time-based recording
> + if (duration != null && path == null) {
> + path = resolvePath(recording, null).toString();
> + }
> +
> if (path != null) {
> try {
> if (dumpOnExit == null) {
>
> I also think you need to update tests.
>
> For example, jdk.jfr.startupargs.TestStartDuration could fail due to a race condition if the recording is closed after it is finished. Today the test waits for a stopped state. This will not happen.
>
> If you like, I can take over the issue? This might be more than you have planned for.
@egahlin
Thanks for review
The code has been updated
> If you like, I can take over the issue? This might be more than you have planned for.
Fine. Please go ahead.
-------------
PR: https://git.openjdk.org/jdk/pull/11625
More information about the hotspot-jfr-dev
mailing list