RFR: 8342818: Implement CPU Time Profiling for JFR

Johannes Bechberger jbechberger at openjdk.org
Wed Oct 30 17:50:14 UTC 2024


On Tue, 29 Oct 2024 13:34:48 GMT, Erik Gahlin <egahlin at openjdk.org> wrote:

>> This is the code for the [JEP draft: CPU Time based profiling for JFR].
>
> test/jdk/jdk/jfr/event/metadata/TestLookForUntestedEvents.java line 92:
> 
>> 90:     // Experimental events
>> 91:     private static final Set<String> experimentalEvents = Set.of(
>> 92:         "Flush", "SyncOnValueBasedClass", "CPUTimeSample", "CPUTimeSampleLoss");
> 
> The reason we added an exclusion list for experimental events is so developers wouldn't be forced to write a test. Since you have a test for the CPUTimeSample event, I think you can remove it.
> 
> (If TestLookForUntestedEvents is not able to find the event test, write the event name in the test)

But this leads to fails, because of the loop that initialized the `jfrEventTypes`:

       for (EventType type : FlightRecorder.getFlightRecorder().getEventTypes()) {
            if (type.getAnnotation(Experimental.class) == null) {
                jfrEventTypes.add(type.getName().replace("jdk.", ""));
            }
        }

Only events that not experimental are included. But `CPUTimeSample` is experimental.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20752#discussion_r1823122743


More information about the hotspot-dev mailing list