RFR: 8342818: Implement CPU Time Profiling for JFR

Markus Grönlund mgronlun at openjdk.org
Tue Oct 29 11:13:20 UTC 2024


On Sat, 21 Sep 2024 11:02:14 GMT, Markus Grönlund <mgronlun at openjdk.org> wrote:

>> No, we can't. This crashes the sampler. The problem is, that obtaining the traceid via `JfrThreadLocal::thread_id(jt)` acquires a lock (and more) when the traceid is not set already. So we can't use it in the signal handler.
>
> Hmm. That's not good. We could eliminate the spinlock, but that will require a thread assigning its id early in thread_state_new to prevent our old sampler from hitting it (and also the new one from skipping new threads). However, this is complex because it involves reading the tid from a Java oop, so we need to investigate if that is a valid thing to do, in those states. 
> 
> I have to think some more about this. Too bad you need to do this complexity.

I have created this to help reduce the amount of crash protection you need to use: https://github.com/openjdk/jdk/pull/21756

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

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


More information about the hotspot-dev mailing list