You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@netbeans.apache.org by Sergei Egorov <bs...@gmail.com> on 2018/12/19 10:59:58 UTC

[Profiler] JVMTI question: late attach and Thread.sleep instrumentation

Hello!

From this issue [1] I found out that NetBeans Profiler was able to solve a
problem of Thread.sleep instrumentation when it is connected to JVM after
it starts.

I went thru the sources and discovered native_method_bind_hook [2], but
AFAIK it will not get triggered for already bound methods like
Thread.sleep, and some magic is required.

Could you please give a few hints what did you implement for it? That will
be super helpful!

Thanks in advance :)


[1] https://bugs.openjdk.java.net/browse/JDK-6404550
[2]
https://github.com/apache/incubator-netbeans/blob/371465581f2011828b13ef59af6b89bcd4ada317/profiler/lib.profiler/native/src-jdk15/class_file_cache.c#L473


-- 
Best regards,
Sergei Egorov