« Return to Thread: tracing application code rather than rvm itself

tracing application code rather than rvm itself

by Xinwei Xie :: Rate this Message:

Reply to Author | View in Thread

Hi everyone,

In order to tracing application code rather than rvm itself, is it enough to use the following condition? I am using baseline compiler and BaseBaseMarkSweep configuration.

for example, I want to instrument put/getfield, put/getstatic. I add:

if(method.isInterrruptible()){
 ...// emit_CALL my instrument code
}
in emit_(un)resolve_put/get/filed/static, then in my own code, I test such if statement at the beginning:

if( !getCurrentThread().isSystemThread() && !getCurrentThread().isBootThread()){
    .....//my instrument code
}

My another question is how to avoid recursive instrumentation, as far as I know, the condition above seems not sufficient to filer out my instrument code which also has put/getfield, put/getstatic, etc.
Can I use (!method.getDeclaringClass().getDescriptor().isBootstrapDescriptor()) before I *emit_CALL* my code to solve it? Will it be sufficient or overestimate or underestimate?

Thanks, any suggestion is welcomed.

Regards,
Xinwei

 « Return to Thread: tracing application code rather than rvm itself