RFR: 8342818: Implement CPU Time Profiling for JFR

Jaroslav Bachorik jbachorik at openjdk.org
Wed Oct 30 09:01:16 UTC 2024


On Wed, 30 Oct 2024 07:34:44 GMT, Johannes Bechberger <jbechberger at openjdk.org> wrote:

>> src/hotspot/share/jfr/periodic/sampling/jfrCPUTimeThreadSampler.cpp line 505:
>> 
>>> 503:       autoadapt_period_if_needed();
>>> 504:       last_autoadapt_check = os::javaTimeMillis();
>>> 505:     }
>> 
>> Do you really want wall-clock time here ???
>
> What else should I use? I want to check for the adaption of the sampling period every few seconds.

Perhaps `os::javaTimeNanos()` would be better? It provides global monotonic time.
OTOH, `os::javaTimeMillis()` can move unexpectedly - a good example is the daylight saving time where the millis would suddenly jump 1 hour to the past.

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

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


More information about the hotspot-dev mailing list