-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtrace.java
More file actions
20 lines (16 loc) · 708 Bytes
/
Copy pathtrace.java
File metadata and controls
20 lines (16 loc) · 708 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import com.sun.btrace.annotations.*;
import static com.sun.btrace.BTraceUtils.*;
import com.sun.btrace.AnyType;
@BTrace
public class TracingScript {
@OnMethod( clazz="/test.*/", method="/.*/" )
public static void onEntry(@ProbeClassName String pcn, @ProbeMethodName String pmn, AnyType[] args ) {
println(concat( concat( pcn, ". "), concat( pmn , " ")));
}
@OnMethod( clazz="/test.*/", method="/.*/", location = @Location(Kind.RETURN) )
public static void onExit(@ProbeClassName String pcn, @ProbeMethodName String pmn, @Return AnyType ret ) {
print(concat( concat(pcn, ". "), concat(pmn , " Returned: ")));
println( str(ret) );
println();
}
}