RFR: 8342818: Implement CPU Time Profiling for JFR [v4]

David Holmes dholmes at openjdk.org
Thu Oct 31 02:49:36 UTC 2024


On Wed, 30 Oct 2024 09:11:22 GMT, Johannes Bechberger <jbechberger at openjdk.org> wrote:

>> 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.
>
> Good point, I totally forgot about the monotonicity.

DST changes are not reflected in the low-level clocks, they come from higher-level API's that format times and account for TZ.

The clock underpinning `javaTimeMillis` can still jump due to NTP adjustments and so a monotonic clock source is preferable.

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

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


More information about the hotspot-dev mailing list