On Sun, 25 May 2025 21:25:54 GMT, Markus Grönlund <mgron...@openjdk.org> wrote:

>> Johannes Bechberger has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   Fix compilation
>
> src/hotspot/share/jfr/periodic/sampling/jfrCPUTimeThreadSampler.cpp line 601:
> 
>> 599: 
>> 600:   if (jt->thread_state() == _thread_in_native &&
>> 601:     tl->cpu_time_jfr_queue().size() > 
>> tl->cpu_time_jfr_queue().capacity() * 2 / 3) {
> 
> Is this testing what you intend? The precedence order is [*, / ], from left 
> to right associativity

I can't follow. This is testing whether the queue is more than two thirds full.

> src/hotspot/share/jfr/periodic/sampling/jfrThreadSampling.cpp line 374:
> 
>> 372:       JfrCPUTimeThreadSampling::send_lost_event( now, 
>> JfrThreadLocal::thread_id(jt), queue.get_and_reset_lost_samples());
>> 373:     }
>> 374:     queue.clear();
> 
> queue.clear() is the same operation as queue.set_size(0) on line 368.

Good catch.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25302#discussion_r2106957537
PR Review Comment: https://git.openjdk.org/jdk/pull/25302#discussion_r2106960969

Reply via email to