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

Johannes Bechberger jbechberger at openjdk.org
Wed Nov 6 10:14:39 UTC 2024


On Fri, 1 Nov 2024 05:26:20 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Is this really an issue? And if so, how would I implement this?
>
> Whether the racing is an issue only you can answer. My concern is that using the `Threads_lock` is bad and unnecessary - if you want a stable set of threads then you just need a `ThreadsListIterator`.
> 
> Otherwise you'd implement with a safepoint VM operation that you submit to the VMThread.

I just looked into it. We only call the methods that take the locks when
- the sampler is first enrolled
- the timer intervals are updated
- the timer is stopped

This shouldn't happen that often in practice, so I think that it is good to have the additional guarantees offered by safepoints.

We can modify this if we see real world performance issues.

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

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


More information about the hotspot-dev mailing list