RFR: 8352251: Implement JEP 518: JFR Cooperative Sampling [v23]

Patricio Chilano Mateo pchilanomate at openjdk.org
Fri May 16 00:05:54 UTC 2025


On Thu, 15 May 2025 23:05:03 GMT, Markus Grönlund <mgronlun at openjdk.org> wrote:

>> The check, or some version of it, is already in place.
>> 
>> Please check in JfrStackTrace.cpp:
>> 
>> if (method->intrinsic_id() == vmIntrinsicID::_Continuation_enterSpecial) {
>>     assert(JfrThreadLocal::is_vthread(jt), "invariant");
>>     const ContinuationEntry* const cont_entry = jt->last_continuation();
>>     assert(cont_entry != nullptr, "invariant");
>>     return cont_entry->is_virtual_thread();
>>   }
>
>> Another case we are missing is when we freeze. We should call `Jfr::check_and_process_sample_request` before copying the frames to the heap.
> 
> Where do you suggest to place it best?

Thanks. So if we create the request as mentioned before I’m not sure that check will do it. I see it’s checking for enterSpecial instead of its caller. Also I see we only get there in the interpreted case, but the caller of enterSpecial could be compiled. I was thinking of an early check where if we are in a vthread and the sample request is not within the continuation just do a bias sampling.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24296#discussion_r2092119637


More information about the hotspot-jfr-dev mailing list