I am using Bytebuddy to instrument methods.
Is there any way of getting hold of runtime information as e.g. the thread id of the instrumented method/constructor ?
I couldn't find a way to gain access to this information using @Advice.*
I am using Bytebuddy to instrument methods.
Is there any way of getting hold of runtime information as e.g. the thread id of the instrumented method/constructor ?
I couldn't find a way to gain access to this information using @Advice.*
java.lang.Thread.currentThread().getName() / getId()
As using visitor is adding the code inside @Advice.OnMethodEnter
and @Advice.OnMethodExit
to the beginning and the end of the method respectively, calling Thread.currentThread()
inside those annotated methods is resulting in calling the inlined code inside the instrumented method.