-
Notifications
You must be signed in to change notification settings - Fork 960
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
No console output if not in verbose mode #254
Comments
Most probably it is due 'System.out' buffering. The stream is not force-flushed and we rely on the output to appear on console eventually. The verbose mode is generating more data and the output is flushed more frequently. Anyway, I would expect the output to be displayed upon the BTrace client exit. As an enhancement, I could provide a new client action to be displayed in the menu invoked by Ctrl-C that would allow force-flushing the console output. |
I have added the extra command - you will need to pull the changes and rebuild BTrace to test it out. |
Hi, jbachorik Anyway I have built latest btrace and tried it without -v parameter. Even I called the flush command, the script still failed to record the call. The output is as follows: Swing performance profile |
Ok, this info was missing from the original report :) So, the output is properly flushed. If you remove the |
I have tested the script from |
Hi, jbachorik |
Ok, if you run This is very odd behavior - I have never seen that happening :( |
Any news regarding this. Were you able to capture the instrumented classes? |
By the way I just encountered this as well. I was using 1.3.9 release against a hadoop container process. I tried both oracle jdk1.8.0_112 and java-1.8.0-openjdk-1.8.0.121-0.b13 and they behaved the same, with verbose option producing output (and killing the container quickly due to rapidly growing mem footprint) and non-verbose option producing absolutely no output. The trace script I wrote generates a large quantity of output so buffering/flushing shouldn't be an issue? Is there anything I can try to further diagnose this? |
Was anybody, by chance, able to run |
@jbachorik import static com.sun.btrace.BTraceUtils.*; import com.sun.btrace.AnyType; @btrace
} -----------------end btrace script----------------- -----------------start btrace output----------------- [test@sz-dev-a-5 bin]$ ./btrace -p 2021 12817 trace.java -----------------start btrace -d---------------- from the output we see when i add -v then has print,remove then disappear. |
Stale issue message |
Hi, i am a newbie of btrace.
I have written a script(Calls.java) to profile our app as follow:
import com.sun.btrace.AnyType;
import com.sun.btrace.annotations.;
import static com.sun.btrace.BTraceUtils.;
import com.sun.btrace.Profiler;
/**
@btrace public class Calls {
@Property
private static Profiler swingProfiler = Profiling.newProfiler();
@onerror
public static void onError(Throwable t) {
print("btrace throw: ");
println(t);
}
}
The script works well in verbose mode( export JAVA_HOME=/opt/jdk8 && ./bin/btrace -v 22967 Calls.java):
[faceshow@ip-10-1-40-222 btrace]$ export JAVA_HOME=/opt/jdk8 && ./bin/btrace -v 22967 Calls.java
DEBUG: assuming default port 2020
DEBUG: assuming default classpath '.'
DEBUG: compiling Calls.java
DEBUG: compiled Calls.java
DEBUG: attaching to 22967
DEBUG: checking port availability: 2020
DEBUG: attached to 22967
DEBUG: loading /opt/faceshow/btrace/build/btrace-agent.jar
DEBUG: agent args: port=2020,statsd=,debug=true,bootClassPath=.,systemClassPath=/opt/jdk8/jre/../lib/tools.jar,probeDescPath=.
DEBUG: loaded /opt/faceshow/btrace/build/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: entering into command loop
DEBUG: received com.sun.btrace.comm.RenameCommand@43bd930a
DEBUG: received com.sun.btrace.comm.OkayCommand@33723e30
DEBUG: received com.sun.btrace.comm.RetransformationStartNotification@64f6106c
DEBUG: received com.sun.btrace.comm.OkayCommand@553a3d88
DEBUG: received com.sun.btrace.comm.MessageCommand@543c6f6d
entry public final java.util.Map com.handwin.game.controller.GameController$$EnhancerBySpringCGLIB$$c0ce67f0#getGames(javax.servlet.http.HttpServletRequest)
DEBUG: received com.sun.btrace.comm.MessageCommand@13eb8acf
entry public java.lang.Object com.handwin.game.controller.GameController$$FastClassBySpringCGLIB$$e44b30f2#invoke(int, java.lang.Object, java.lang.Object[])
DEBUG: received com.sun.btrace.comm.MessageCommand@51c8530f
entry public java.util.Map com.handwin.game.controller.GameController#getGames(javax.servlet.http.HttpServletRequest)
DEBUG: received com.sun.btrace.comm.MessageCommand@7403c468
entry private boolean com.handwin.game.controller.GameController#shouldBuy(javax.servlet.http.HttpServletRequest)
DEBUG: received com.sun.btrace.comm.MessageCommand@43738a82
entry private int com.handwin.game.controller.GameController#compareVersion(java.lang.String, java.lang.String)
DEBUG: received com.sun.btrace.comm.MessageCommand@c81cdd1
exit private int com.handwin.game.controller.GameController#compareVersion(java.lang.String, java.lang.String)
DEBUG: received com.sun.btrace.comm.MessageCommand@1fc2b765
exit private boolean com.handwin.game.controller.GameController#shouldBuy(javax.servlet.http.HttpServletRequest)
DEBUG: received com.sun.btrace.comm.MessageCommand@75881071
entry private boolean com.handwin.game.controller.GameController#shouldGetPlayerNum(javax.servlet.http.HttpServletRequest)
DEBUG: received com.sun.btrace.comm.MessageCommand@2a70a3d8
exit private boolean com.handwin.game.controller.GameController#shouldGetPlayerNum(javax.servlet.http.HttpServletRequest)
DEBUG: received com.sun.btrace.comm.MessageCommand@289d1c02
entry private void com.handwin.game.controller.GameController#lambda$getGames$0(com.handwin.game.entity.User, int, com.handwin.game.entity.vo.game.GameVo)
DEBUG: received com.sun.btrace.comm.MessageCommand@22eeefeb
exit private void com.handwin.game.controller.GameController#lambda$getGames$0(com.handwin.game.entity.User, int, com.handwin.game.entity.vo.game.GameVo)
DEBUG: received com.sun.btrace.comm.MessageCommand@17d0685f
entry private void com.handwin.game.controller.GameController#lambda$getGames$0(com.handwin.game.entity.User, int, com.handwin.game.entity.vo.game.GameVo)
DEBUG: received com.sun.btrace.comm.MessageCommand@3891771e
But if i remove -v, there is no output.
Could you guys shed light on me?
The text was updated successfully, but these errors were encountered: