RFR(X): 8195818: JFR.start should increase autogenerated name by one

Markus Gronlund markus.gronlund at oracle.com
Thu May 17 20:45:48 UTC 2018


Looks good.

Markus

-----Original Message-----
From: Erik Gahlin 
Sent: den 17 maj 2018 21:08
To: hotspot-jfr-dev at openjdk.java.net; Erik Gahlin <erik.gahlin at oracle.com>
Subject: RFR(X): 8195818: JFR.start should increase autogenerated name by one

Hi,

Could I please have a review of this fix.

Problem is that the recording id is increased by one, if a user makes a dump. It should only increase if you start a new recording.

This happens because internally a clone is created to mimic what would happen if a users stopped the recording with a filename. This is an implementation detail that leaks out.

Fix is to use PlatformRecording class, which is the internal implementation, instead the Recording class which is the public API. 
Since this happens when the recorder lock is held, a user will never be able to see this short temporary recording, so it is safe to reuse the id (0) for all such recordings. The initial id 1.

Bug:
https://bugs.openjdk.java.net/browse/JDK-8195818

Webrev:
http://cr.openjdk.java.net/~egahlin/8195818.1/

Testing:
Tests in test/jdk/jdk/jfr

Thanks
Erik



More information about the hotspot-jfr-dev mailing list