RFR: 8342818: Implement CPU Time Profiling for JFR [v4]

Johannes Bechberger jbechberger at openjdk.org
Wed Nov 6 09:46:40 UTC 2024


On Fri, 1 Nov 2024 15:41:48 GMT, Johannes Bechberger <jbechberger at openjdk.org> wrote:

>> src/hotspot/share/jfr/recorder/stacktrace/jfrAsyncStackTrace.cpp line 116:
>> 
>>> 114:       return false;
>>> 115:     }
>>> 116:     const traceid mid = JfrTraceId::load(frame._method);
>> 
>> This is JfrTraceId::load() barrier code:
>> 
>> inline traceid JfrTraceIdLoadBarrier::load(const Klass* klass, const Method* method) {
>>    assert(klass != nullptr, "invariant");
>>    assert(method != nullptr, "invariant");
>>    if (should_tag(method)) {
>>      SET_METHOD_AND_CLASS_USED_THIS_EPOCH(klass);
>>      SET_METHOD_FLAG_USED_THIS_EPOCH(method);
>>      assert(METHOD_AND_CLASS_USED_THIS_EPOCH(klass), "invariant");
>>      assert(METHOD_FLAG_USED_THIS_EPOCH(method), "invariant");
>>      enqueue(klass);
>>      JfrTraceIdEpoch::set_changed_tag_state();
>>    }
>>    return (METHOD_ID(klass, method));
>> }
>> 
>> What happens if the sampler crashes at one of these routines?
>> 
>> 1. Sets bits in the Klass, but not in the Method, and does not enqueue?
>> 2. Set bits in the Klass and Method, but does not enqueue?
>> 3. Sets bits in Klass, Method and enqueues, but does not notify?
>
> That's a really good point.
> 
> FYI: Today is a bank holiday in Germany, so I don't work on the PR today, but it'll be my main focus in the following weeks

I removed the crash protection that surrounds the code. It isn't needed anymore.

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

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


More information about the hotspot-dev mailing list