<div dir="ltr">Hello,<div><br></div><div>I see, I was loading the liblttng-ust-fd but not fork. Once loading both of these with LD_PRELOAD everything seems to be working great. Thank you for all your assistance.</div><div><br></div><div>I was also wondering, it may be impractical to always load these shared objects because the systems starts the app service on boot. Is there an lttng alternative to integrate this into the build? I am not too familiar with dynamic linking so sorry if this sounds trivial.</div><div><br></div><div>Thanks,</div><div>Mosleh </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 20, 2019 at 9:46 AM Mathieu Desnoyers <<a href="mailto:mathieu.desnoyers@efficios.com">mathieu.desnoyers@efficios.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"><div><br></div><div><br></div><div><span id="gmail-m_-4344702845474935989zwchr">----- On Feb 20, 2019, at 9:10 AM, Mosleh Uddin <<a href="mailto:mosleh1235@gmail.com" target="_blank">mosleh1235@gmail.com</a>> wrote:<br></span></div><div><blockquote style="border-left:2px solid rgb(16,16,255);margin-left:5px;padding-left:5px;color:rgb(0,0,0);font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt"><div dir="ltr">Hello,<br><div>Here is what I do to get the consistent behavior:</div><div>When the app is running as a service, lttng list -u does not display any events, initially I do have to lttng enable-events and lttng start to see the tracepoints in lttng view. However, after lttng start, I can disable all events and I can still see the events coming through in lttng view. When I run the app normally, lttng list -u displays the tracepoints I place in the app, and all functionality of lttng works as expected.</div><br><div>I apologize, I am in the process of trying to get you the outputs you are asking for, however due to confidentiality with the app the outputs of running the commands need to be reviewed by others. I will try to get this to you as soon as I can.</div><br><div>I can say the service is being kick started by systemd. Also I believe the app is mass-closing file descriptors when it is daemonizing. I tried to dynamically load the liblttng-ust-fd.so but the behavior did not change. </div></div></blockquote><div><br></div><div>Did you load both liblttng-ust-fork.so and liblttng-ust-fd.so with LD_PRELOAD when launching your application ?<br></div><div><br></div><div>If not using LD_PRELOAD env. var., how did you load them ?<br></div><div><br></div><div>Thanks,<br></div><div><br></div><div>Mathieu<br></div><div><br></div><blockquote style="border-left:2px solid rgb(16,16,255);margin-left:5px;padding-left:5px;color:rgb(0,0,0);font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt"><div dir="ltr"><br><div>Thanks,</div><div>Mosleh</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Feb 19, 2019 at 5:16 PM Francis Deslauriers <<a href="mailto:francis.deslauriers@efficios.com" target="_blank">francis.deslauriers@efficios.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Mosleh,<br>
Just to be clear:<br>
When you run your app as a service (background), lttng list -u doesn't<br>
display any events AND you see events in the live session without<br>
having run enable-event and start commands.<br>
When you run your app normally, lttng list -u displays events AND you<br>
only see events after running enable-event and start commands.<br>
Is that correct?<br>
<br>
Please provide the output of the lttng-sessiond in verbose mode using<br>
the following command:<br>
> lttng-sessiond -vvv<br>
please provide the output of your application as a service with this<br>
environment variable: LTTNG_UST_DEBUG=1<br>
and please provide us with the service file describing how your<br>
service is started.<br>
Put all of this on a <a href="http://pastebin.com" rel="noreferrer" target="_blank">pastebin.com</a><br>
<br>
Is your application mass-closing file descriptors when it's<br>
daemonizing? how about using fork() syscall without an exec() after<br>
it? If so, have a look at this part of the UST man page:<br>
<a href="https://lttng.org/man/3/lttng-ust/v2.10/#doc-_using_lttng_ust_with_daemons" rel="noreferrer" target="_blank">https://lttng.org/man/3/lttng-ust/v2.10/#doc-_using_lttng_ust_with_daemons</a><br>
<br>
Thank you,<br>
Francis<br>
<br>
<br>
Le mar. 19 févr. 2019, à 16 h 37, Mosleh Uddin <<a href="mailto:mosleh1235@gmail.com" target="_blank">mosleh1235@gmail.com</a>> a écrit :<br>
><br>
> Hello,<br>
><br>
> Sorry for the late reply. I was able to figure out the weird behavior from the application. Turns out if I run my application as a service, lttng no longer can see any of the UST tracepoints and causes the behavior I was explaining.<br>
> When I execute the application normally (./app_name), the functionality is as expected. Is this the expected behavior? Is there some way I can trace the userspace application while running it as a service simultaneously?<br>
><br>
> Thanks for any info,<br>
> Mosleh<br>
><br>
> On Fri, Feb 15, 2019 at 2:48 PM Francis Deslauriers <<a href="mailto:francis.deslauriers@efficios.com" target="_blank">francis.deslauriers@efficios.com</a>> wrote:<br>
>><br>
>> Can you start the lttng-sessiond in verbose mode using the following command:<br>
>> > lttng-sessiond -vvv<br>
>> and then do the lttng create, start of application and lttng view on another console.<br>
>><br>
>> Then copy the output of the sessiond on <a href="https://pastebin.com/" rel="noreferrer" target="_blank">https://pastebin.com/</a> and send us the link.<br>
>><br>
>> Thank you,<br>
>> Francis<br>
>><br>
>> Le ven. 15 févr. 2019, à 14 h 36, Mosleh Uddin <<a href="mailto:mosleh1235@gmail.com" target="_blank">mosleh1235@gmail.com</a>> a écrit :<br>
>>><br>
>>> That's correct, I don't enable any events or do: lttng start.<br>
>>> Here is some snapshots of starting everything up, followed by starting my application.<br>
>>><br>
>>><br>
>>> Here are the outputs for the commands:<br>
>>><br>
>>><br>
>>><br>
>>><br>
>>><br>
>>><br>
>>><br>
>>> Note that even though the session is inactive, when a trace event occurs in my application it is being recorded in the appropriate directory:<br>
>>><br>
>>><br>
>>><br>
>>> Also maybe important, the system has root only user. Would having the application belonging to a different user and trying to run as root cause these kinds of complications? I did notice when testing on a raspberry pi that running an application as a root user would mean running sessions as root user as well.<br>
>>><br>
>>> Thanks,<br>
>>> Mosleh<br>
>>><br>
>>> On Fri, Feb 15, 2019 at 11:55 AM Francis Deslauriers <<a href="mailto:francis.deslauriers@efficios.com" target="_blank">francis.deslauriers@efficios.com</a>> wrote:<br>
>>>><br>
>>>> Adding back lttng-dev mailing list.<br>
>>>><br>
>>>> So you don't even run a lttng-enable-event command?<br>
>>>> That's odd.<br>
>>>><br>
>>>> Can you send us the output of the following commands:<br>
>>>> Is it possible that there are other lttng-sessiond daemons running on<br>
>>>> the machine?<br>
>>>> > ps aux | grep "lttng-sessiond"<br>
>>>> Verify if there are other active tracing sessions:<br>
>>>> > lttng list<br>
>>>> Check the details of the current session:<br>
>>>> > lttng status<br>
>>>><br>
>>>> Thank you,<br>
>>>> Francis<br>
>>>><br>
>>>> Le ven. 15 févr. 2019, à 11 h 29, Mosleh Uddin <<a href="mailto:mosleh1235@gmail.com" target="_blank">mosleh1235@gmail.com</a>> a écrit :<br>
>>>> ><br>
>>>> > Hi Francis,<br>
>>>> ><br>
>>>> > Thank you for the quick response.<br>
>>>> > Just to clear things up, my application is running when I run that command.<br>
>>>> ><br>
>>>> > The commands I am running are:<br>
>>>> > > lttng-sessiond -d<br>
>>>> > > lttng create my-sess --live<br>
>>>> > After this command I start my application. If I then do the command:<br>
>>>> > > lttng view<br>
>>>> > I will see the tracepoints in the application in the terminal even though I have not done: lttng start.<br>
>>>> ><br>
>>>> > I thought it was strange that I cannot find my application in the: lttng list command under any domain.<br>
>>>> > Also the reason I start my application after creating a session is because the system automatically starts the application using systemd,<br>
>>>> > in order to get tracing data at all I have to manually stop the application and start it again after creating a session.<br>
>>>> ><br>
>>>> > Thanks again for any help,<br>
>>>> > Mosleh<br>
>>>> ><br>
>>>> > On Fri, Feb 15, 2019 at 10:32 AM Francis Deslauriers <<a href="mailto:francis.deslauriers@efficios.com" target="_blank">francis.deslauriers@efficios.com</a>> wrote:<br>
>>>> >><br>
>>>> >> Hi Mosleh,<br>
>>>> >> It's expected to not see any event when running lttng list -u if no<br>
>>>> >> lttng-ust instrumented applications are running.<br>
>>>> >><br>
>>>> >> What are the exact lttng commands you are running to see those<br>
>>>> >> unexpected events?<br>
>>>> >><br>
>>>> >> Thank you,<br>
>>>> >> Francis<br>
>>>> >><br>
>>>> >><br>
>>>> >> Le ven. 15 févr. 2019, à 10 h 08, Mosleh Uddin <<a href="mailto:mosleh1235@gmail.com" target="_blank">mosleh1235@gmail.com</a>> a écrit :<br>
>>>> >> ><br>
>>>> >> > Hello,<br>
>>>> >> ><br>
>>>> >> > I am having a strange issue with my current application. For some context, I have integrated LTTng into a Yocto build and put custom trace points in my embedded system application. Once I load the built image onto my system and start a session daemon, I try to list all available userspace events (using lttng list -u), but no events show up.<br>
>>>> >> ><br>
>>>> >> > The strange occurrence is when I create a session (lltng create my-sess) and not start tracing the trace events will display on the screen regardless (when starting session in live mode with lttng view). I was wondering if anyone has any insight on this issue I am having.<br>
>>>> >> ><br>
>>>> >> > Thanks for any assistance,<br>
>>>> >> > Mosleh<br>
>>>> >> > _______________________________________________<br>
>>>> >> > lttng-dev mailing list<br>
>>>> >> > <a href="mailto:lttng-dev@lists.lttng.org" target="_blank">lttng-dev@lists.lttng.org</a><br>
>>>> >> > <a href="https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev" rel="noreferrer" target="_blank">https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev</a><br>
>>>> >><br>
>>>> >> --<br>
>>>> >> Francis Deslauriers<br>
>>>> >> Computer Engineer<br>
>>>> >> EfficiOS inc.<br>
>>>><br>
>>>><br>
>>>><br>
>>>> --<br>
>>>> Francis Deslauriers<br>
>>>> Computer Engineer<br>
>>>> EfficiOS inc.<br>
>>><br>
>>> _______________________________________________<br>
>>> lttng-dev mailing list<br>
>>> <a href="mailto:lttng-dev@lists.lttng.org" target="_blank">lttng-dev@lists.lttng.org</a><br>
>>> <a href="https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev" rel="noreferrer" target="_blank">https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev</a><br>
>><br>
>><br>
>><br>
>> --<br>
>> Francis Deslauriers<br>
>> Computer Engineer<br>
>> EfficiOS inc.<br>
<br>
<br>
<br>
-- <br>
Francis Deslauriers<br>
Computer Engineer<br>
EfficiOS inc.<br>
</blockquote></div>
<br>_______________________________________________<br>lttng-dev mailing list<br><a href="mailto:lttng-dev@lists.lttng.org" target="_blank">lttng-dev@lists.lttng.org</a><br><a href="https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev" target="_blank">https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev</a><br></blockquote></div><div><br></div><div>-- <br></div><div>Mathieu Desnoyers<br>EfficiOS Inc.<br><a href="http://www.efficios.com" target="_blank">http://www.efficios.com</a></div></div></div></blockquote></div>