RFR: 8259808: Add JFR event to detect GC locker stall [v2]
Stefan Johansson
sjohanss at openjdk.java.net
Sat Jan 23 15:19:40 UTC 2021
On Fri, 22 Jan 2021 13:25:12 GMT, Denghui Dong <ddong at openjdk.org> wrote:
>> src/hotspot/share/gc/shared/gcTraceSend.cpp line 369:
>>
>>> 367: void GCLockerTracer::report_gc_locker() {
>>> 368: Ticks zero;
>>> 369: if (_needs_gc_start_timestamp != zero) {
>>
>> Why is this needed?
>
> 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?
-------------
PR: https://git.openjdk.java.net/jdk/pull/2088
More information about the hotspot-jfr-dev
mailing list