btrace功能列表
Btrace是一个jvm probe工具,可以灵活地声明刺探点并注入刺探逻辑。它自带的samples中有非常多的例子,本文列举了从这些例子中总结出来的刺探点声明。
?
构造函数刺探,重载的构造函数也可以
?
??
刺探一个类的所有子类
@BTrace public class AllSync { @OnMethod( clazz="/javax\\.swing\\..*/", method="/.*/", location=@Location(value=Kind.SYNC_ENTRY, where=Where.AFTER) ) public static void onSyncEntry(Object obj) { println(Strings.strcat("after synchronized entry: ", identityStr(obj))); } @OnMethod( clazz="/javax\\.swing\\..*/", method="/.*/", location=@Location(Kind.SYNC_EXIT) ) public static void onSyncExit(Object obj) { println(Strings.strcat("before synchronized exit: ", identityStr(obj))); }}??
?
?
?
?
?
?
?
?
?
?