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

Johannes Bechberger jbechberger at openjdk.org
Fri Nov 1 15:44:43 UTC 2024


On Fri, 1 Nov 2024 14:22:47 GMT, Markus Grönlund <mgronlun at openjdk.org> wrote:

>> Johannes Bechberger has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Remove min_valid_free_size_bytes
>
> 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

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

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


More information about the hotspot-dev mailing list