<html><head></head><body><div style="font-family:courier new, courier, monaco, monospace, sans-serif;font-size:13px;"><div></div>
<div>I installed LTTng from source at first. While after that, I also reinstall it from PPA. Is it the cause of my problem?</div>
<div id="yahoo_quoted_8221160477" class="yahoo_quoted">
<div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
<div>
On Friday, October 13, 2017, 11:57:33 PM GMT+3:30, Alexandre Montplaisir <alexmonthy@voxpopuli.im> wrote:
</div>
<div><br></div>
<div><br></div>
<div><div dir='ltr'><html><body>On 2017-10-12 03:38 PM, MMM wrote:<br clear="none">> Dear Alex,<br clear="none">><br clear="none">> As I mentioned, I used sample examples. for instance, I used mentioned<br clear="none">> simple program that you told tracing it return some result. While, I<br clear="none">> can not receive any result from tracing it. Also, I use Ubuntu 16.04<br clear="none">> LTS and lttng 2.9.5. Besides, the output of asked command is <br clear="none">><br clear="none">> //////////////////<br clear="none">> -rw-r--r-- 1 root root 40871 Jun 16 13:56<br clear="none">> /usr/share/java/lttng-ust-agent-common-2.9.1.jar<br clear="none">> lrwxrwxrwx 1 root root 32 Jun 16 13:56<br clear="none">> /usr/share/java/lttng-ust-agent-common.jar -><br clear="none">> lttng-ust-agent-common-2.9.1.jar<br clear="none">> -rw-r--r-- 1 root root 4369 Jun 16 13:56<br clear="none">> /usr/share/java/lttng-ust-agent-jul-2.9.1.jar<br clear="none">> lrwxrwxrwx 1 root root 29 Jun 16 13:56<br clear="none">> /usr/share/java/lttng-ust-agent-jul.jar -> lttng-ust-agent-jul-2.9.1.jar<br clear="none">> -rw-r--r-- 1 root root 3933 Jun 16 13:56<br clear="none">> /usr/share/java/lttng-ust-agent-log4j-2.9.1.jar<br clear="none">> lrwxrwxrwx 1 root root 31 Jun 16 13:56<br clear="none">> /usr/share/java/lttng-ust-agent-log4j.jar -><br clear="none">> lttng-ust-agent-log4j-2.9.1.jar<br clear="none">> ////////////////////////////<br clear="none"><br clear="none">Everything seems to be in order here.<br clear="none"><br clear="none">I will try your exact same environment to see if I can reproduce the issue.<br clear="none">How did you install your LTTng 2.9? Was it from source, or from a PPA?<br clear="none">The Ubuntu 16.04 main archive only has 2.7.*<br clear="none"><br clear="none">Cheers,<br clear="none">Alex<br clear="none"><br clear="none">><br clear="none">> Thanks for your attention.<br clear="none">> Regards,<br clear="none">> Mehdi.<br clear="none">><br clear="none">> On Thursday, October 12, 2017, 6:51:12 PM GMT+3:30, Alexandre<br clear="none">> Montplaisir <<a shape="rect" ymailto="mailto:alexmonthy@voxpopuli.im" href="mailto:alexmonthy@voxpopuli.im">alexmonthy@voxpopuli.im</a>> wrote:<br clear="none">><br clear="none">><br clear="none">><br clear="none">><br clear="none">> On 2017-10-11 06:05 PM, MMM wrote:<br clear="none">> > Dear Alex,<br clear="none">> ><br clear="none">> > Thanks for your attention. I executed your commands step by step.<br clear="none">> > While, again I received previous errors which are <br clear="none">> ><br clear="none">> > [error] Cannot open any trace for reading.<br clear="none">> > [error] opening trace "[path]/lttng-traces/auto-20171011-145947" for<br clear="none">> > reading.<br clear="none">> > [error] none of the specified trace paths could be opened.<br clear="none">> ><br clear="none">> > I do not know the reason of this problem. Could you please help me to<br clear="none">> > resolve it?<br clear="none">><br clear="none">> As Philippe mentioned previously, this means the trace is empty, so no<br clear="none">> events were produced by the session.<br clear="none">><br clear="none">> Did any of the other commands (java, javac, lttng create,...) output any<br clear="none">> error messages?<br clear="none">><br clear="none">><br clear="none">> Finally, it would help if you could specify:<br clear="none">> - What version of Ubuntu you are running<br clear="none">><br clear="none">> - What version of LTTng you are running ("lttng --version")<br clear="none">><br clear="none">> - The output of the following command:<br clear="none">> $ ls -l /usr/share/java/lttng-ust*<br clear="none">><br clear="none">> Thanks,<br clear="none">> Alex<br clear="none">><br clear="none">> ><br clear="none">> > Regards,<br clear="none">> > Mehdi.<br clear="none">> ><br clear="none">> ><br clear="none">> ><br clear="none">> ><br clear="none">> > On Wednesday, October 11, 2017, 6:09:41 PM GMT+3:30, Alexandre<br clear="none">> > Montplaisir <<a shape="rect" ymailto="mailto:alexmonthy@voxpopuli.im" href="mailto:alexmonthy@voxpopuli.im">alexmonthy@voxpopuli.im</a><br clear="none">> <mailto:<a shape="rect" ymailto="mailto:alexmonthy@voxpopuli.im" href="mailto:alexmonthy@voxpopuli.im">alexmonthy@voxpopuli.im</a>>> wrote:<br clear="none">> ><br clear="none">> ><br clear="none">> > Hi,<br clear="none">> ><br clear="none">> > I tried compiling and running your program, and it runs fine on my end.<br clear="none">> > Here is what I did:<br clear="none">> ><br clear="none">> > saved the snippet below to "Hello.java"<br clear="none">> > $ apt install liblttng-ust-agent-java<br clear="none">> > $ javac -cp /usr/share/java/lttng-ust-agent-jul.jar Hello.java<br clear="none">> ><br clear="none">> > $ lttng create<br clear="none">> > $ lttng enable-event -a -j<br clear="none">> > $ lttng start<br clear="none">> > $ java -cp /usr/share/java/lttng-ust-agent-jul.jar:. Hello<br clear="none">> > $ lttng stop<br clear="none">> > $ lttng view<br clear="none">> ><br clear="none">> > and I get the following output:<br clear="none">> > Trace directory: /home/alexandre/lttng-traces/auto-20171011-102431<br clear="none">> ><br clear="none">> > [10:24:49.326824061] (+?.?????????) calista lttng_jul:event: { cpu_id =<br clear="none">> > 2 }, { msg = "Hello World, the answer is 42", logger_name = "hello",<br clear="none">> > class_name = "Hello", method_name = "main", long_millis = 1507731889299,<br clear="none">> > int_loglevel = 800, int_threadid = 1 }<br clear="none">> ><br clear="none">> ><br clear="none">> > Make sure you are setting the -classpath/-cp option correctly, this<br clear="none">> > could explain the "unknown package" error you were getting.<br clear="none">> ><br clear="none">> > Also note that you are using the deprecated "LTTngAgent.getLTTngAgent()"<br clear="none">> > API (the "javac" command should warn about it). It should still work,<br clear="none">> > but it's highly recommended to use the new API, as described in<br clear="none">> > <a shape="rect" href="https://lttng.org/docs/v2.10/#doc-jul" target="_blank">https://lttng.org/docs/v2.10/#doc-jul</a><br clear="none">> > <<a shape="rect" href="https://lttng.org/docs/v2.10/#doc-jul%20" target="_blank">https://lttng.org/docs/v2.10/#doc-jul%20</a>>. Basically you have to<br clear="none">> > instantiate an "LttngLogHandler", and attach it to your Logger.<br clear="none">> ><br clear="none">> > HTH,<br clear="none">> > Alex<br clear="none">> ><br clear="none">> ><br clear="none">> > On 2017-10-10 04:12 PM, MMM via lttng-dev wrote:<br clear="none">> > > Dear Philippe,<br clear="none">> > ><br clear="none">> > > Thanks a lot for your consideration. I solved former problem. While, I<br clear="none">> > > faced with a new problem. Indeed, when I create a LTTng session, start<br clear="none">> > > it and finally stop LTTng, I could not find trace files in mentioned<br clear="none">> > > folder. My java code is <br clear="none">> > ><br clear="none">> > > ///////////////////////////////////////<br clear="none">> > > import java.io.IOException;<br clear="none">> > > import java.util.logging.Handler;<br clear="none">> > > import java.util.logging.Logger;<br clear="none">> > ><br clear="none">> > > import org.lttng.ust.agent.LTTngAgent;<br clear="none">> > > import org.lttng.ust.agent.jul.LttngLogHandler;<br clear="none">> > ><br clear="none">> > > public class Hello {<br clear="none">> > > private static final int answer = 42;<br clear="none">> > > private static LTTngAgent lttngAgent;<br clear="none">> > ><br clear="none">> > > public static void main(String[] args) throws InterruptedException {<br clear="none">> > > Logger helloLog = Logger.getLogger("hello");<br clear="none">> > > lttngAgent = LTTngAgent.getLTTngAgent();<br clear="none">> > ><br clear="none">> > > Thread.sleep(5000);<br clear="none">> > > helloLog.info("Hello World, the answer is " + answer);<br clear="none">> > > lttngAgent.dispose();<br clear="none">> > > }<br clear="none">> > ><br clear="none">> > > }<br clear="none">> > > ///////////////////////<br clear="none">> > ><br clear="none">> > > Also, I used following LTTng commands. <br clear="none">> > ><br clear="none">> > > ////////////////////////////////<br clear="none">> > > lttng create java-test<br clear="none">> > > lttng enable-event -a -l<br clear="none">> > > lttng start<br clear="none">> > > ///Start My java Application///<br clear="none">> > > lttng stop<br clear="none">> > > ////////////////////////////<br clear="none">> > ><br clear="none">> > > Besides, when I used "lttng view" after stopping LTTng, I received<br clear="none">> > > following error message<br clear="none">> > ><br clear="none">> > > [error] Cannot open any trace for reading.<br clear="none">> > > [error] opening trace<br clear="none">> > > "/[path]/lttng-traces/java-test10-20171010-130909" for reading.<br clear="none">> > > [error] none of the specified trace paths could be opened.<br clear="none">> > ><br clear="none">> > > Could you please help me to resolve it.<br clear="none">> > ><br clear="none">> > > Regards,<br clear="none">> > > Mehdi.<br clear="none">> > ><br clear="none">> > ><br clear="none">> > ><br clear="none">> > ><br clear="none">> > ><br clear="none">> > ><br clear="none">> > > On Monday, October 9, 2017, 1:05:59 AM GMT+3:30, Philippe Proulx<br clear="none">> > > <<a shape="rect" ymailto="mailto:eeppeliteloop@gmail.com" href="mailto:eeppeliteloop@gmail.com">eeppeliteloop@gmail.com</a> <mailto:<a shape="rect" ymailto="mailto:eeppeliteloop@gmail.com" href="mailto:eeppeliteloop@gmail.com">eeppeliteloop@gmail.com</a>><br clear="none">> <mailto:<a shape="rect" ymailto="mailto:eeppeliteloop@gmail.com" href="mailto:eeppeliteloop@gmail.com">eeppeliteloop@gmail.com</a> <mailto:<a shape="rect" ymailto="mailto:eeppeliteloop@gmail.com" href="mailto:eeppeliteloop@gmail.com">eeppeliteloop@gmail.com</a>>>> wrote:<br clear="none">> > ><br clear="none">> > ><br clear="none">> > > On Sun, Oct 8, 2017 at 4:15 PM, MMM via lttng-dev<br clear="none">> > > <<a shape="rect" ymailto="mailto:lttng-dev@lists.lttng.org" href="mailto:lttng-dev@lists.lttng.org">lttng-dev@lists.lttng.org</a> <mailto:<a shape="rect" ymailto="mailto:lttng-dev@lists.lttng.org" href="mailto:lttng-dev@lists.lttng.org">lttng-dev@lists.lttng.org</a>><br clear="none">> <mailto:<a shape="rect" ymailto="mailto:lttng-dev@lists.lttng.org" href="mailto:lttng-dev@lists.lttng.org">lttng-dev@lists.lttng.org</a> <mailto:<a shape="rect" ymailto="mailto:lttng-dev@lists.lttng.org" href="mailto:lttng-dev@lists.lttng.org">lttng-dev@lists.lttng.org</a>>><br clear="none">> > <mailto:<a shape="rect" ymailto="mailto:lttng-dev@lists.lttng.org" href="mailto:lttng-dev@lists.lttng.org">lttng-dev@lists.lttng.org</a> <mailto:<a shape="rect" ymailto="mailto:lttng-dev@lists.lttng.org" href="mailto:lttng-dev@lists.lttng.org">lttng-dev@lists.lttng.org</a>><br clear="none">> <mailto:<a shape="rect" ymailto="mailto:lttng-dev@lists.lttng.org" href="mailto:lttng-dev@lists.lttng.org">lttng-dev@lists.lttng.org</a> <mailto:<a shape="rect" ymailto="mailto:lttng-dev@lists.lttng.org" href="mailto:lttng-dev@lists.lttng.org">lttng-dev@lists.lttng.org</a>>>>><br clear="none">> > wrote:<br clear="none">> > > > Dear Users,<br clear="none">> > > ><br clear="none">> > > > I am beginner in tracing using LTTng. At present, I am going to<br clear="none">> > > trace a java<br clear="none">> > > > program in Ubuntu, while I faced with a problem. When I install<br clear="none">> > > LTTng on<br clear="none">> > > > Ubuntu, I also install<br clear="none">> > > ><br clear="none">> > > > "liblttng-ust-agent-java" by "apt-get install<br clear="none">> liblttng-ust-agent-java"<br clear="none">> > > > command in Ubuntu. But, when I want to import any libraries related<br clear="none">> > > to LTTng<br clear="none">> > > > such as<br clear="none">> > > "org.lttng.ust.agent.jul.LttngLogHandlerorg.lttng.ust.LTTngAgent" to<br clear="none">> > > > my program, it is marked as unknown package. Indeed, I could not<br clear="none">> > > find LTTng<br clear="none">> > > > Jar file for adding it to my program libraries. Furthermore, I<br clear="none">> > > searched in<br clear="none">> > > > all files and folders, while I could not find Jar file. Could you<br clear="none">> > please<br clear="none">> > > > help me to understand the cause of this problem and solve it.<br clear="none">> > ><br clear="none">> > > I'm not a Ubuntu specialist, but from<br clear="none">> > ><br clear="none">> ><br clear="none">> <<a shape="rect" href="https://packages.ubuntu.com/zesty/all/liblttng-ust-agent-java/filelist" target="_blank">https://packages.ubuntu.com/zesty/all/liblttng-ust-agent-java/filelist</a>>,<br clear="none">> > > I would say:<br clear="none">> > ><br clear="none">> > > * /usr/share/java/lttng-ust-agent-jul.jar<br clear="none">> > > * /usr/share/java/lttng-ust-agent-log4j.jar<br clear="none">> > ><br clear="none">> > > On 16.04, it's:<br clear="none">> > ><br clear="none">> > > * /usr/share/java/liblttng-ust-agent.jar<br clear="none">> > ><br clear="none">> > > Add the required JAR file to your classpath.<br clear="none">> > ><br clear="none">> > > Have a look at <<a shape="rect" href="http://lttng.org/docs/v2.9/#doc-java-application" target="_blank">http://lttng.org/docs/v2.9/#doc-java-application</a>>.<br clear="none">> > ><br clear="none">> > > Phil<br clear="none">> > ><br clear="none">> > ><br clear="none">> > > ><br clear="none">> > > ><br clear="none">> > > > Best regards,<br clear="none">> > > ><br clear="none">> > > > Mehdi.<br clear="none">> > > ><br clear="none">> > > ><br clear="none">> > > > _______________________________________________<br clear="none">> > > > lttng-dev mailing list<br clear="none">> > > > <a shape="rect" ymailto="mailto:lttng-dev@lists.lttng.org" href="mailto:lttng-dev@lists.lttng.org">lttng-dev@lists.lttng.org</a> <mailto:<a shape="rect" ymailto="mailto:lttng-dev@lists.lttng.org" href="mailto:lttng-dev@lists.lttng.org">lttng-dev@lists.lttng.org</a>><br clear="none">> <mailto:<a shape="rect" ymailto="mailto:lttng-dev@lists.lttng.org" href="mailto:lttng-dev@lists.lttng.org">lttng-dev@lists.lttng.org</a> <mailto:<a shape="rect" ymailto="mailto:lttng-dev@lists.lttng.org" href="mailto:lttng-dev@lists.lttng.org">lttng-dev@lists.lttng.org</a>>><br clear="none">> > <mailto:<a shape="rect" ymailto="mailto:lttng-dev@lists.lttng.org" href="mailto:lttng-dev@lists.lttng.org">lttng-dev@lists.lttng.org</a> <mailto:<a shape="rect" ymailto="mailto:lttng-dev@lists.lttng.org" href="mailto:lttng-dev@lists.lttng.org">lttng-dev@lists.lttng.org</a>><br clear="none">> <mailto:<a shape="rect" ymailto="mailto:lttng-dev@lists.lttng.org" href="mailto:lttng-dev@lists.lttng.org">lttng-dev@lists.lttng.org</a> <mailto:<a shape="rect" ymailto="mailto:lttng-dev@lists.lttng.org" href="mailto:lttng-dev@lists.lttng.org">lttng-dev@lists.lttng.org</a>>>><br clear="none">> ><br clear="none">> > > > <a shape="rect" href="https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev" target="_blank">https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev</a><div class="yqt0280732580" id="yqtfd34946"><br clear="none">><br clear="none">> > > ><br clear="none">> > ><br clear="none">> > ><br clear="none">> > > _______________________________________________<br clear="none">> > > lttng-dev mailing list<br clear="none">> > > <a shape="rect" ymailto="mailto:lttng-dev@lists.lttng.org" href="mailto:lttng-dev@lists.lttng.org">lttng-dev@lists.lttng.org</a> <mailto:<a shape="rect" ymailto="mailto:lttng-dev@lists.lttng.org" href="mailto:lttng-dev@lists.lttng.org">lttng-dev@lists.lttng.org</a>><br clear="none">> <mailto:<a shape="rect" ymailto="mailto:lttng-dev@lists.lttng.org" href="mailto:lttng-dev@lists.lttng.org">lttng-dev@lists.lttng.org</a> <mailto:<a shape="rect" ymailto="mailto:lttng-dev@lists.lttng.org" href="mailto:lttng-dev@lists.lttng.org">lttng-dev@lists.lttng.org</a>>><br clear="none">> > > <a shape="rect" href="https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev" target="_blank">https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev</a><br clear="none">> ><br clear="none">><br clear="none"><br clear="none"></div></body></html></div></div>
</div>
</div></div></body></html>