RFR: 8342818: Implement CPU Time Profiling for JFR
Markus Grönlund
mgronlun at openjdk.org
Tue Oct 29 11:00:25 UTC 2024
On Tue, 10 Sep 2024 12:13:15 GMT, Jaroslav Bachorik <jbachorik at openjdk.org> wrote:
>> src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdLoadBarrier.cpp line 102:
>>
>>> 100: }
>>> 101:
>>> 102: JfrBuffer* JfrTraceIdLoadBarrier::renew_sampler_enqueue_buffer(Thread* thread, size_t size) {
>>
>> JfrCPUTimeThreadSampler should not need to take this specialized path because it does not suspend threads. It can be left as is.
>
> Just to clarify - you mean that when we do `JfrTraceIdLoadBarrier::get_sampler_enqueue_buffer(this)` in `jfrCPUTimeThreadSampler.cpp` it may not return `nullptr`?
> Or the whole part of the new code using the `enqueue_buffer` is not needed?
The whole part of calling this special, preemptive handling of an enqueue buffer is only because the JfrSamplerThread will suspend another thread (whiich might hold the malloc lock). Since this approach does not suspend threads, it can be removed. This thread will never tag while it has another thread suspended.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20752#discussion_r1751866247
More information about the hotspot-dev
mailing list