Open nitsanw opened 9 years ago
JavaThread::thread_from_jni_environment(env_id))
is the method to call.
Consider the following course of action: Handle ThreadStart/End by agent On ThreadStart: use a lock free map to map thread* and thread's jvmtiEnv_, notify logwriter via queue to log jthread info using GetThreadInfo (requires jthread and jvmtiEnv) On ThreadEnd: remove thread* from map, notify log_writer via queue to log thread end On PROF signal: use the map to get jvmtiEnv*, this would help resolve issues on JVMs where GetEnv is not async safe. In log writer: emit thread start/end entries with threadId to name mapping
This seems like a more correct use of the JVMTI API to acquire the env and thread info. This requires the inclusion of a lockfree c++ map in Honest-Profiler
This can help annotate the thread ids.