-
Notifications
You must be signed in to change notification settings - Fork 962
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
help!! btrace issue #685
Comments
Most probably the problem is trying to raise the D probe while not running on Solaris (I assume you are not running on Solaris). |
The example provided in the URL, https://github.com/btraceio/btrace/blob/develop/btrace-dist/src/main/resources/samples/AllMethods1.java, works fine and can get trace logs. However, if you change clazz = "/javax.swing../" to clazz = "/java.lang../", there will be no any output. It seems that BTrace versions 2.1.0 and above do not support tracing java.lang, but BTrace versions below 2.0.2 can support it. My runtime environment is Ubuntu 20.04. |
The example provided in the URL, https://github.com/btraceio/btrace/blob/develop/btrace-dist/src/main/resources/samples/AllMethods1.java, works fine and can get trace logs. However, if you change clazz = "/javax.swing../" to clazz = "/java.lang../", there will be no any output. It seems that BTrace versions 2.1.0 and above do not support tracing java.lang, but BTrace versions below 2.0.2 can support it. My runtime environment is Ubuntu 20.04. |
Ah, I see. Currently, BTrace is not able to trace |
Are there any good solutions or viable alternatives to address this issue currently? |
No, not really. Except of patching and building BTrace yourself. |
Okay,Another question: why BTrace v2.0.2 is unable to enable the unsafe mode? |
Okay,Another question: why BTrace v2.0.2 is unable to enable the unsafe mode? |
Stale issue message |
TBH, I don't know why unsafe mode does not work with 2.0.2 Does it work with 2.2.6 (the most recent version)? |
Hey, brother!
When I use the BTrace tool to trace methods in java.lang, I don't see any log output. I have already tried to use jdk version 8 , 11 and 17,the btrace version is v2.3.0. Can you provide any insights or suggestions to help me troubleshoot this issue? ?
Here are the steps I followed:
import java.io.IOException;
import java.util.Scanner;
import java.lang.Thread;
public class Demo {
public static void main(String[] args) throws InterruptedException {
}
And,I have used the trace script from the sample directory, as following:
import org.openjdk.btrace.core.annotations.BTrace;
import org.openjdk.btrace.core.annotations.OnMethod;
import org.openjdk.btrace.core.annotations.Self;
import static org.openjdk.btrace.core.BTraceUtils.*;
/*
*/
@btrace
public class ThreadStart {
@OnMethod(
clazz = "java.lang.Thread",
method = "start"
)
public static void onnewThread(@self Thread t) {
D.probe("jthreadstart", Threads.name(t));
println("starting " + Threads.name(t));
}
}
The text was updated successfully, but these errors were encountered: