btrace例子
@BTracepublic class OracleTimeoutTracer { @OnMethod(clazz = "oracle.net.nt.ConnStrategy", method = "createSocketOptions", location = @Location(value = Kind.ENTRY)) public static void strategy(@Self Object self, Properties paramProperties) { println(str(paramProperties)); } @OnMethod(clazz = "oracle.net.nt.TcpNTAdapter", method = "connect", location = @Location(value = Kind.ENTRY)) public static void adapter(@Self Object self) { Field socketTimeoutField = field("oracle.net.nt.TcpNTAdapter", "sockTimeout"); Field hostField = field("oracle.net.nt.TcpNTAdapter", "host"); Field portField = field("oracle.net.nt.TcpNTAdapter", "port"); int scoketTimeout = (Integer) get(socketTimeoutField, self); int port = (Integer) get(portField, self); String host = (String) get(hostField, self); println(strcat(strcat(strcat(strcat(strcat("host : ", host), ", port : "), str(port)), " , socketTimeout : "), str(scoketTimeout))); }}?