RFR: 8287832: jdk/jfr/event/runtime/TestActiveSettingEvent.java failed with "Expected two batches of Active Setting events" [v2]

Erik Gahlin egahlin at openjdk.org
Fri Oct 7 14:06:08 UTC 2022


On Fri, 7 Oct 2022 10:34:10 GMT, Markus Grönlund <mgronlun at openjdk.org> wrote:

>> src/hotspot/share/jfr/recorder/service/jfrEvent.hpp line 163:
>> 
>>> 161:  private:
>>> 162:   bool should_write() {
>>> 163:     return _evaluated ? _should_commit : is_enabled_for_thread() && evaluate();
>> 
>> I wonder if the order for is_enabled_for_thread() and evaluate() should be flipped? Evaluate is more expensive, but 99,999% of all events will be in an enabled thread, so it will be a win on average. Perhaps:
>> 
>>     bool should_write() {
>>       if (evaluated) {
>>         return should_commit;
>>       }
>>       if (!is_enabled()) {
>>         return false;
>>       }
>>       return evaluate() && JfrThreadLocal::is_included(Thread::current();
>>     }
>
> I think you have a point there. Will update.

Looks good

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

PR: https://git.openjdk.org/jdk/pull/10575


More information about the hotspot-jfr-dev mailing list