On Wed, 26 Jun 2024 18:52:40 GMT, Erik Gahlin <egah...@openjdk.org> wrote:

>> This PR changes GenerateJfrFiles.java so that the generated 
>> `JfrNativeSettings` union does not include JFR structs.`JfrNativeSettings` 
>> is meant to hold the settings for JFR events, but previously also included 
>> JFR structs such as MetaspaceSizes, StackFrame, CopyFailed, 
>> G1EvacuationStatistics, ObjectSpace, VirtualSpace. These are not events, but 
>> instead are JFR `Type`s, and so do not have settings such as stacktraces or 
>> thresholds.
>> 
>> The inclusion of JFR structs in `JfrNativeSettings` was problematic because 
>> it could cause a displacement between event ID and`JfrNativeSettings` array 
>> index (each index is meant to correspond with a specific event ID).
>> 
>> Testing:
>> - jdk/jdk/jfr
>> - tier1
>
> What drives the settings system is Java where the event name is linked to the 
> ID, not the enum, e.g. 
> 
>    jdk.jfr.internal.JVM.setEnabled(eventTypeId, enabled);
> 
> If the type IDs are assigned in the order they appear in metadata.xml, then 
> there will (or can) be holes. If GenerateJfrFiles.java makes sure native 
> event types are processed first and then structs, we should be fine.

Thank you for the review @egahlin !

-------------

PR Comment: https://git.openjdk.org/jdk/pull/19891#issuecomment-2194648286

Reply via email to