All of lore.kernel.org
 help / color / mirror / Atom feed
* Problem in finding Jar file of LTTng for adding to Java project
       [not found] <797428900.3787919.1507493725940.ref@mail.yahoo.com>
@ 2017-10-08 20:15 ` MMM via lttng-dev
       [not found] ` <797428900.3787919.1507493725940@mail.yahoo.com>
  1 sibling, 0 replies; 15+ messages in thread
From: MMM via lttng-dev @ 2017-10-08 20:15 UTC (permalink / raw)
  To: lttng-dev


[-- Attachment #1.1: Type: text/plain, Size: 721 bytes --]

Dear Users,
I am beginner in tracing using LTTng. At present, I am going to trace a java program in  Ubuntu, while I faced with a problem. When I install LTTng 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.
Best regards, Mehdi.

[-- Attachment #1.2: Type: text/html, Size: 4166 bytes --]

[-- Attachment #2: Type: text/plain, Size: 156 bytes --]

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Problem in finding Jar file of LTTng for adding to Java project
       [not found] ` <797428900.3787919.1507493725940@mail.yahoo.com>
@ 2017-10-08 21:35   ` Philippe Proulx
       [not found]   ` <CAB4xu_26Qmpzf-mccjY3HutmFBBLdEEDAxx5_WLdxdFARSzgNA@mail.gmail.com>
  1 sibling, 0 replies; 15+ messages in thread
From: Philippe Proulx @ 2017-10-08 21:35 UTC (permalink / raw)
  To: MMM; +Cc: lttng-dev

On Sun, Oct 8, 2017 at 4:15 PM, MMM via lttng-dev
<lttng-dev@lists.lttng.org> wrote:
> Dear Users,
>
> I am beginner in tracing using LTTng. At present, I am going to trace a java
> program in  Ubuntu, while I faced with a problem. When I install LTTng 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
<https://packages.ubuntu.com/zesty/all/liblttng-ust-agent-java/filelist>,
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 <http://lttng.org/docs/v2.9/#doc-java-application>.

Phil

>
>
> Best regards,
>
> Mehdi.
>
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Problem in finding Jar file of LTTng for adding to Java project
       [not found]   ` <CAB4xu_26Qmpzf-mccjY3HutmFBBLdEEDAxx5_WLdxdFARSzgNA@mail.gmail.com>
@ 2017-10-10 20:12     ` MMM via lttng-dev
       [not found]     ` <776772327.5312865.1507666332238@mail.yahoo.com>
  1 sibling, 0 replies; 15+ messages in thread
From: MMM via lttng-dev @ 2017-10-10 20:12 UTC (permalink / raw)
  To: Philippe Proulx; +Cc: lttng-dev


[-- Attachment #1.1: Type: text/plain, Size: 2973 bytes --]

 Dear Philippe,
Thanks a lot for your consideration. I solved former problem. While, I faced 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;
public class Hello {  private static final int answer = 42; private static LTTngAgent lttngAgent;
 public static void main(String[] args) throws InterruptedException { Logger helloLog = Logger.getLogger("hello"); lttngAgent = LTTngAgent.getLTTngAgent();
 Thread.sleep(5000); helloLog.info("Hello World, the answer is " + answer); lttngAgent.dispose(); }
}///////////////////////
Also, I used following LTTng commands. 
////////////////////////////////lttng create java-testlttng enable-event -a -llttng 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.[error] opening trace "/[path]/lttng-traces/java-test10-20171010-130909" for reading.[error] none of the specified trace paths could be opened.
Could 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 am beginner in tracing using LTTng. At present, I am going to trace a java
> program in  Ubuntu, while I faced with a problem. When I install LTTng 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
<https://packages.ubuntu.com/zesty/all/liblttng-ust-agent-java/filelist>,
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 <http://lttng.org/docs/v2.9/#doc-java-application>.

Phil

>
>
> Best regards,
>
> Mehdi.
>
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>

[-- Attachment #1.2: Type: text/html, Size: 10875 bytes --]

[-- Attachment #2: Type: text/plain, Size: 156 bytes --]

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Problem in finding Jar file of LTTng for adding to Java project
       [not found]     ` <776772327.5312865.1507666332238@mail.yahoo.com>
@ 2017-10-10 20:58       ` Philippe Proulx
       [not found]       ` <CAB4xu_3hyJBYFoBm0yrT5mNTTgRXSNs5MmOpagL74XSY-P8RPA@mail.gmail.com>
                         ` (2 subsequent siblings)
  3 siblings, 0 replies; 15+ messages in thread
From: Philippe Proulx @ 2017-10-10 20:58 UTC (permalink / raw)
  To: MMM; +Cc: lttng-dev

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. While, I faced
> 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 = 42;
> private static LTTngAgent lttngAgent;
>
> public static void main(String[] args) throws InterruptedException {
> Logger helloLog = Logger.getLogger("hello");
> lttngAgent = 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 following
> 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
> <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 am beginner in tracing using LTTng. At present, I am going to trace a
>> java
>> program in  Ubuntu, while I faced with a problem. When I install LTTng 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
> <https://packages.ubuntu.com/zesty/all/liblttng-ust-agent-java/filelist>,
> 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 <http://lttng.org/docs/v2.9/#doc-java-application>.
>
> Phil
>
>
>>
>>
>> Best regards,
>>
>> Mehdi.
>>
>>
>> _______________________________________________
>> lttng-dev mailing list
>> lttng-dev@lists.lttng.org
>> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>>
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Problem in finding Jar file of LTTng for adding to Java project
       [not found]       ` <CAB4xu_3hyJBYFoBm0yrT5mNTTgRXSNs5MmOpagL74XSY-P8RPA@mail.gmail.com>
@ 2017-10-10 22:08         ` MMM via lttng-dev
  0 siblings, 0 replies; 15+ messages in thread
From: MMM via lttng-dev @ 2017-10-10 22:08 UTC (permalink / raw)
  To: Philippe Proulx; +Cc: lttng-dev


[-- Attachment #1.1: Type: text/plain, Size: 3859 bytes --]

 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. 
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:  
 
 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. While, I faced
> 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 = 42;
> private static LTTngAgent lttngAgent;
>
> public static void main(String[] args) throws InterruptedException {
> Logger helloLog = Logger.getLogger("hello");
> lttngAgent = 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 following
> 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
> <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 am beginner in tracing using LTTng. At present, I am going to trace a
>> java
>> program in  Ubuntu, while I faced with a problem. When I install LTTng 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
> <https://packages.ubuntu.com/zesty/all/liblttng-ust-agent-java/filelist>,
> 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 <http://lttng.org/docs/v2.9/#doc-java-application>.
>
> Phil
>
>
>>
>>
>> Best regards,
>>
>> Mehdi.
>>
>>
>> _______________________________________________
>> lttng-dev mailing list
>> lttng-dev@lists.lttng.org
>> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>>

[-- Attachment #1.2: Type: text/html, Size: 7907 bytes --]

[-- Attachment #2: Type: text/plain, Size: 156 bytes --]

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Problem in finding Jar file of LTTng for adding to Java project
       [not found]     ` <776772327.5312865.1507666332238@mail.yahoo.com>
  2017-10-10 20:58       ` Philippe Proulx
       [not found]       ` <CAB4xu_3hyJBYFoBm0yrT5mNTTgRXSNs5MmOpagL74XSY-P8RPA@mail.gmail.com>
@ 2017-10-11 14:39       ` Alexandre Montplaisir
       [not found]       ` <37f91596-023e-f552-b07f-3b4e073399cd@voxpopuli.im>
  3 siblings, 0 replies; 15+ messages in thread
From: Alexandre Montplaisir @ 2017-10-11 14:39 UTC (permalink / raw)
  To: MMM; +Cc: lttng-dev

Hi,

I tried compiling and running your program, and it runs fine on my end.
Here is what I did:

saved the snippet below to "Hello.java"
$ apt install liblttng-ust-agent-java
$ javac -cp /usr/share/java/lttng-ust-agent-jul.jar Hello.java

$ lttng create
$ lttng enable-event -a -j
$ lttng start
$ java -cp /usr/share/java/lttng-ust-agent-jul.jar:. Hello
$ lttng stop
$ lttng view

and I get the following output:
Trace directory: /home/alexandre/lttng-traces/auto-20171011-102431

[10:24:49.326824061] (+?.?????????) calista lttng_jul:event: { cpu_id =
2 }, { msg = "Hello World, the answer is 42", logger_name = "hello",
class_name = "Hello", method_name = "main", long_millis = 1507731889299,
int_loglevel = 800, int_threadid = 1 }


Make sure you are setting the -classpath/-cp option correctly, this
could explain the "unknown package" error you were getting.

Also note that you are using the deprecated "LTTngAgent.getLTTngAgent()"
API (the "javac" command should warn about it). It should still work,
but it's highly recommended to use the new API, as described in
https://lttng.org/docs/v2.10/#doc-jul . Basically you have to
instantiate an "LttngLogHandler", and attach it to your Logger.

HTH,
Alex


On 2017-10-10 04:12 PM, MMM via lttng-dev wrote:
> Dear Philippe,
>
> Thanks a lot for your consideration. I solved former problem. While, I
> faced 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;
>
> public class Hello {
> private static final int answer = 42;
> private static LTTngAgent lttngAgent;
>
> public static void main(String[] args) throws InterruptedException {
> Logger helloLog = Logger.getLogger("hello");
> lttngAgent = 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
> 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.
> [error] opening trace
> "/[path]/lttng-traces/java-test10-20171010-130909" for reading.
> [error] none of the specified trace paths could be opened.
>
> Could 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 <mailto:lttng-dev@lists.lttng.org>> wrote:
> > Dear Users,
> >
> > I am beginner in tracing using LTTng. At present, I am going to
> trace a java
> > program in  Ubuntu, while I faced with a problem. When I install
> LTTng 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
> <https://packages.ubuntu.com/zesty/all/liblttng-ust-agent-java/filelist>,
> 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 <http://lttng.org/docs/v2.9/#doc-java-application>.
>
> Phil
>
>
> >
> >
> > Best regards,
> >
> > Mehdi.
> >
> >
> > _______________________________________________
> > lttng-dev mailing list
> > lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
> > https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> >
>
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Problem in finding Jar file of LTTng for adding to Java project
       [not found]       ` <37f91596-023e-f552-b07f-3b4e073399cd@voxpopuli.im>
@ 2017-10-11 22:05         ` MMM via lttng-dev
       [not found]         ` <850230324.98540.1507759558449@mail.yahoo.com>
  1 sibling, 0 replies; 15+ messages in thread
From: MMM via lttng-dev @ 2017-10-11 22:05 UTC (permalink / raw)
  To: Alexandre Montplaisir; +Cc: lttng-dev


[-- Attachment #1.1: Type: text/plain, Size: 5315 bytes --]

 Dear Alex,
Thanks for your attention. I executed your commands step by step. While, again I received previous errors which are 
[error] Cannot open any trace for reading.[error] opening trace "[path]/lttng-traces/auto-20171011-145947" for reading.
[error] none of the specified trace paths could be opened.

I do not know the reason of this problem. Could you please help me to resolve it?
Regards,Mehdi.



    On Wednesday, October 11, 2017, 6:09:41 PM GMT+3:30, Alexandre Montplaisir <alexmonthy@voxpopuli.im> wrote:  
 
 Hi,

I tried compiling and running your program, and it runs fine on my end.
Here is what I did:

saved the snippet below to "Hello.java"
$ apt install liblttng-ust-agent-java
$ javac -cp /usr/share/java/lttng-ust-agent-jul.jar Hello.java

$ lttng create
$ lttng enable-event -a -j
$ lttng start
$ java -cp /usr/share/java/lttng-ust-agent-jul.jar:. Hello
$ lttng stop
$ lttng view

and I get the following output:
Trace directory: /home/alexandre/lttng-traces/auto-20171011-102431

[10:24:49.326824061] (+?.?????????) calista lttng_jul:event: { cpu_id =
2 }, { msg = "Hello World, the answer is 42", logger_name = "hello",
class_name = "Hello", method_name = "main", long_millis = 1507731889299,
int_loglevel = 800, int_threadid = 1 }


Make sure you are setting the -classpath/-cp option correctly, this
could explain the "unknown package" error you were getting.

Also note that you are using the deprecated "LTTngAgent.getLTTngAgent()"
API (the "javac" command should warn about it). It should still work,
but it's highly recommended to use the new API, as described in
https://lttng.org/docs/v2.10/#doc-jul . Basically you have to
instantiate an "LttngLogHandler", and attach it to your Logger.

HTH,
Alex


On 2017-10-10 04:12 PM, MMM via lttng-dev wrote:
> Dear Philippe,
>
> Thanks a lot for your consideration. I solved former problem. While, I
> faced 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;
>
> public class Hello {
> private static final int answer = 42;
> private static LTTngAgent lttngAgent;
>
> public static void main(String[] args) throws InterruptedException {
> Logger helloLog = Logger.getLogger("hello");
> lttngAgent = 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
> 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.
> [error] opening trace
> "/[path]/lttng-traces/java-test10-20171010-130909" for reading.
> [error] none of the specified trace paths could be opened.
>
> Could 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 <mailto:lttng-dev@lists.lttng.org>> wrote:
> > Dear Users,
> >
> > I am beginner in tracing using LTTng. At present, I am going to
> trace a java
> > program in  Ubuntu, while I faced with a problem. When I install
> LTTng 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
> <https://packages.ubuntu.com/zesty/all/liblttng-ust-agent-java/filelist>,
> 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 <http://lttng.org/docs/v2.9/#doc-java-application>.
>
> Phil
>
>
> >
> >
> > Best regards,
> >
> > Mehdi.
> >
> >
> > _______________________________________________
> > lttng-dev mailing list
> > lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
> > https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> >
>
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev


[-- Attachment #1.2: Type: text/html, Size: 10391 bytes --]

[-- Attachment #2: Type: text/plain, Size: 156 bytes --]

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Problem in finding Jar file of LTTng for adding to Java project
       [not found]         ` <850230324.98540.1507759558449@mail.yahoo.com>
@ 2017-10-12 15:21           ` Alexandre Montplaisir
       [not found]           ` <415c1e82-6532-d4a8-c443-8263a1a3cc91@voxpopuli.im>
  1 sibling, 0 replies; 15+ messages in thread
From: Alexandre Montplaisir @ 2017-10-12 15:21 UTC (permalink / raw)
  To: MMM; +Cc: lttng-dev



On 2017-10-11 06:05 PM, MMM wrote:
> Dear Alex,
>
> Thanks for your attention. I executed your commands step by step.
> While, again I received previous errors which are 
>
> [error] Cannot open any trace for reading.
> [error] opening trace "[path]/lttng-traces/auto-20171011-145947" for
> reading.
> [error] none of the specified trace paths could be opened.
>
> I do not know the reason of this problem. Could you please help me to
> resolve it?

As Philippe mentioned previously, this means the trace is empty, so no
events were produced by the session.

Did any of the other commands (java, javac, lttng create,...) output any
error messages?


Finally, it would help if you could specify:
- What version of Ubuntu you are running

- What version of LTTng you are running ("lttng --version")

- The output of the following command:
$ ls -l /usr/share/java/lttng-ust*

Thanks,
Alex

>
> Regards,
> Mehdi.
>
>
>
>
> On Wednesday, October 11, 2017, 6:09:41 PM GMT+3:30, Alexandre
> Montplaisir <alexmonthy@voxpopuli.im> wrote:
>
>
> Hi,
>
> I tried compiling and running your program, and it runs fine on my end.
> Here is what I did:
>
> saved the snippet below to "Hello.java"
> $ apt install liblttng-ust-agent-java
> $ javac -cp /usr/share/java/lttng-ust-agent-jul.jar Hello.java
>
> $ lttng create
> $ lttng enable-event -a -j
> $ lttng start
> $ java -cp /usr/share/java/lttng-ust-agent-jul.jar:. Hello
> $ lttng stop
> $ lttng view
>
> and I get the following output:
> Trace directory: /home/alexandre/lttng-traces/auto-20171011-102431
>
> [10:24:49.326824061] (+?.?????????) calista lttng_jul:event: { cpu_id =
> 2 }, { msg = "Hello World, the answer is 42", logger_name = "hello",
> class_name = "Hello", method_name = "main", long_millis = 1507731889299,
> int_loglevel = 800, int_threadid = 1 }
>
>
> Make sure you are setting the -classpath/-cp option correctly, this
> could explain the "unknown package" error you were getting.
>
> Also note that you are using the deprecated "LTTngAgent.getLTTngAgent()"
> API (the "javac" command should warn about it). It should still work,
> but it's highly recommended to use the new API, as described in
> https://lttng.org/docs/v2.10/#doc-jul
> <https://lttng.org/docs/v2.10/#doc-jul%20>. Basically you have to
> instantiate an "LttngLogHandler", and attach it to your Logger.
>
> HTH,
> Alex
>
>
> On 2017-10-10 04:12 PM, MMM via lttng-dev wrote:
> > Dear Philippe,
> >
> > Thanks a lot for your consideration. I solved former problem. While, I
> > faced 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;
> >
> > public class Hello {
> > private static final int answer = 42;
> > private static LTTngAgent lttngAgent;
> >
> > public static void main(String[] args) throws InterruptedException {
> > Logger helloLog = Logger.getLogger("hello");
> > lttngAgent = 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
> > 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.
> > [error] opening trace
> > "/[path]/lttng-traces/java-test10-20171010-130909" for reading.
> > [error] none of the specified trace paths could be opened.
> >
> > Could 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 <mailto:eeppeliteloop@gmail.com>> wrote:
> >
> >
> > On Sun, Oct 8, 2017 at 4:15 PM, MMM via lttng-dev
> > <lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>>>
> wrote:
> > > Dear Users,
> > >
> > > I am beginner in tracing using LTTng. At present, I am going to
> > trace a java
> > > program in  Ubuntu, while I faced with a problem. When I install
> > LTTng 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
> >
> <https://packages.ubuntu.com/zesty/all/liblttng-ust-agent-java/filelist>,
> > 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 <http://lttng.org/docs/v2.9/#doc-java-application>.
> >
> > Phil
> >
> >
> > >
> > >
> > > Best regards,
> > >
> > > Mehdi.
> > >
> > >
> > > _______________________________________________
> > > lttng-dev mailing list
> > > lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>>
>
> > > https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> > >
> >
> >
> > _______________________________________________
> > lttng-dev mailing list
> > lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
> > https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Problem in finding Jar file of LTTng for adding to Java project
       [not found]           ` <415c1e82-6532-d4a8-c443-8263a1a3cc91@voxpopuli.im>
  2017-10-12 19:38             ` MMM via lttng-dev
@ 2017-10-12 19:38             ` MMM via lttng-dev
       [not found]             ` <1302171483.738271.1507837087778@mail.yahoo.com>
  2 siblings, 0 replies; 15+ messages in thread
From: MMM via lttng-dev @ 2017-10-12 19:38 UTC (permalink / raw)
  To: Alexandre Montplaisir; +Cc: lttng-dev


[-- Attachment #1.1: Type: text/plain, Size: 7560 bytes --]

 Dear Alex,
As I mentioned, I used sample examples. for instance, I used mentioned simple program that you told tracing it return some result. While, I can not receive any result from tracing it. Also, I use Ubuntu 16.04 LTS and lttng 2.9.5. Besides, the output of asked command is 
//////////////////-rw-r--r-- 1 root root 40871 Jun 16 13:56 /usr/share/java/lttng-ust-agent-common-2.9.1.jarlrwxrwxrwx 1 root root    32 Jun 16 13:56 /usr/share/java/lttng-ust-agent-common.jar -> lttng-ust-agent-common-2.9.1.jar-rw-r--r-- 1 root root  4369 Jun 16 13:56 /usr/share/java/lttng-ust-agent-jul-2.9.1.jarlrwxrwxrwx 1 root root    29 Jun 16 13:56 /usr/share/java/lttng-ust-agent-jul.jar -> lttng-ust-agent-jul-2.9.1.jar-rw-r--r-- 1 root root  3933 Jun 16 13:56 /usr/share/java/lttng-ust-agent-log4j-2.9.1.jarlrwxrwxrwx 1 root root    31 Jun 16 13:56 /usr/share/java/lttng-ust-agent-log4j.jar -> lttng-ust-agent-log4j-2.9.1.jar////////////////////////////
Thanks for your attention.Regards,Mehdi.
    On Thursday, October 12, 2017, 6:51:12 PM GMT+3:30, Alexandre Montplaisir <alexmonthy@voxpopuli.im> wrote:  
 
 

On 2017-10-11 06:05 PM, MMM wrote:
> Dear Alex,
>
> Thanks for your attention. I executed your commands step by step.
> While, again I received previous errors which are 
>
> [error] Cannot open any trace for reading.
> [error] opening trace "[path]/lttng-traces/auto-20171011-145947" for
> reading.
> [error] none of the specified trace paths could be opened.
>
> I do not know the reason of this problem. Could you please help me to
> resolve it?

As Philippe mentioned previously, this means the trace is empty, so no
events were produced by the session.

Did any of the other commands (java, javac, lttng create,...) output any
error messages?


Finally, it would help if you could specify:
- What version of Ubuntu you are running

- What version of LTTng you are running ("lttng --version")

- The output of the following command:
$ ls -l /usr/share/java/lttng-ust*

Thanks,
Alex

>
> Regards,
> Mehdi.
>
>
>
>
> On Wednesday, October 11, 2017, 6:09:41 PM GMT+3:30, Alexandre
> Montplaisir <alexmonthy@voxpopuli.im> wrote:
>
>
> Hi,
>
> I tried compiling and running your program, and it runs fine on my end.
> Here is what I did:
>
> saved the snippet below to "Hello.java"
> $ apt install liblttng-ust-agent-java
> $ javac -cp /usr/share/java/lttng-ust-agent-jul.jar Hello.java
>
> $ lttng create
> $ lttng enable-event -a -j
> $ lttng start
> $ java -cp /usr/share/java/lttng-ust-agent-jul.jar:. Hello
> $ lttng stop
> $ lttng view
>
> and I get the following output:
> Trace directory: /home/alexandre/lttng-traces/auto-20171011-102431
>
> [10:24:49.326824061] (+?.?????????) calista lttng_jul:event: { cpu_id =
> 2 }, { msg = "Hello World, the answer is 42", logger_name = "hello",
> class_name = "Hello", method_name = "main", long_millis = 1507731889299,
> int_loglevel = 800, int_threadid = 1 }
>
>
> Make sure you are setting the -classpath/-cp option correctly, this
> could explain the "unknown package" error you were getting.
>
> Also note that you are using the deprecated "LTTngAgent.getLTTngAgent()"
> API (the "javac" command should warn about it). It should still work,
> but it's highly recommended to use the new API, as described in
> https://lttng.org/docs/v2.10/#doc-jul
> <https://lttng.org/docs/v2.10/#doc-jul%20>. Basically you have to
> instantiate an "LttngLogHandler", and attach it to your Logger.
>
> HTH,
> Alex
>
>
> On 2017-10-10 04:12 PM, MMM via lttng-dev wrote:
> > Dear Philippe,
> >
> > Thanks a lot for your consideration. I solved former problem. While, I
> > faced 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;
> >
> > public class Hello {
> > private static final int answer = 42;
> > private static LTTngAgent lttngAgent;
> >
> > public static void main(String[] args) throws InterruptedException {
> > Logger helloLog = Logger.getLogger("hello");
> > lttngAgent = 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
> > 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.
> > [error] opening trace
> > "/[path]/lttng-traces/java-test10-20171010-130909" for reading.
> > [error] none of the specified trace paths could be opened.
> >
> > Could 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 <mailto:eeppeliteloop@gmail.com>> wrote:
> >
> >
> > On Sun, Oct 8, 2017 at 4:15 PM, MMM via lttng-dev
> > <lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>>>
> wrote:
> > > Dear Users,
> > >
> > > I am beginner in tracing using LTTng. At present, I am going to
> > trace a java
> > > program in  Ubuntu, while I faced with a problem. When I install
> > LTTng 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
> >
> <https://packages.ubuntu.com/zesty/all/liblttng-ust-agent-java/filelist>,
> > 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 <http://lttng.org/docs/v2.9/#doc-java-application>.
> >
> > Phil
> >
> >
> > >
> > >
> > > Best regards,
> > >
> > > Mehdi.
> > >
> > >
> > > _______________________________________________
> > > lttng-dev mailing list
> > > lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>>
>
> > > https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> > >
> >
> >
> > _______________________________________________
> > lttng-dev mailing list
> > lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
> > https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>


[-- Attachment #1.2: Type: text/html, Size: 15093 bytes --]

[-- Attachment #2: Type: text/plain, Size: 156 bytes --]

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Problem in finding Jar file of LTTng for adding to Java project
       [not found]           ` <415c1e82-6532-d4a8-c443-8263a1a3cc91@voxpopuli.im>
@ 2017-10-12 19:38             ` MMM via lttng-dev
  2017-10-12 19:38             ` MMM via lttng-dev
       [not found]             ` <1302171483.738271.1507837087778@mail.yahoo.com>
  2 siblings, 0 replies; 15+ messages in thread
From: MMM via lttng-dev @ 2017-10-12 19:38 UTC (permalink / raw)
  To: Alexandre Montplaisir; +Cc: lttng-dev


[-- Attachment #1.1: Type: text/plain, Size: 7560 bytes --]

 Dear Alex,
As I mentioned, I used sample examples. for instance, I used mentioned simple program that you told tracing it return some result. While, I can not receive any result from tracing it. Also, I use Ubuntu 16.04 LTS and lttng 2.9.5. Besides, the output of asked command is 
//////////////////-rw-r--r-- 1 root root 40871 Jun 16 13:56 /usr/share/java/lttng-ust-agent-common-2.9.1.jarlrwxrwxrwx 1 root root    32 Jun 16 13:56 /usr/share/java/lttng-ust-agent-common.jar -> lttng-ust-agent-common-2.9.1.jar-rw-r--r-- 1 root root  4369 Jun 16 13:56 /usr/share/java/lttng-ust-agent-jul-2.9.1.jarlrwxrwxrwx 1 root root    29 Jun 16 13:56 /usr/share/java/lttng-ust-agent-jul.jar -> lttng-ust-agent-jul-2.9.1.jar-rw-r--r-- 1 root root  3933 Jun 16 13:56 /usr/share/java/lttng-ust-agent-log4j-2.9.1.jarlrwxrwxrwx 1 root root    31 Jun 16 13:56 /usr/share/java/lttng-ust-agent-log4j.jar -> lttng-ust-agent-log4j-2.9.1.jar////////////////////////////
Thanks for your attention.Regards,Mehdi.
    On Thursday, October 12, 2017, 6:51:12 PM GMT+3:30, Alexandre Montplaisir <alexmonthy@voxpopuli.im> wrote:  
 
 

On 2017-10-11 06:05 PM, MMM wrote:
> Dear Alex,
>
> Thanks for your attention. I executed your commands step by step.
> While, again I received previous errors which are 
>
> [error] Cannot open any trace for reading.
> [error] opening trace "[path]/lttng-traces/auto-20171011-145947" for
> reading.
> [error] none of the specified trace paths could be opened.
>
> I do not know the reason of this problem. Could you please help me to
> resolve it?

As Philippe mentioned previously, this means the trace is empty, so no
events were produced by the session.

Did any of the other commands (java, javac, lttng create,...) output any
error messages?


Finally, it would help if you could specify:
- What version of Ubuntu you are running

- What version of LTTng you are running ("lttng --version")

- The output of the following command:
$ ls -l /usr/share/java/lttng-ust*

Thanks,
Alex

>
> Regards,
> Mehdi.
>
>
>
>
> On Wednesday, October 11, 2017, 6:09:41 PM GMT+3:30, Alexandre
> Montplaisir <alexmonthy@voxpopuli.im> wrote:
>
>
> Hi,
>
> I tried compiling and running your program, and it runs fine on my end.
> Here is what I did:
>
> saved the snippet below to "Hello.java"
> $ apt install liblttng-ust-agent-java
> $ javac -cp /usr/share/java/lttng-ust-agent-jul.jar Hello.java
>
> $ lttng create
> $ lttng enable-event -a -j
> $ lttng start
> $ java -cp /usr/share/java/lttng-ust-agent-jul.jar:. Hello
> $ lttng stop
> $ lttng view
>
> and I get the following output:
> Trace directory: /home/alexandre/lttng-traces/auto-20171011-102431
>
> [10:24:49.326824061] (+?.?????????) calista lttng_jul:event: { cpu_id =
> 2 }, { msg = "Hello World, the answer is 42", logger_name = "hello",
> class_name = "Hello", method_name = "main", long_millis = 1507731889299,
> int_loglevel = 800, int_threadid = 1 }
>
>
> Make sure you are setting the -classpath/-cp option correctly, this
> could explain the "unknown package" error you were getting.
>
> Also note that you are using the deprecated "LTTngAgent.getLTTngAgent()"
> API (the "javac" command should warn about it). It should still work,
> but it's highly recommended to use the new API, as described in
> https://lttng.org/docs/v2.10/#doc-jul
> <https://lttng.org/docs/v2.10/#doc-jul%20>. Basically you have to
> instantiate an "LttngLogHandler", and attach it to your Logger.
>
> HTH,
> Alex
>
>
> On 2017-10-10 04:12 PM, MMM via lttng-dev wrote:
> > Dear Philippe,
> >
> > Thanks a lot for your consideration. I solved former problem. While, I
> > faced 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;
> >
> > public class Hello {
> > private static final int answer = 42;
> > private static LTTngAgent lttngAgent;
> >
> > public static void main(String[] args) throws InterruptedException {
> > Logger helloLog = Logger.getLogger("hello");
> > lttngAgent = 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
> > 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.
> > [error] opening trace
> > "/[path]/lttng-traces/java-test10-20171010-130909" for reading.
> > [error] none of the specified trace paths could be opened.
> >
> > Could 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 <mailto:eeppeliteloop@gmail.com>> wrote:
> >
> >
> > On Sun, Oct 8, 2017 at 4:15 PM, MMM via lttng-dev
> > <lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>>>
> wrote:
> > > Dear Users,
> > >
> > > I am beginner in tracing using LTTng. At present, I am going to
> > trace a java
> > > program in  Ubuntu, while I faced with a problem. When I install
> > LTTng 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
> >
> <https://packages.ubuntu.com/zesty/all/liblttng-ust-agent-java/filelist>,
> > 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 <http://lttng.org/docs/v2.9/#doc-java-application>.
> >
> > Phil
> >
> >
> > >
> > >
> > > Best regards,
> > >
> > > Mehdi.
> > >
> > >
> > > _______________________________________________
> > > lttng-dev mailing list
> > > lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>>
>
> > > https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> > >
> >
> >
> > _______________________________________________
> > lttng-dev mailing list
> > lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
> > https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>


[-- Attachment #1.2: Type: text/html, Size: 15093 bytes --]

[-- Attachment #2: Type: text/plain, Size: 156 bytes --]

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Problem in finding Jar file of LTTng for adding to Java project
       [not found]             ` <1302171483.738271.1507837087778@mail.yahoo.com>
@ 2017-10-13 20:27               ` Alexandre Montplaisir
       [not found]               ` <5e5cbef3-794c-e4e1-8a02-bca432153031@voxpopuli.im>
  1 sibling, 0 replies; 15+ messages in thread
From: Alexandre Montplaisir @ 2017-10-13 20:27 UTC (permalink / raw)
  To: MMM; +Cc: lttng-dev

On 2017-10-12 03:38 PM, MMM wrote:
> Dear Alex,
>
> As I mentioned, I used sample examples. for instance, I used mentioned
> simple program that you told tracing it return some result. While, I
> can not receive any result from tracing it. Also, I use Ubuntu 16.04
> LTS and lttng 2.9.5. Besides, the output of asked command is 
>
> //////////////////
> -rw-r--r-- 1 root root 40871 Jun 16 13:56
> /usr/share/java/lttng-ust-agent-common-2.9.1.jar
> lrwxrwxrwx 1 root root    32 Jun 16 13:56
> /usr/share/java/lttng-ust-agent-common.jar ->
> lttng-ust-agent-common-2.9.1.jar
> -rw-r--r-- 1 root root  4369 Jun 16 13:56
> /usr/share/java/lttng-ust-agent-jul-2.9.1.jar
> lrwxrwxrwx 1 root root    29 Jun 16 13:56
> /usr/share/java/lttng-ust-agent-jul.jar -> lttng-ust-agent-jul-2.9.1.jar
> -rw-r--r-- 1 root root  3933 Jun 16 13:56
> /usr/share/java/lttng-ust-agent-log4j-2.9.1.jar
> lrwxrwxrwx 1 root root    31 Jun 16 13:56
> /usr/share/java/lttng-ust-agent-log4j.jar ->
> lttng-ust-agent-log4j-2.9.1.jar
> ////////////////////////////

Everything seems to be in order here.

I will try your exact same environment to see if I can reproduce the issue.
How did you install your LTTng 2.9? Was it from source, or from a PPA?
The Ubuntu 16.04 main archive only has 2.7.*

Cheers,
Alex

>
> Thanks for your attention.
> Regards,
> Mehdi.
>
> On Thursday, October 12, 2017, 6:51:12 PM GMT+3:30, Alexandre
> Montplaisir <alexmonthy@voxpopuli.im> wrote:
>
>
>
>
> On 2017-10-11 06:05 PM, MMM wrote:
> > Dear Alex,
> >
> > Thanks for your attention. I executed your commands step by step.
> > While, again I received previous errors which are 
> >
> > [error] Cannot open any trace for reading.
> > [error] opening trace "[path]/lttng-traces/auto-20171011-145947" for
> > reading.
> > [error] none of the specified trace paths could be opened.
> >
> > I do not know the reason of this problem. Could you please help me to
> > resolve it?
>
> As Philippe mentioned previously, this means the trace is empty, so no
> events were produced by the session.
>
> Did any of the other commands (java, javac, lttng create,...) output any
> error messages?
>
>
> Finally, it would help if you could specify:
> - What version of Ubuntu you are running
>
> - What version of LTTng you are running ("lttng --version")
>
> - The output of the following command:
> $ ls -l /usr/share/java/lttng-ust*
>
> Thanks,
> Alex
>
> >
> > Regards,
> > Mehdi.
> >
> >
> >
> >
> > On Wednesday, October 11, 2017, 6:09:41 PM GMT+3:30, Alexandre
> > Montplaisir <alexmonthy@voxpopuli.im
> <mailto:alexmonthy@voxpopuli.im>> wrote:
> >
> >
> > Hi,
> >
> > I tried compiling and running your program, and it runs fine on my end.
> > Here is what I did:
> >
> > saved the snippet below to "Hello.java"
> > $ apt install liblttng-ust-agent-java
> > $ javac -cp /usr/share/java/lttng-ust-agent-jul.jar Hello.java
> >
> > $ lttng create
> > $ lttng enable-event -a -j
> > $ lttng start
> > $ java -cp /usr/share/java/lttng-ust-agent-jul.jar:. Hello
> > $ lttng stop
> > $ lttng view
> >
> > and I get the following output:
> > Trace directory: /home/alexandre/lttng-traces/auto-20171011-102431
> >
> > [10:24:49.326824061] (+?.?????????) calista lttng_jul:event: { cpu_id =
> > 2 }, { msg = "Hello World, the answer is 42", logger_name = "hello",
> > class_name = "Hello", method_name = "main", long_millis = 1507731889299,
> > int_loglevel = 800, int_threadid = 1 }
> >
> >
> > Make sure you are setting the -classpath/-cp option correctly, this
> > could explain the "unknown package" error you were getting.
> >
> > Also note that you are using the deprecated "LTTngAgent.getLTTngAgent()"
> > API (the "javac" command should warn about it). It should still work,
> > but it's highly recommended to use the new API, as described in
> > https://lttng.org/docs/v2.10/#doc-jul
> > <https://lttng.org/docs/v2.10/#doc-jul%20>. Basically you have to
> > instantiate an "LttngLogHandler", and attach it to your Logger.
> >
> > HTH,
> > Alex
> >
> >
> > On 2017-10-10 04:12 PM, MMM via lttng-dev wrote:
> > > Dear Philippe,
> > >
> > > Thanks a lot for your consideration. I solved former problem. While, I
> > > faced 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;
> > >
> > > public class Hello {
> > > private static final int answer = 42;
> > > private static LTTngAgent lttngAgent;
> > >
> > > public static void main(String[] args) throws InterruptedException {
> > > Logger helloLog = Logger.getLogger("hello");
> > > lttngAgent = 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
> > > 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.
> > > [error] opening trace
> > > "/[path]/lttng-traces/java-test10-20171010-130909" for reading.
> > > [error] none of the specified trace paths could be opened.
> > >
> > > Could 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 <mailto:eeppeliteloop@gmail.com>
> <mailto:eeppeliteloop@gmail.com <mailto:eeppeliteloop@gmail.com>>> wrote:
> > >
> > >
> > > On Sun, Oct 8, 2017 at 4:15 PM, MMM via lttng-dev
> > > <lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>>
> > <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>>>>
> > wrote:
> > > > Dear Users,
> > > >
> > > > I am beginner in tracing using LTTng. At present, I am going to
> > > trace a java
> > > > program in  Ubuntu, while I faced with a problem. When I install
> > > LTTng 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
> > >
> >
> <https://packages.ubuntu.com/zesty/all/liblttng-ust-agent-java/filelist>,
> > > 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 <http://lttng.org/docs/v2.9/#doc-java-application>.
> > >
> > > Phil
> > >
> > >
> > > >
> > > >
> > > > Best regards,
> > > >
> > > > Mehdi.
> > > >
> > > >
> > > > _______________________________________________
> > > > lttng-dev mailing list
> > > > lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>>
> > <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>>>
> >
> > > > https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>
> > > >
> > >
> > >
> > > _______________________________________________
> > > lttng-dev mailing list
> > > lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>>
> > > https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> >
>


_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Problem in finding Jar file of LTTng for adding to Java project
       [not found]               ` <5e5cbef3-794c-e4e1-8a02-bca432153031@voxpopuli.im>
@ 2017-10-14 22:18                 ` MMM via lttng-dev
       [not found]                 ` <670458818.2469.1508019513394@mail.yahoo.com>
  1 sibling, 0 replies; 15+ messages in thread
From: MMM via lttng-dev @ 2017-10-14 22:18 UTC (permalink / raw)
  To: Alexandre Montplaisir; +Cc: lttng-dev


[-- Attachment #1.1: Type: text/plain, Size: 9076 bytes --]

 I installed LTTng from source at first. While after that, I also reinstall it from PPA. Is it the cause of my problem?    On Friday, October 13, 2017, 11:57:33 PM GMT+3:30, Alexandre Montplaisir <alexmonthy@voxpopuli.im> wrote:  
 
 On 2017-10-12 03:38 PM, MMM wrote:
> Dear Alex,
>
> As I mentioned, I used sample examples. for instance, I used mentioned
> simple program that you told tracing it return some result. While, I
> can not receive any result from tracing it. Also, I use Ubuntu 16.04
> LTS and lttng 2.9.5. Besides, the output of asked command is 
>
> //////////////////
> -rw-r--r-- 1 root root 40871 Jun 16 13:56
> /usr/share/java/lttng-ust-agent-common-2.9.1.jar
> lrwxrwxrwx 1 root root    32 Jun 16 13:56
> /usr/share/java/lttng-ust-agent-common.jar ->
> lttng-ust-agent-common-2.9.1.jar
> -rw-r--r-- 1 root root  4369 Jun 16 13:56
> /usr/share/java/lttng-ust-agent-jul-2.9.1.jar
> lrwxrwxrwx 1 root root    29 Jun 16 13:56
> /usr/share/java/lttng-ust-agent-jul.jar -> lttng-ust-agent-jul-2.9.1.jar
> -rw-r--r-- 1 root root  3933 Jun 16 13:56
> /usr/share/java/lttng-ust-agent-log4j-2.9.1.jar
> lrwxrwxrwx 1 root root    31 Jun 16 13:56
> /usr/share/java/lttng-ust-agent-log4j.jar ->
> lttng-ust-agent-log4j-2.9.1.jar
> ////////////////////////////

Everything seems to be in order here.

I will try your exact same environment to see if I can reproduce the issue.
How did you install your LTTng 2.9? Was it from source, or from a PPA?
The Ubuntu 16.04 main archive only has 2.7.*

Cheers,
Alex

>
> Thanks for your attention.
> Regards,
> Mehdi.
>
> On Thursday, October 12, 2017, 6:51:12 PM GMT+3:30, Alexandre
> Montplaisir <alexmonthy@voxpopuli.im> wrote:
>
>
>
>
> On 2017-10-11 06:05 PM, MMM wrote:
> > Dear Alex,
> >
> > Thanks for your attention. I executed your commands step by step.
> > While, again I received previous errors which are 
> >
> > [error] Cannot open any trace for reading.
> > [error] opening trace "[path]/lttng-traces/auto-20171011-145947" for
> > reading.
> > [error] none of the specified trace paths could be opened.
> >
> > I do not know the reason of this problem. Could you please help me to
> > resolve it?
>
> As Philippe mentioned previously, this means the trace is empty, so no
> events were produced by the session.
>
> Did any of the other commands (java, javac, lttng create,...) output any
> error messages?
>
>
> Finally, it would help if you could specify:
> - What version of Ubuntu you are running
>
> - What version of LTTng you are running ("lttng --version")
>
> - The output of the following command:
> $ ls -l /usr/share/java/lttng-ust*
>
> Thanks,
> Alex
>
> >
> > Regards,
> > Mehdi.
> >
> >
> >
> >
> > On Wednesday, October 11, 2017, 6:09:41 PM GMT+3:30, Alexandre
> > Montplaisir <alexmonthy@voxpopuli.im
> <mailto:alexmonthy@voxpopuli.im>> wrote:
> >
> >
> > Hi,
> >
> > I tried compiling and running your program, and it runs fine on my end.
> > Here is what I did:
> >
> > saved the snippet below to "Hello.java"
> > $ apt install liblttng-ust-agent-java
> > $ javac -cp /usr/share/java/lttng-ust-agent-jul.jar Hello.java
> >
> > $ lttng create
> > $ lttng enable-event -a -j
> > $ lttng start
> > $ java -cp /usr/share/java/lttng-ust-agent-jul.jar:. Hello
> > $ lttng stop
> > $ lttng view
> >
> > and I get the following output:
> > Trace directory: /home/alexandre/lttng-traces/auto-20171011-102431
> >
> > [10:24:49.326824061] (+?.?????????) calista lttng_jul:event: { cpu_id =
> > 2 }, { msg = "Hello World, the answer is 42", logger_name = "hello",
> > class_name = "Hello", method_name = "main", long_millis = 1507731889299,
> > int_loglevel = 800, int_threadid = 1 }
> >
> >
> > Make sure you are setting the -classpath/-cp option correctly, this
> > could explain the "unknown package" error you were getting.
> >
> > Also note that you are using the deprecated "LTTngAgent.getLTTngAgent()"
> > API (the "javac" command should warn about it). It should still work,
> > but it's highly recommended to use the new API, as described in
> > https://lttng.org/docs/v2.10/#doc-jul
> > <https://lttng.org/docs/v2.10/#doc-jul%20>. Basically you have to
> > instantiate an "LttngLogHandler", and attach it to your Logger.
> >
> > HTH,
> > Alex
> >
> >
> > On 2017-10-10 04:12 PM, MMM via lttng-dev wrote:
> > > Dear Philippe,
> > >
> > > Thanks a lot for your consideration. I solved former problem. While, I
> > > faced 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;
> > >
> > > public class Hello {
> > > private static final int answer = 42;
> > > private static LTTngAgent lttngAgent;
> > >
> > > public static void main(String[] args) throws InterruptedException {
> > > Logger helloLog = Logger.getLogger("hello");
> > > lttngAgent = 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
> > > 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.
> > > [error] opening trace
> > > "/[path]/lttng-traces/java-test10-20171010-130909" for reading.
> > > [error] none of the specified trace paths could be opened.
> > >
> > > Could 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 <mailto:eeppeliteloop@gmail.com>
> <mailto:eeppeliteloop@gmail.com <mailto:eeppeliteloop@gmail.com>>> wrote:
> > >
> > >
> > > On Sun, Oct 8, 2017 at 4:15 PM, MMM via lttng-dev
> > > <lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>>
> > <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>>>>
> > wrote:
> > > > Dear Users,
> > > >
> > > > I am beginner in tracing using LTTng. At present, I am going to
> > > trace a java
> > > > program in  Ubuntu, while I faced with a problem. When I install
> > > LTTng 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
> > >
> >
> <https://packages.ubuntu.com/zesty/all/liblttng-ust-agent-java/filelist>,
> > > 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 <http://lttng.org/docs/v2.9/#doc-java-application>.
> > >
> > > Phil
> > >
> > >
> > > >
> > > >
> > > > Best regards,
> > > >
> > > > Mehdi.
> > > >
> > > >
> > > > _______________________________________________
> > > > lttng-dev mailing list
> > > > lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>>
> > <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>>>
> >
> > > > https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>
> > > >
> > >
> > >
> > > _______________________________________________
> > > lttng-dev mailing list
> > > lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>>
> > > https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> >
>


[-- Attachment #1.2: Type: text/html, Size: 19292 bytes --]

[-- Attachment #2: Type: text/plain, Size: 156 bytes --]

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Problem in finding Jar file of LTTng for adding to Java project
       [not found]                 ` <670458818.2469.1508019513394@mail.yahoo.com>
@ 2017-10-16 12:13                   ` Alexandre Montplaisir
       [not found]                   ` <34c576ec-e89f-60f2-fd8f-b3354a976bfc@voxpopuli.im>
  1 sibling, 0 replies; 15+ messages in thread
From: Alexandre Montplaisir @ 2017-10-16 12:13 UTC (permalink / raw)
  To: MMM; +Cc: lttng-dev



On 2017-10-14 06:18 PM, MMM wrote:
>  I installed LTTng from source at first. While after that, I also reinstall it from PPA. Is it the cause of my problem?

Perhaps! Having a second installation in parallel is a common source of
errors, because a binary from a given version may try to link with a
library from another one.

Make sure you don't have any LTTng-related binaries or libraries in
/usr/local/bin, /usr/local/lib, /usr/local/share/java, etc.
You can also check the output of "ldd /usr/bin/lttng" and make sure only
libraries from /usr/lib are listed, and not /usr/local/lib.

Cheers,
Alex

>    On Friday, October 13, 2017, 11:57:33 PM GMT+3:30, Alexandre Montplaisir <alexmonthy@voxpopuli.im> wrote:  
>  
>  On 2017-10-12 03:38 PM, MMM wrote:
>> Dear Alex,
>>
>> As I mentioned, I used sample examples. for instance, I used mentioned
>> simple program that you told tracing it return some result. While, I
>> can not receive any result from tracing it. Also, I use Ubuntu 16.04
>> LTS and lttng 2.9.5. Besides, the output of asked command is 
>>
>> //////////////////
>> -rw-r--r-- 1 root root 40871 Jun 16 13:56
>> /usr/share/java/lttng-ust-agent-common-2.9.1.jar
>> lrwxrwxrwx 1 root root    32 Jun 16 13:56
>> /usr/share/java/lttng-ust-agent-common.jar ->
>> lttng-ust-agent-common-2.9.1.jar
>> -rw-r--r-- 1 root root  4369 Jun 16 13:56
>> /usr/share/java/lttng-ust-agent-jul-2.9.1.jar
>> lrwxrwxrwx 1 root root    29 Jun 16 13:56
>> /usr/share/java/lttng-ust-agent-jul.jar -> lttng-ust-agent-jul-2.9.1.jar
>> -rw-r--r-- 1 root root  3933 Jun 16 13:56
>> /usr/share/java/lttng-ust-agent-log4j-2.9.1.jar
>> lrwxrwxrwx 1 root root    31 Jun 16 13:56
>> /usr/share/java/lttng-ust-agent-log4j.jar ->
>> lttng-ust-agent-log4j-2.9.1.jar
>> ////////////////////////////
> Everything seems to be in order here.
>
> I will try your exact same environment to see if I can reproduce the issue.
> How did you install your LTTng 2.9? Was it from source, or from a PPA?
> The Ubuntu 16.04 main archive only has 2.7.*
>
> Cheers,
> Alex
>
>> Thanks for your attention.
>> Regards,
>> Mehdi.
>>
>> On Thursday, October 12, 2017, 6:51:12 PM GMT+3:30, Alexandre
>> Montplaisir <alexmonthy@voxpopuli.im> wrote:
>>
>>
>>
>>
>> On 2017-10-11 06:05 PM, MMM wrote:
>>> Dear Alex,
>>>
>>> Thanks for your attention. I executed your commands step by step.
>>> While, again I received previous errors which are 
>>>
>>> [error] Cannot open any trace for reading.
>>> [error] opening trace "[path]/lttng-traces/auto-20171011-145947" for
>>> reading.
>>> [error] none of the specified trace paths could be opened.
>>>
>>> I do not know the reason of this problem. Could you please help me to
>>> resolve it?
>> As Philippe mentioned previously, this means the trace is empty, so no
>> events were produced by the session.
>>
>> Did any of the other commands (java, javac, lttng create,...) output any
>> error messages?
>>
>>
>> Finally, it would help if you could specify:
>> - What version of Ubuntu you are running
>>
>> - What version of LTTng you are running ("lttng --version")
>>
>> - The output of the following command:
>> $ ls -l /usr/share/java/lttng-ust*
>>
>> Thanks,
>> Alex
>>
>>> Regards,
>>> Mehdi.
>>>
>>>
>>>
>>>
>>> On Wednesday, October 11, 2017, 6:09:41 PM GMT+3:30, Alexandre
>>> Montplaisir <alexmonthy@voxpopuli.im
>> <mailto:alexmonthy@voxpopuli.im>> wrote:
>>>
>>> Hi,
>>>
>>> I tried compiling and running your program, and it runs fine on my end.
>>> Here is what I did:
>>>
>>> saved the snippet below to "Hello.java"
>>> $ apt install liblttng-ust-agent-java
>>> $ javac -cp /usr/share/java/lttng-ust-agent-jul.jar Hello.java
>>>
>>> $ lttng create
>>> $ lttng enable-event -a -j
>>> $ lttng start
>>> $ java -cp /usr/share/java/lttng-ust-agent-jul.jar:. Hello
>>> $ lttng stop
>>> $ lttng view
>>>
>>> and I get the following output:
>>> Trace directory: /home/alexandre/lttng-traces/auto-20171011-102431
>>>
>>> [10:24:49.326824061] (+?.?????????) calista lttng_jul:event: { cpu_id =
>>> 2 }, { msg = "Hello World, the answer is 42", logger_name = "hello",
>>> class_name = "Hello", method_name = "main", long_millis = 1507731889299,
>>> int_loglevel = 800, int_threadid = 1 }
>>>
>>>
>>> Make sure you are setting the -classpath/-cp option correctly, this
>>> could explain the "unknown package" error you were getting.
>>>
>>> Also note that you are using the deprecated "LTTngAgent.getLTTngAgent()"
>>> API (the "javac" command should warn about it). It should still work,
>>> but it's highly recommended to use the new API, as described in
>>> https://lttng.org/docs/v2.10/#doc-jul
>>> <https://lttng.org/docs/v2.10/#doc-jul%20>. Basically you have to
>>> instantiate an "LttngLogHandler", and attach it to your Logger.
>>>
>>> HTH,
>>> Alex
>>>
>>>
>>> On 2017-10-10 04:12 PM, MMM via lttng-dev wrote:
>>>> Dear Philippe,
>>>>
>>>> Thanks a lot for your consideration. I solved former problem. While, I
>>>> faced 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;
>>>>
>>>> public class Hello {
>>>> private static final int answer = 42;
>>>> private static LTTngAgent lttngAgent;
>>>>
>>>> public static void main(String[] args) throws InterruptedException {
>>>> Logger helloLog = Logger.getLogger("hello");
>>>> lttngAgent = 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
>>>> 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.
>>>> [error] opening trace
>>>> "/[path]/lttng-traces/java-test10-20171010-130909" for reading.
>>>> [error] none of the specified trace paths could be opened.
>>>>
>>>> Could 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 <mailto:eeppeliteloop@gmail.com>
>> <mailto:eeppeliteloop@gmail.com <mailto:eeppeliteloop@gmail.com>>> wrote:
>>>>
>>>> On Sun, Oct 8, 2017 at 4:15 PM, MMM via lttng-dev
>>>> <lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
>> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>>
>>> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
>> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>>>>
>>> wrote:
>>>>> Dear Users,
>>>>>
>>>>> I am beginner in tracing using LTTng. At present, I am going to
>>>> trace a java
>>>>> program in  Ubuntu, while I faced with a problem. When I install
>>>> LTTng 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
>>>>
>> <https://packages.ubuntu.com/zesty/all/liblttng-ust-agent-java/filelist>,
>>>> 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 <http://lttng.org/docs/v2.9/#doc-java-application>.
>>>>
>>>> Phil
>>>>
>>>>
>>>>>
>>>>> Best regards,
>>>>>
>>>>> Mehdi.
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> lttng-dev mailing list
>>>>> lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
>> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>>
>>> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
>> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>>>
>>>>> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>>>>
>>>> _______________________________________________
>>>> lttng-dev mailing list
>>>> lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
>> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>>
>>>> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Problem in finding Jar file of LTTng for adding to Java project
       [not found]                   ` <34c576ec-e89f-60f2-fd8f-b3354a976bfc@voxpopuli.im>
@ 2017-10-16 15:44                     ` Philippe Proulx
       [not found]                     ` <CAB4xu_3=vRyUQqfZajrsw8zK09b5n-FYxS3qyAzuhhK=zVQ66w@mail.gmail.com>
  1 sibling, 0 replies; 15+ messages in thread
From: Philippe Proulx @ 2017-10-16 15:44 UTC (permalink / raw)
  To: Alexandre Montplaisir; +Cc: lttng-dev

On Mon, Oct 16, 2017 at 8:13 AM, Alexandre Montplaisir
<alexmonthy@voxpopuli.im> wrote:
>
>
>
> On 2017-10-14 06:18 PM, MMM wrote:
> >  I installed LTTng from source at first. While after that, I also reinstall it from PPA. Is it the cause of my problem?
>
> Perhaps! Having a second installation in parallel is a common source of
> errors, because a binary from a given version may try to link with a
> library from another one.

I doubt that, because Automake sets explicit rpaths when installing.

The default install prefix for the PPA packages is /usr while the
default install prefix (unless you set it explicitly with --prefix at
configuration time) when you build from source is /usr/local. Unless
you're messing with LD_LIBRARY_PATH which takes precedence over the
binary's rpath, there's no conflict.

Phil

>
> Make sure you don't have any LTTng-related binaries or libraries in
> /usr/local/bin, /usr/local/lib, /usr/local/share/java, etc.
> You can also check the output of "ldd /usr/bin/lttng" and make sure only
> libraries from /usr/lib are listed, and not /usr/local/lib.
>
> Cheers,
> Alex
>
> >    On Friday, October 13, 2017, 11:57:33 PM GMT+3:30, Alexandre Montplaisir <alexmonthy@voxpopuli.im> wrote:
> >
> >  On 2017-10-12 03:38 PM, MMM wrote:
> >> Dear Alex,
> >>
> >> As I mentioned, I used sample examples. for instance, I used mentioned
> >> simple program that you told tracing it return some result. While, I
> >> can not receive any result from tracing it. Also, I use Ubuntu 16.04
> >> LTS and lttng 2.9.5. Besides, the output of asked command is
> >>
> >> //////////////////
> >> -rw-r--r-- 1 root root 40871 Jun 16 13:56
> >> /usr/share/java/lttng-ust-agent-common-2.9.1.jar
> >> lrwxrwxrwx 1 root root    32 Jun 16 13:56
> >> /usr/share/java/lttng-ust-agent-common.jar ->
> >> lttng-ust-agent-common-2.9.1.jar
> >> -rw-r--r-- 1 root root  4369 Jun 16 13:56
> >> /usr/share/java/lttng-ust-agent-jul-2.9.1.jar
> >> lrwxrwxrwx 1 root root    29 Jun 16 13:56
> >> /usr/share/java/lttng-ust-agent-jul.jar -> lttng-ust-agent-jul-2.9.1.jar
> >> -rw-r--r-- 1 root root  3933 Jun 16 13:56
> >> /usr/share/java/lttng-ust-agent-log4j-2.9.1.jar
> >> lrwxrwxrwx 1 root root    31 Jun 16 13:56
> >> /usr/share/java/lttng-ust-agent-log4j.jar ->
> >> lttng-ust-agent-log4j-2.9.1.jar
> >> ////////////////////////////
> > Everything seems to be in order here.
> >
> > I will try your exact same environment to see if I can reproduce the issue.
> > How did you install your LTTng 2.9? Was it from source, or from a PPA?
> > The Ubuntu 16.04 main archive only has 2.7.*
> >
> > Cheers,
> > Alex
> >
> >> Thanks for your attention.
> >> Regards,
> >> Mehdi.
> >>
> >> On Thursday, October 12, 2017, 6:51:12 PM GMT+3:30, Alexandre
> >> Montplaisir <alexmonthy@voxpopuli.im> wrote:
> >>
> >>
> >>
> >>
> >> On 2017-10-11 06:05 PM, MMM wrote:
> >>> Dear Alex,
> >>>
> >>> Thanks for your attention. I executed your commands step by step.
> >>> While, again I received previous errors which are
> >>>
> >>> [error] Cannot open any trace for reading.
> >>> [error] opening trace "[path]/lttng-traces/auto-20171011-145947" for
> >>> reading.
> >>> [error] none of the specified trace paths could be opened.
> >>>
> >>> I do not know the reason of this problem. Could you please help me to
> >>> resolve it?
> >> As Philippe mentioned previously, this means the trace is empty, so no
> >> events were produced by the session.
> >>
> >> Did any of the other commands (java, javac, lttng create,...) output any
> >> error messages?
> >>
> >>
> >> Finally, it would help if you could specify:
> >> - What version of Ubuntu you are running
> >>
> >> - What version of LTTng you are running ("lttng --version")
> >>
> >> - The output of the following command:
> >> $ ls -l /usr/share/java/lttng-ust*
> >>
> >> Thanks,
> >> Alex
> >>
> >>> Regards,
> >>> Mehdi.
> >>>
> >>>
> >>>
> >>>
> >>> On Wednesday, October 11, 2017, 6:09:41 PM GMT+3:30, Alexandre
> >>> Montplaisir <alexmonthy@voxpopuli.im
> >> <mailto:alexmonthy@voxpopuli.im>> wrote:
> >>>
> >>> Hi,
> >>>
> >>> I tried compiling and running your program, and it runs fine on my end.
> >>> Here is what I did:
> >>>
> >>> saved the snippet below to "Hello.java"
> >>> $ apt install liblttng-ust-agent-java
> >>> $ javac -cp /usr/share/java/lttng-ust-agent-jul.jar Hello.java
> >>>
> >>> $ lttng create
> >>> $ lttng enable-event -a -j
> >>> $ lttng start
> >>> $ java -cp /usr/share/java/lttng-ust-agent-jul.jar:. Hello
> >>> $ lttng stop
> >>> $ lttng view
> >>>
> >>> and I get the following output:
> >>> Trace directory: /home/alexandre/lttng-traces/auto-20171011-102431
> >>>
> >>> [10:24:49.326824061] (+?.?????????) calista lttng_jul:event: { cpu_id =
> >>> 2 }, { msg = "Hello World, the answer is 42", logger_name = "hello",
> >>> class_name = "Hello", method_name = "main", long_millis = 1507731889299,
> >>> int_loglevel = 800, int_threadid = 1 }
> >>>
> >>>
> >>> Make sure you are setting the -classpath/-cp option correctly, this
> >>> could explain the "unknown package" error you were getting.
> >>>
> >>> Also note that you are using the deprecated "LTTngAgent.getLTTngAgent()"
> >>> API (the "javac" command should warn about it). It should still work,
> >>> but it's highly recommended to use the new API, as described in
> >>> https://lttng.org/docs/v2.10/#doc-jul
> >>> <https://lttng.org/docs/v2.10/#doc-jul%20>. Basically you have to
> >>> instantiate an "LttngLogHandler", and attach it to your Logger.
> >>>
> >>> HTH,
> >>> Alex
> >>>
> >>>
> >>> On 2017-10-10 04:12 PM, MMM via lttng-dev wrote:
> >>>> Dear Philippe,
> >>>>
> >>>> Thanks a lot for your consideration. I solved former problem. While, I
> >>>> faced 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;
> >>>>
> >>>> public class Hello {
> >>>> private static final int answer = 42;
> >>>> private static LTTngAgent lttngAgent;
> >>>>
> >>>> public static void main(String[] args) throws InterruptedException {
> >>>> Logger helloLog = Logger.getLogger("hello");
> >>>> lttngAgent = 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
> >>>> 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.
> >>>> [error] opening trace
> >>>> "/[path]/lttng-traces/java-test10-20171010-130909" for reading.
> >>>> [error] none of the specified trace paths could be opened.
> >>>>
> >>>> Could 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 <mailto:eeppeliteloop@gmail.com>
> >> <mailto:eeppeliteloop@gmail.com <mailto:eeppeliteloop@gmail.com>>> wrote:
> >>>>
> >>>> On Sun, Oct 8, 2017 at 4:15 PM, MMM via lttng-dev
> >>>> <lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
> >> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>>
> >>> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
> >> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>>>>
> >>> wrote:
> >>>>> Dear Users,
> >>>>>
> >>>>> I am beginner in tracing using LTTng. At present, I am going to
> >>>> trace a java
> >>>>> program in  Ubuntu, while I faced with a problem. When I install
> >>>> LTTng 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
> >>>>
> >> <https://packages.ubuntu.com/zesty/all/liblttng-ust-agent-java/filelist>,
> >>>> 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 <http://lttng.org/docs/v2.9/#doc-java-application>.
> >>>>
> >>>> Phil
> >>>>
> >>>>
> >>>>>
> >>>>> Best regards,
> >>>>>
> >>>>> Mehdi.
> >>>>>
> >>>>>
> >>>>> _______________________________________________
> >>>>> lttng-dev mailing list
> >>>>> lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
> >> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>>
> >>> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
> >> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>>>
> >>>>> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> >>>>
> >>>> _______________________________________________
> >>>> lttng-dev mailing list
> >>>> lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
> >> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>>
> >>>> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> >
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Problem in finding Jar file of LTTng for adding to Java project
       [not found]                     ` <CAB4xu_3=vRyUQqfZajrsw8zK09b5n-FYxS3qyAzuhhK=zVQ66w@mail.gmail.com>
@ 2017-10-17 15:42                       ` MMM via lttng-dev
  0 siblings, 0 replies; 15+ messages in thread
From: MMM via lttng-dev @ 2017-10-17 15:42 UTC (permalink / raw)
  To: Alexandre Montplaisir, Philippe Proulx; +Cc: lttng-dev


[-- Attachment #1.1: Type: text/plain, Size: 11091 bytes --]

 I checked all libraries which are listed in result of "ldd /usr/bin/lttng"  command. Non of them are exit in /usr/local/lib. At present, I am going to reinstall my Ubuntu and check the status of my problem in the new Ubuntu. Could you please let me know which method for installing LTTng is better? from source or from PPA?
Regards,Mehdi.
    On Monday, October 16, 2017, 7:14:48 PM GMT+3:30, Philippe Proulx <eeppeliteloop@gmail.com> wrote:  
 
 On Mon, Oct 16, 2017 at 8:13 AM, Alexandre Montplaisir
<alexmonthy@voxpopuli.im> wrote:
>
>
>
> On 2017-10-14 06:18 PM, MMM wrote:
> >  I installed LTTng from source at first. While after that, I also reinstall it from PPA. Is it the cause of my problem?
>
> Perhaps! Having a second installation in parallel is a common source of
> errors, because a binary from a given version may try to link with a
> library from another one.

I doubt that, because Automake sets explicit rpaths when installing.

The default install prefix for the PPA packages is /usr while the
default install prefix (unless you set it explicitly with --prefix at
configuration time) when you build from source is /usr/local. Unless
you're messing with LD_LIBRARY_PATH which takes precedence over the
binary's rpath, there's no conflict.

Phil

>
> Make sure you don't have any LTTng-related binaries or libraries in
> /usr/local/bin, /usr/local/lib, /usr/local/share/java, etc.
> You can also check the output of "ldd /usr/bin/lttng" and make sure only
> libraries from /usr/lib are listed, and not /usr/local/lib.
>
> Cheers,
> Alex
>
> >    On Friday, October 13, 2017, 11:57:33 PM GMT+3:30, Alexandre Montplaisir <alexmonthy@voxpopuli.im> wrote:
> >
> >  On 2017-10-12 03:38 PM, MMM wrote:
> >> Dear Alex,
> >>
> >> As I mentioned, I used sample examples. for instance, I used mentioned
> >> simple program that you told tracing it return some result. While, I
> >> can not receive any result from tracing it. Also, I use Ubuntu 16.04
> >> LTS and lttng 2.9.5. Besides, the output of asked command is
> >>
> >> //////////////////
> >> -rw-r--r-- 1 root root 40871 Jun 16 13:56
> >> /usr/share/java/lttng-ust-agent-common-2.9.1.jar
> >> lrwxrwxrwx 1 root root    32 Jun 16 13:56
> >> /usr/share/java/lttng-ust-agent-common.jar ->
> >> lttng-ust-agent-common-2.9.1.jar
> >> -rw-r--r-- 1 root root  4369 Jun 16 13:56
> >> /usr/share/java/lttng-ust-agent-jul-2.9.1.jar
> >> lrwxrwxrwx 1 root root    29 Jun 16 13:56
> >> /usr/share/java/lttng-ust-agent-jul.jar -> lttng-ust-agent-jul-2.9.1.jar
> >> -rw-r--r-- 1 root root  3933 Jun 16 13:56
> >> /usr/share/java/lttng-ust-agent-log4j-2.9.1.jar
> >> lrwxrwxrwx 1 root root    31 Jun 16 13:56
> >> /usr/share/java/lttng-ust-agent-log4j.jar ->
> >> lttng-ust-agent-log4j-2.9.1.jar
> >> ////////////////////////////
> > Everything seems to be in order here.
> >
> > I will try your exact same environment to see if I can reproduce the issue.
> > How did you install your LTTng 2.9? Was it from source, or from a PPA?
> > The Ubuntu 16.04 main archive only has 2.7.*
> >
> > Cheers,
> > Alex
> >
> >> Thanks for your attention.
> >> Regards,
> >> Mehdi.
> >>
> >> On Thursday, October 12, 2017, 6:51:12 PM GMT+3:30, Alexandre
> >> Montplaisir <alexmonthy@voxpopuli.im> wrote:
> >>
> >>
> >>
> >>
> >> On 2017-10-11 06:05 PM, MMM wrote:
> >>> Dear Alex,
> >>>
> >>> Thanks for your attention. I executed your commands step by step.
> >>> While, again I received previous errors which are
> >>>
> >>> [error] Cannot open any trace for reading.
> >>> [error] opening trace "[path]/lttng-traces/auto-20171011-145947" for
> >>> reading.
> >>> [error] none of the specified trace paths could be opened.
> >>>
> >>> I do not know the reason of this problem. Could you please help me to
> >>> resolve it?
> >> As Philippe mentioned previously, this means the trace is empty, so no
> >> events were produced by the session.
> >>
> >> Did any of the other commands (java, javac, lttng create,...) output any
> >> error messages?
> >>
> >>
> >> Finally, it would help if you could specify:
> >> - What version of Ubuntu you are running
> >>
> >> - What version of LTTng you are running ("lttng --version")
> >>
> >> - The output of the following command:
> >> $ ls -l /usr/share/java/lttng-ust*
> >>
> >> Thanks,
> >> Alex
> >>
> >>> Regards,
> >>> Mehdi.
> >>>
> >>>
> >>>
> >>>
> >>> On Wednesday, October 11, 2017, 6:09:41 PM GMT+3:30, Alexandre
> >>> Montplaisir <alexmonthy@voxpopuli.im
> >> <mailto:alexmonthy@voxpopuli.im>> wrote:
> >>>
> >>> Hi,
> >>>
> >>> I tried compiling and running your program, and it runs fine on my end.
> >>> Here is what I did:
> >>>
> >>> saved the snippet below to "Hello.java"
> >>> $ apt install liblttng-ust-agent-java
> >>> $ javac -cp /usr/share/java/lttng-ust-agent-jul.jar Hello.java
> >>>
> >>> $ lttng create
> >>> $ lttng enable-event -a -j
> >>> $ lttng start
> >>> $ java -cp /usr/share/java/lttng-ust-agent-jul.jar:. Hello
> >>> $ lttng stop
> >>> $ lttng view
> >>>
> >>> and I get the following output:
> >>> Trace directory: /home/alexandre/lttng-traces/auto-20171011-102431
> >>>
> >>> [10:24:49.326824061] (+?.?????????) calista lttng_jul:event: { cpu_id =
> >>> 2 }, { msg = "Hello World, the answer is 42", logger_name = "hello",
> >>> class_name = "Hello", method_name = "main", long_millis = 1507731889299,
> >>> int_loglevel = 800, int_threadid = 1 }
> >>>
> >>>
> >>> Make sure you are setting the -classpath/-cp option correctly, this
> >>> could explain the "unknown package" error you were getting.
> >>>
> >>> Also note that you are using the deprecated "LTTngAgent.getLTTngAgent()"
> >>> API (the "javac" command should warn about it). It should still work,
> >>> but it's highly recommended to use the new API, as described in
> >>> https://lttng.org/docs/v2.10/#doc-jul
> >>> <https://lttng.org/docs/v2.10/#doc-jul%20>. Basically you have to
> >>> instantiate an "LttngLogHandler", and attach it to your Logger.
> >>>
> >>> HTH,
> >>> Alex
> >>>
> >>>
> >>> On 2017-10-10 04:12 PM, MMM via lttng-dev wrote:
> >>>> Dear Philippe,
> >>>>
> >>>> Thanks a lot for your consideration. I solved former problem. While, I
> >>>> faced 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;
> >>>>
> >>>> public class Hello {
> >>>> private static final int answer = 42;
> >>>> private static LTTngAgent lttngAgent;
> >>>>
> >>>> public static void main(String[] args) throws InterruptedException {
> >>>> Logger helloLog = Logger.getLogger("hello");
> >>>> lttngAgent = 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
> >>>> 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.
> >>>> [error] opening trace
> >>>> "/[path]/lttng-traces/java-test10-20171010-130909" for reading.
> >>>> [error] none of the specified trace paths could be opened.
> >>>>
> >>>> Could 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 <mailto:eeppeliteloop@gmail.com>
> >> <mailto:eeppeliteloop@gmail.com <mailto:eeppeliteloop@gmail.com>>> wrote:
> >>>>
> >>>> On Sun, Oct 8, 2017 at 4:15 PM, MMM via lttng-dev
> >>>> <lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
> >> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>>
> >>> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
> >> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>>>>
> >>> wrote:
> >>>>> Dear Users,
> >>>>>
> >>>>> I am beginner in tracing using LTTng. At present, I am going to
> >>>> trace a java
> >>>>> program in  Ubuntu, while I faced with a problem. When I install
> >>>> LTTng 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
> >>>>
> >> <https://packages.ubuntu.com/zesty/all/liblttng-ust-agent-java/filelist>,
> >>>> 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 <http://lttng.org/docs/v2.9/#doc-java-application>.
> >>>>
> >>>> Phil
> >>>>
> >>>>
> >>>>>
> >>>>> Best regards,
> >>>>>
> >>>>> Mehdi.
> >>>>>
> >>>>>
> >>>>> _______________________________________________
> >>>>> lttng-dev mailing list
> >>>>> lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
> >> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>>
> >>> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
> >> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>>>
> >>>>> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> >>>>
> >>>> _______________________________________________
> >>>> lttng-dev mailing list
> >>>> lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>
> >> <mailto:lttng-dev@lists.lttng.org <mailto:lttng-dev@lists.lttng.org>>
> >>>> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> >
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

[-- Attachment #1.2: Type: text/html, Size: 24398 bytes --]

[-- Attachment #2: Type: text/plain, Size: 156 bytes --]

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2017-10-17 15:53 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <797428900.3787919.1507493725940.ref@mail.yahoo.com>
2017-10-08 20:15 ` Problem in finding Jar file of LTTng for adding to Java project MMM via lttng-dev
     [not found] ` <797428900.3787919.1507493725940@mail.yahoo.com>
2017-10-08 21:35   ` Philippe Proulx
     [not found]   ` <CAB4xu_26Qmpzf-mccjY3HutmFBBLdEEDAxx5_WLdxdFARSzgNA@mail.gmail.com>
2017-10-10 20:12     ` MMM via lttng-dev
     [not found]     ` <776772327.5312865.1507666332238@mail.yahoo.com>
2017-10-10 20:58       ` Philippe Proulx
     [not found]       ` <CAB4xu_3hyJBYFoBm0yrT5mNTTgRXSNs5MmOpagL74XSY-P8RPA@mail.gmail.com>
2017-10-10 22:08         ` MMM via lttng-dev
2017-10-11 14:39       ` Alexandre Montplaisir
     [not found]       ` <37f91596-023e-f552-b07f-3b4e073399cd@voxpopuli.im>
2017-10-11 22:05         ` MMM via lttng-dev
     [not found]         ` <850230324.98540.1507759558449@mail.yahoo.com>
2017-10-12 15:21           ` Alexandre Montplaisir
     [not found]           ` <415c1e82-6532-d4a8-c443-8263a1a3cc91@voxpopuli.im>
2017-10-12 19:38             ` MMM via lttng-dev
2017-10-12 19:38             ` MMM via lttng-dev
     [not found]             ` <1302171483.738271.1507837087778@mail.yahoo.com>
2017-10-13 20:27               ` Alexandre Montplaisir
     [not found]               ` <5e5cbef3-794c-e4e1-8a02-bca432153031@voxpopuli.im>
2017-10-14 22:18                 ` MMM via lttng-dev
     [not found]                 ` <670458818.2469.1508019513394@mail.yahoo.com>
2017-10-16 12:13                   ` Alexandre Montplaisir
     [not found]                   ` <34c576ec-e89f-60f2-fd8f-b3354a976bfc@voxpopuli.im>
2017-10-16 15:44                     ` Philippe Proulx
     [not found]                     ` <CAB4xu_3=vRyUQqfZajrsw8zK09b5n-FYxS3qyAzuhhK=zVQ66w@mail.gmail.com>
2017-10-17 15:42                       ` MMM via lttng-dev

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.