How to map Java Thread to OS Thread on Linux?

156 Views Asked by At

I'm trying to map Java Thread to OS thread within JVMTI. In JVMTI, all I could grab is Java Thread object leveraging GetCurrentThread. But I want to know which OS thread this jthread is mapping to.

I was told that there is a field in Hotspot, eetop, which is a pointer to the underlying OS-level native thread instance of the JVM(ref: hotspot/src/share/vm/classfile/javaClasses.cpp).

How do I use this field to finish the mapping?

This magic is also being performed in async-profiler at src/vmStructs.cpp line 364. Why it works? enter image description here

0

There are 0 best solutions below