-
Notifications
You must be signed in to change notification settings - Fork 963
Closed
Milestone
Description
code
@BTrace
public class AllLines {
@OnMethod(
clazz = "btracetest.Main",
method = "printOnce",
location = @Location(value = Kind.LINE, line = -1)
)
public static void online(@ProbeClassName String pcn, @ProbeMethodName String pmn, int line) {
print(pcn + "." + pmn + ":" + line + "\n");
}
}
Note that change location = @Location(value = Kind.LINE, line = -1) to line = (a specific line) will work. It must be some issue with -1 to match all lines.
btrace -v 22199 AllLines.java debug=1
DEBUG: assuming default port 2020
DEBUG: assuming default classpath '.'
Attaching BTrace to PID: 22199
DEBUG: compiling AllLines.java
DEBUG: compiled AllLines.java
DEBUG: attaching to 22199
DEBUG: checking port availability: 2020
DEBUG: attached to 22199
DEBUG: loading /home/decster/.sdkman/candidates/btrace/2.0.3/libs/btrace-agent.jar
DEBUG: agent args: port=2020,statsd=,debug=true,bootClassPath=.,systemClassPath=/home/decster/.sdkman/candidates/java/11.0.10-open/lib/tools.jar,probeDescPath=.
DEBUG: loaded /home/decster/.sdkman/candidates/btrace/2.0.3/libs/btrace-agent.jar
DEBUG: registering shutdown hook
DEBUG: registering signal handler for SIGINT
DEBUG: submitting the BTrace program
DEBUG: opening socket to 2020
DEBUG: setting up client settings
DEBUG: sending instrument command: [debug=1]
DEBUG: entering into command loop
DEBUG: received org.openjdk.btrace.core.comm.RenameCommand@71def8f8
DEBUG: received org.openjdk.btrace.core.comm.OkayCommand@4d465b11
DEBUG: received org.openjdk.btrace.core.comm.RetransformationStartNotification@5562c41e
DEBUG: received org.openjdk.btrace.core.comm.MessageCommand@28f2a10f
[BTRACE WARN] Class verification failed: btracetest.Main (null)DEBUG: received org.openjdk.btrace.core.comm.OkayCommand@f736069
btrace DEBUG: java.lang.VerifyError
java.lang.VerifyError
at java.instrument/sun.instrument.InstrumentationImpl.retransformClasses0(Native Method)
at java.instrument/sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:167)
at org.openjdk.btrace.agent.Client.retransformLoaded(Client.java:500)
at org.openjdk.btrace.agent.Main$5.run(Main.java:869)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)