Re: [lttng-dev] Beginner question: how to inspect scheduling of multi-threaded user application?

2016-09-19 Thread David Aldrich
Hi Jonathan

Thanks for your reply. What is 'comm' in 'prev_comm'?

Best regards

David

> -Original Message-
> From: lttng-dev [mailto:lttng-dev-boun...@lists.lttng.org] On Behalf Of
> Jonathan Rajotte Julien
> Sent: 16 September 2016 18:37
> To: lttng-dev@lists.lttng.org
> Subject: Re: [lttng-dev] Beginner question: how to inspect scheduling of
> multi-threaded user application?
> 
> Hi
> 
> 
> On 2016-09-16 07:43 AM, David Aldrich wrote:
> > Hi
> >
> > I wonder if I might ask for some more guidance please?
> >
> > I now have lttng and Trace Compass running on Ubuntu.  I want to inspect
> the scheduling of threads in my user-space application.  So far, I have
> successfully captured a trace with the sched_switch event enabled:
> >
> > $ sudo lttng enable-event -k sched_switch
> >
> > This indeed shows my app's threads.  However, it also shows all the other
> threads in the system and does not show clearly (to my understanding)
> when the threads are scheduled / blocked.
> >
> > I would like some guidance on how to improve this tracing.
> >
> > 1) Would it be better if I defined my own “tracepoint providers” and then
> set trace events for when a thread wakes / blocks?
> 
> Could be a solution but you might want the built-in utility of lttng to filter
> out all noise first using the filtering feature.
> 
> e.g I'm interested in sched_switch event where chrome is involved
> 
> lttng create
> lttng enable-event --kernel "sched_switch" --filter 'prev_comm == "chrome*"
> || next_comm == "chrome*"'
> lttng start
> 
> 
> Using TraceCompass you will be mainly interested in the Control Flow View
> and the Resource view (show per cpu timeline activity).
> 
> >
> > 2) How could I show which core a thread is running on?
> 
> The Resource view from TraceCompass should help here.
> 
> Cheers
> 
> >
> > Best regards
> >
> > David
> > ___
> > lttng-dev mailing list
> > lttng-dev@lists.lttng.org
> > https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> 
> --
> Jonathan R. Julien
> Efficios
> 
> ___
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> 
> 
>  Click
> https://www.mailcontrol.com/sr/YRkaDi7sHfjGX2PQPOmvUu5zZAYN1MosBr
> 5yrM8i6yLTqipdxOLNFC1fulULj1tW45N!9c+2yXxm4uq9tqSB7g==  to report
> this email as spam.
___
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev


Re: [lttng-dev] Beginner question: how to inspect scheduling of multi-threaded user application?

2016-09-16 Thread David Aldrich
Hi

I wonder if I might ask for some more guidance please?

I now have lttng and Trace Compass running on Ubuntu.  I want to inspect the 
scheduling of threads in my user-space application.  So far, I have 
successfully captured a trace with the sched_switch event enabled:

$ sudo lttng enable-event -k sched_switch

This indeed shows my app's threads.  However, it also shows all the other 
threads in the system and does not show clearly (to my understanding) when the 
threads are scheduled / blocked.

I would like some guidance on how to improve this tracing.

1) Would it be better if I defined my own “tracepoint providers” and then set 
trace events for when a thread wakes / blocks?

2) How could I show which core a thread is running on?

Best regards

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


Re: [lttng-dev] Beginner question: how to inspect scheduling of multi-threaded user application?

2016-09-15 Thread David Aldrich
Thank you, things are looking much better now.

David

> -Original Message-
> From: Jonathan Rajotte Julien [mailto:jonathan.rajotte-jul...@efficios.com]
> Sent: 15 September 2016 16:50
> To: David Aldrich <david.aldr...@emea.nec.com>; lttng-
> d...@lists.lttng.org
> Subject: Re: [lttng-dev] Beginner question: how to inspect scheduling of
> multi-threaded user application?
> 
> Hi,
> 
> On 2016-09-15 11:41 AM, David Aldrich wrote:
> > Hi Jonathan
> >
> > Thanks, I had not logged out/in after joining the tracing group.
> >
> > I now see:
> >
> > $ lttng create demo_session
> > Session demo_session created.
> > $ sudo lttng enable-event -k sched_switch -s demo_session
> > Error: Event sched_switch: Kernel tracer not available (channel
> > channel0, session demo_session)
> > Warning: Some command(s) went wrong
> >
> > What do I need to install?
> 
> Did you have a look at http://lttng.org/download/#ubuntu ?
> 
> I recommend the use of the ppa if possible. For kernel tracing make sure to
> install the lttng-modules-dkms.
> 
> Make sure there is not error during the installation. It might happen but
> should not :) .
> 
> If it's not done already make sure to drop by http://lttng.org/docs/#doc-
> getting-started for more informations.
> 
> Cheers
> 
> >
> > Best regards
> >
> > David
> 
> --
> Jonathan R. Julien
> Efficios
> 
> 
> 
>  Click
> https://www.mailcontrol.com/sr/+PZCEcpjy5nGX2PQPOmvUsaHTTHE2WHLlI
> gN8TKUyPvY+09UnGjaICLUQ+RbaoZl0ti1ys3tAhuJRcENOpaP7A==  to report
> this email as spam.
___
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev


Re: [lttng-dev] Beginner question: how to inspect scheduling of multi-threaded user application?

2016-09-15 Thread David Aldrich
Hi Jonathan

Thanks, I had not logged out/in after joining the tracing group.

I now see:

$ lttng create demo_session
Session demo_session created.
$ sudo lttng enable-event -k sched_switch -s demo_session
Error: Event sched_switch: Kernel tracer not available (channel channel0, 
session demo_session)
Warning: Some command(s) went wrong

What do I need to install?

Best regards

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


Re: [lttng-dev] Beginner question: how to inspect scheduling of multi-threaded user application?

2016-09-15 Thread David Aldrich
Hi

I'm afraid I'm still struggling with getting started with lttng. To recap, I 
want to use lttng + TraceCompass to monitor the scheduling of threads in my 
multi-threaded C++ application on Ubuntu.

Here is my session:

$ sudo pkill lttng-sessiond
$ sudo lttng-sessiond
Error: Already running daemon.

$ lttng create demo_session Spawning a session daemon Session demo_session 
created.
Traces will be written in /home//lttng-traces/demo_session-20160915-152653
:~$ PERROR [14956/14964]: bind inet: Address already in use (in 
lttcomm_bind_inet_sock() at inet.c:109)
Warning: An other session daemon is using this JUL port. JUL support will be 
deactivated not interfering with the tracing.

$ sudo lttng enable-event -k sched_switch -s demo_session
Error: Event sched_switch: Session name not found (channel channel0, session 
demo_session)
Warning: Some command(s) went wrong

As you can see, each of these command generated a warning or error.  Please 
will you suggest where I am going wrong?

Best regards

David

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


[lttng-dev] Beginner question: how to inspect scheduling of multi-threaded user application?

2016-08-24 Thread David Aldrich
Hi

I am new to tracing in Linux and to lttng. I have a multi-threaded user 
application and I want to see:


1)  When the threads are scheduled to run

2)  Which cores the threads are running on.

I have installed lttng on Ubuntu 14.04 LTS.  I am expecting to visualise the 
trace using TraceCompass.

I have read the following doc section:

http://lttng.org/docs/#doc-tracing-your-own-user-application

In order to collect my trace, must I define custom tracepoint definitions ( in 
a tracepoint provider header file ), and insert tracepoints into my user 
application, or is there a simpler way of achieving my goal?

Best regards

David

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