RFR: 8358619: Fix interval recomputation in CPU Time Profiler

Johannes Bechberger jbechberger at openjdk.org
Wed Jun 18 11:50:30 UTC 2025


On Wed, 18 Jun 2025 11:45:48 GMT, Jaroslav Bachorik <jbachorik at openjdk.org> wrote:

>> Fixes the recomputation issue by passing either the rate or the period directly to the sampler (instead of just the rate value with the period value converted into a rate). This prevents issues when the number of cores changes during the JFR recording.
>
> src/hotspot/share/jfr/periodic/sampling/jfrCPUTimeThreadSampler.cpp line 171:
> 
>> 169:   double _rate;
>> 170:   u8 _period_nanos;
>> 171:   bool _is_rate;
> 
> Can this be turned into `union`? 
> Only one of `_rate`  or `_period_nanos` will ever be set at a time.

good idea

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25775#discussion_r2154397271


More information about the hotspot-jfr-dev mailing list