RFR: 8259808: Add JFR event to detect GC locker stall [v2]
Denghui Dong
ddong at openjdk.java.net
Sun Jan 24 01:52:42 UTC 2021
On Sat, 23 Jan 2021 15:16:40 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:
>> Because we can't assume that EventGCLocker is enabled when GC locker is started, in another word, at the beginning and end of the GC locker, whether EventGCLocker is enabled may be inconsistent.
>>
>> So check here if _needs_gc_start_timestamp is not zero, if it is not 0, it needs to reset _needs_gc_start_timestamp regardless of whether the event will be sent.
>
> Ok, so instead of sending an incomplete event you want to skip it? That might be correct but in that case I would prefer adding a helper `GCLockerTracer::is_started()`, that checks if the timestamp is set. That would make the intention more clear I think. This helper could assert that the event is enabled and it could also be used in `inc_stall_count()` since that one won't have any effect if the event is not "started". What do you think about that?
Good idea.
Updated. But I didn't add the assertion that makes sure the event is enabled, because it may be disabled between GCLockerTracer::start_gc_locker and GCLockerTracer::inc_stall_count().
-------------
PR: https://git.openjdk.java.net/jdk/pull/2088
More information about the hotspot-jfr-dev
mailing list