From mboxrd@z Thu Jan 1 00:00:00 1970 From: MMM via lttng-dev Subject: Re: Problem in finding Jar file of LTTng for adding to Java project Date: Tue, 10 Oct 2017 22:08:07 +0000 (UTC) Message-ID: <1928584997.5360512.1507673287780__33813.421734567$1507675733$gmane$org@mail.yahoo.com> References: <797428900.3787919.1507493725940.ref@mail.yahoo.com> <797428900.3787919.1507493725940@mail.yahoo.com> <776772327.5312865.1507666332238@mail.yahoo.com> Reply-To: MMM Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5442870971632604871==" Return-path: Received: from sonic306-22.consmr.mail.ne1.yahoo.com (sonic306-22.consmr.mail.ne1.yahoo.com [66.163.189.84]) by lists.lttng.org (Postfix) with ESMTP id 3yBXMj27bpztKM for ; Tue, 10 Oct 2017 22:48:32 +0000 (UTC) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lttng-dev-bounces@lists.lttng.org Sender: "lttng-dev" To: Philippe Proulx Cc: "lttng-dev@lists.lttng.org" List-Id: lttng-dev@lists.lttng.org --===============5442870971632604871== Content-Type: multipart/alternative; boundary="----=_Part_5360511_523031639.1507673287778" ------=_Part_5360511_523031639.1507673287778 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Dear Philippe, I tried with all options, while my trace result was empty yet and the error= message was shown again. Indeed, LTTng did not create a folder for saving = trace result.=C2=A0 Thanks a lot for your guidance in advance. Mehdi. On Wednesday, October 11, 2017, 12:28:59 AM GMT+3:30, Philippe Proulx <= eeppeliteloop@gmail.com> wrote: =20 =20 On Tue, Oct 10, 2017 at 4:12 PM, MMM wrote: > Dear Philippe, > > Thanks a lot for your consideration. I solved former problem. While, I fa= ced > with a new problem. Indeed, when I create a LTTng session, start it and > finally stop LTTng, I could not find trace files in mentioned folder. My > java code is > > /////////////////////////////////////// > import java.io.IOException; > import java.util.logging.Handler; > import java.util.logging.Logger; > > import org.lttng.ust.agent.LTTngAgent; > import org.lttng.ust.agent.jul.LttngLogHandler; It looks like you're using the java.util.logging agent... > > public class Hello { > private static final int answer =3D 42; > private static LTTngAgent lttngAgent; > > public static void main(String[] args) throws InterruptedException { > Logger helloLog =3D Logger.getLogger("hello"); > lttngAgent =3D LTTngAgent.getLTTngAgent(); > > Thread.sleep(5000); > helloLog.info("Hello World, the answer is " + answer); > lttngAgent.dispose(); > } > > } > /////////////////////// > > Also, I used following LTTng commands. > > //////////////////////////////// > lttng create java-test > lttng enable-event -a -l ... and the -l/--log4j options applies to the log4j agent. Use the -j/--jul option. > lttng start > > ///Start My java Application/// > > lttng stop > //////////////////////////// > > Besides, when I used "lttng view" after stopping LTTng, I received follow= ing > error message > > [error] Cannot open any trace for reading. > [error] opening trace "/[path]/lttng-traces/java-test10-20171010-130909" = for > reading. > [error] none of the specified trace paths could be opened. This is because your trace is empty (does not even exist). Phil > > Could you please help me to resolve it. > > Regards, > Mehdi. > > > > > > > > > > On Monday, October 9, 2017, 1:05:59 AM GMT+3:30, Philippe Proulx > wrote: > > > On Sun, Oct 8, 2017 at 4:15 PM, MMM via lttng-dev > wrote: >> Dear Users, >> >> I am beginner in tracing using LTTng. At present, I am going to trace a >> java >> program in=C2=A0 Ubuntu, while I faced with a problem. When I install LT= Tng on >> Ubuntu, I also install >> >> "liblttng-ust-agent-java" by "apt-get install liblttng-ust-agent-java" >> command in Ubuntu. But, when I want to import any libraries related to >> LTTng >> such as "org.lttng.ust.agent.jul.LttngLogHandlerorg.lttng.ust.LTTngAgent= " >> to >> my program, it is marked as unknown package. Indeed, I could not find >> LTTng >> Jar file for adding it to my program libraries. Furthermore, I searched = in >> all files and folders, while I could not find Jar file. Could you please >> help me to understand the cause of this problem and solve it. > > I'm not a Ubuntu specialist, but from > , > I would say: > > * /usr/share/java/lttng-ust-agent-jul.jar > * /usr/share/java/lttng-ust-agent-log4j.jar > > On 16.04, it's: > > * /usr/share/java/liblttng-ust-agent.jar > > Add the required JAR file to your classpath. > > Have a look at . > > Phil > > >> >> >> Best regards, >> >> Mehdi. >> >> >> _______________________________________________ >> lttng-dev mailing list >> lttng-dev@lists.lttng.org >> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >> ------=_Part_5360511_523031639.1507673287778 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Dear Philippe,

I tried with all o= ptions, while my trace result was empty yet and the error message was shown= again. Indeed, LTTng did not create a folder for saving trace result. = ;

Thanks a lot for your guidance in advance.
=

Mehdi.

=20
=20
On Wednesday, October 11, 2017, 12:28:59 AM GMT+3:3= 0, Philippe Proulx <eeppeliteloop@gmail.com> wrote:


On Tue, Oct 10, 2017 = at 4:12 PM, MMM <e.morovati@yahoo.com> wrote:=
> Dear Philippe,
>
> Thanks a lot for your consideration. I solved former problem. Whi= le, I faced
> with a new problem. Indeed, when I creat= e a LTTng session, start it and
> finally stop LTTng, = I could not find trace files in mentioned folder. My
>= java code is
>
> ///////////////= ////////////////////////
> import java.io.IOException;=
> import java.util.logging.Handler;
> import java.util.logging.Logger;
>
> import org.lttng.ust.agent.LTTngAgent;
> imp= ort org.lttng.ust.agent.jul.LttngLogHandler;

It looks like you're using the java.util.logging agent...

>
> public class Hel= lo {
> private static final int answer =3D 42;
> private static LTTngAgent lttngAgent;
>= ;
> public static void main(String[] args) throws Inte= rruptedException {
> Logger helloLog =3D Logger.getLog= ger("hello");
> lttngAgent =3D LTTngAgent.ge= tLTTngAgent();
>
> Thread.sleep(5= 000);
> helloLog.info("Hello World, the answer is= " + answer);
> lttngAgent.dispose();
> }
>
> }
> ///////////////////////
>
= > Also, I used following LTTng commands.
>
> ////////////////////////////////
> lttn= g create java-test
> lttng enable-event -a -l

... and the -l/--log4j options applies to the = log4j agent.

Use the -j/--jul option.<= br clear=3D"none">
> lttng start
>= ;
> ///Start My java Application///
= >
> lttng stop
> /////////////= ///////////////
>
> Besides, when= I used "lttng view" after stopping LTTng, I received following> error message
>
> [error] Cannot open any trace for reading.
> [e= rror] opening trace "/[path]/lttng-traces/java-test10-20171010-130909&= quot; for
> reading.
> [error] no= ne of the specified trace paths could be opened.

This is because your trace is empty (does not even exist).


Phil

>
> C= ould you please help me to resolve it.
>
> Regards,
> Mehdi.
>
>
>
>
>
>
>
>
>
> On Monday, October 9= , 2017, 1:05:59 AM GMT+3:30, Philippe Proulx
> <eeppeliteloop@gmail.com> wrote:
>
>
> On Sun, Oct 8, 2017= at 4:15 PM, MMM via lttng-dev
> <lttng-dev@lists.lttng.org> wrote:
>= ;> Dear Users,
>>
>> I a= m beginner in tracing using LTTng. At present, I am going to trace a
>> java
>> program in=C2=A0 Ubunt= u, while I faced with a problem. When I install LTTng on
= >> Ubuntu, I also install
>>
>> "liblttng-ust-agent-java" by "apt-get install lib= lttng-ust-agent-java"
>> command in Ubuntu. Bu= t, when I want to import any libraries related to
>>= ; LTTng
>> such as "org.lttng.ust.agent.jul.Lt= tngLogHandlerorg.lttng.ust.LTTngAgent"
>> to>> my program, it is marked as unknown package. Inde= ed, I could not find
>> LTTng
>= ;> Jar file for adding it to my program libraries. Furthermore, I search= ed in
>> all files and folders, while I could not f= ind Jar file. Could you please
>> help me to unders= tand the cause of this problem and solve it.
>
> I'm not a Ubuntu specialist, but from
> <https://packages.ubuntu.= com/zesty/all/liblttng-ust-agent-java/filelist>,
&= gt; I would say:
>
> * /usr/share= /java/lttng-ust-agent-jul.jar
> * /usr/share/java/lttn= g-ust-agent-log4j.jar
>
> On 16.0= 4, it's:
>
> * /usr/share/jav= a/liblttng-ust-agent.jar
>
> Add = the required JAR file to your classpath.
>
> Have a look at <http://lttng.org/docs/v2.= 9/#doc-java-application>.
>
&= gt; Phil
>
>
&g= t;>
>>
>> Best regards,<= br clear=3D"none">>>
>> Mehdi.
>>
>>
>> ________= _______________________________________
>> lttng-de= v mailing list
>> ltt= ng-dev@lists.lttng.org
>> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>>
------=_Part_5360511_523031639.1507673287778-- --===============5442870971632604871== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbHR0bmctZGV2 IG1haWxpbmcgbGlzdApsdHRuZy1kZXZAbGlzdHMubHR0bmcub3JnCmh0dHBzOi8vbGlzdHMubHR0 bmcub3JnL2NnaS1iaW4vbWFpbG1hbi9saXN0aW5mby9sdHRuZy1kZXYK --===============5442870971632604871==--