I'm trying to use BTrace to find when a certain type is first instantiated in my program (Eclipse debugger isn't able to find it) as I'm seeing some strange behaviour (the Javolution XMLStreamWriterImpl is somehow adding elements to my XML before it should even have been created).
Anyway, I have the following method which I am using through JVisualVM, but nothing is showing up when running.
import com.sun.btrace.annotations.*;
import static com.sun.btrace.BTraceUtils.*;
import java.lang.String;
@BTrace
public class ClassLoad {
@OnMethod(clazz = "javolution.xml.stream.XMLStreamWriterImpl", method = "<init>", location = @Location(value=Kind.NEW))
public static void site(@ProbeMethodName(fqn=true) String caller) {
println(strcat("Called from @", caller));
}
}