RFR: 8332259: JvmtiTrace::safe_get_thread_name fails if current thread is in native state [v2]

Leonid Mesnik lmesnik at openjdk.org
Fri May 17 16:56:04 UTC 2024


On Fri, 17 May 2024 05:52:36 GMT, David Holmes <dholmes at openjdk.org> wrote:

> I have to wonder whether this solution will potentially cause problems because the code will now block for safepoints. We could fallback to `Thread::name()` if the current thread is in-native.

Thanks for feedback. Here is the update.

I've updated the safe_get_thread_name() to not change thread state. 

In  "jvmtiEnter.xsl" functions the thread name is s read once before the transition happened and re-used then. 
So I updated the tracing to 're-read' if the transition to VM happened to update the thread name once it became known.

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

PR Comment: https://git.openjdk.org/jdk/pull/19275#issuecomment-2118004152


More information about the serviceability-dev mailing list