BTrace可以安全地动态跟踪java应用程序执行。通过hotswap技术,向运行中的java应用程序插入跟踪代码(Trace actions )。
BTrace三个概念:
BTrace程序的限制:
BTrace定义的注解
@com.sun.btrace.annotations.OnMethod @com.sun.btrace.annotations.OnTimer @com.sun.btrace.annotations.OnError @com.sun.btrace.annotations.OnExit @com.sun.btrace.annotations.OnEvent @com.sun.btrace.annotations.OnLowMemory @com.sun.btrace.annotations.OnProbe
@com.sun.btrace.annotations.Self @com.sun.btrace.annotations.Return @com.sun.btrace.annotations.ProbeClassName @com.sun.btrace.annotations.ProbeMethodName @com.sun.btrace.annotations.Duration @com.sun.btrace.annotations.TargetInstance @com.sun.btrace.annotations.TargetMethodOrField
Kind.ENTRY, Kind.RETURN- the probed method arguments Kind.THROW - the thrown exception Kind.ARRAY_SET, Kind.ARRAY_GET - the array index Kind.CATCH - the caught exception Kind.FIELD_SET - the field value Kind.LINE - the line number Kind.NEW - the class name Kind.ERROR - the thrown exception
@com.sun.btrace.annotations.Export @com.sun.btrace.annotations.Property @com.sun.btrace.annotations.TLS
@com.sun.btrace.annotations.DTrace @com.sun.btrace.annotations.DTraceRef @com.sun.btrace.annotations.BTrace
参考文章: