[lttng-dev] Problem to get lttng work with a daemon application
Hans Nordebäck
hans.nordeback at ericsson.com
Thu Sep 13 09:07:56 EDT 2012
Hi Mathieu, I have installed lttng-ust 2.0.5 and lttng-tools 2.0.4, I run a gdb session and realized what
the problem is. I noticed that lttng threads are created before main via __attribute__(constructor),
and the problem with the daemon is that the lttng threads "disappears" after "daemonizing" the daemon,
causing recvmsg in ustcomm_recv_unix_sock to hang. I removed the __attribute__(constructor) and called
lttng_ust_init explicitly, it works, but I have to search for a more general solution./Thanks Hans
-----Original Message-----
From: Mathieu Desnoyers [mailto:mathieu.desnoyers at efficios.com]
Sent: den 12 september 2012 15:52
To: Hans Nordebäck
Cc: lttng-dev at lists.lttng.org
Subject: Re: [lttng-dev] Problem to get lttng work with a daemon application
* Hans Nordebäck (hans.nordeback at ericsson.com) wrote:
> Hi Mathieu, I upgraded to version 2.0.4, but it did not solve the
> problem./Thanks Hans
Hi Hans,
Please provide the version numbers you use for both lttng-tools and lttng-ust. The lttng.org website lists the latest lttng-ust as 2.0.5, which leads me to think you might have forgotten to upgrade it.
Don't forget to restart your test application (just to be sure, rebuild it against the new lttng-ust). Also make sure you kill all lttng-sessiond that might still be active.
Thanks,
Mathieu
>
> -----Original Message-----
> From: Mathieu Desnoyers [mailto:mathieu.desnoyers at efficios.com]
> Sent: den 12 september 2012 14:42
> To: Hans Nordebäck
> Cc: lttng-dev at lists.lttng.org
> Subject: Re: [lttng-dev] Problem to get lttng work with a daemon
> application
>
> * Hans Nordebäck (hans.nordeback at ericsson.com) wrote:
> > Hi, I've just started using lttng and run it in Ubuntu 12.04 in VirtualBox.
> >
> > I have run the sample applications without any problem, but I have
> > problems to get a daemon application work.
> >
> > I have added tracepoint support in the same way as for the sample
> > applications and do the following:
> >
> > 1) The lttng-sessiond (version 2.0.1) is started (with
>
> 2.0.1 is old. Please upgrade to the latest versions of the 2.0.x series for both lttng-tools and lttng-ust and try again.
>
> Thanks,
>
> Mathieu
>
> > --verbose--verbose-consumer).
> > 2) I start the daemon application with one tracepoint implemented.
> > 3) I can see that the lttng-sessiond gets called regarding this tracepoint:
> >
> > DEBUG1: App registered with pid:18421 ppid:18419 uid:0 gid:0 sock:18
> > name:osafamfnd (version 2.0) [in ust_app_register() at
> > ust-app.c:1365]
> >
> > 4) I run, strace -f lttng -v list -u, and can see that it "hangs" in
> > recvmsg:
> > write(2, "DEBUG1: Getting UST tracing even"..., 81DEBUG1: Getting UST
> > tracing events [in list_ust_events() at commands/list.c:253]
> > ) = 81
> > getuid() = 0
> > socket(PF_FILE, SOCK_STREAM, 0) = 3
> > connect(3, {sa_family=AF_FILE,
> > path="/var/run/lttng/client-lttng-sessiond"}, 110) = 0
> > geteuid() = 0
> > getegid() = 0
> > sendmsg(3, {msg_name(0)=NULL,
> > msg_iov(1)=[{"\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
> > 0\ 0\0\0\0\0"..., 8784}], msg_controllen=28, {cmsg_len=28,
> > cmsg_level=SOL_SOCKET, cmsg_type=SCM_CREDENTIALS{pid=28878, uid=0,
> > gid=0}}, msg_flags=0}, 0) =
> > 8784
> > recvmsg(3,
> >
> > 5) the lttng-sessiond outputs only the following and hangs as long
> > as the daemon application is running.
> > DEBUG1: Processing client command 14 [in process_client_msg() at
> > main.c:3309]
> >
> > 6) The only difference between sample app logs and daemon app logs
> > is that the pid and ppid seen at DEBUG1: App registered. In the
> > daemon case in this run it is pid 18421 ppid 18419 but when I print
> > it in the function calling tracepoint it is pid 18430. I don't know
> > if that is related to the problem. Any help on this would be appreciated.
> >
> > /Thanks Hans
> >
> >
> >
> >
> > _______________________________________________
> > lttng-dev mailing list
> > lttng-dev at lists.lttng.org
> > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>
> --
> Mathieu Desnoyers
> Operating System Efficiency R&D Consultant EfficiOS Inc.
> http://www.efficios.com
--
Mathieu Desnoyers
Operating System Efficiency R&D Consultant EfficiOS Inc.
http://www.efficios.com
More information about the lttng-dev
mailing list