RFR: 8203629: Produce events in the JDK without a dependency on jdk.jfr

Erik Gahlin erik.gahlin at oracle.com
Wed Jun 20 18:06:52 UTC 2018


Sounds good Sean.

We will push this RFE when your enhancement is ready and reviewed. We 
like to avoid pushing this to JDK 11 unless it is being used in "the 
current train".

Erik

> Thanks for implementing this enhancement Erik. I think it'll prove to 
> be popular given the functionality available in JFR recordings. I'd 
> agree with Alan's comment that the Event class could be documented 
> better to indicate its purpose.
>
> I'm already using this enhancement to implement some new events in the 
> JDK security libraries. I hope to get a review started real soon on 
> that front.
>
> Regards,
> Sean.
>
> On 19/06/18 03:06, Erik Gahlin wrote:
>> Hi,
>>
>> Could I have a review of an enhancement that will make it possible to 
>> add JFR events to java.base, and possibly other modules in the JDK, 
>> without a compile time dependency on jdk.jfr.
>>
>> Bug:
>> https://bugs.openjdk.java.net/browse/JDK-8203629
>>
>> Webrev:
>> http://cr.openjdk.java.net/~egahlin/8203629.0
>>
>> Testing:
>> Tests in test/jdk/jdk/jfr
>>
>> The functionality is a prerequisite for an upcoming enhancement that 
>> will add JFR events to the security libraries.
>>
>> In short, jdk.jfr.Event (located in jdk.jfr) extends 
>> jdk.internal.event.Event (located in java.base). Metadata for events, 
>> such as labels and descriptions, are added using a mirror event class 
>> located in jdk.jfr module. If the fields of the mirror class and the 
>> event class don't match an InternalError is thrown.
>>
>> To illustrate how the mechanism can be used, see the following 
>> example (not meant to be checked in).
>>
>> http://cr.openjdk.java.net/~egahlin/8203629.example
>>
>> Since the implementation of jdk.internal.event.Event is empty, the 
>> JIT will typically eliminate all traces of JFR functionality unless 
>> Flight Recorder is enabled.
>>
>> Thanks
>> Erik
>>
>



More information about the core-libs-dev mailing list