<div dir="ltr">Apologies, did not mean for the message to be private.<div><br></div><div>Thank you for all your assistance, for now I think compiling with the flag to disable cli is the way to go.</div><div><br></div><div>Regards,</div><div>Mosleh</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 3, 2019 at 4:00 PM Jonathan Rajotte-Julien <<a href="mailto:jonathan.rajotte-julien@efficios.com">jonathan.rajotte-julien@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>
<br>
I just saw this was a private email.<br>
<br>
As you will understand based on my previous email, this is slowly starting the<br>
be out of scope of our public support effort.<br>
<br>
Note that we do offer commercial support if it is something you would be<br>
interested in. You would be able to talk openly of the requirements, more<br>
importantly of the project you are working on and how to integrate lttng with<br>
it.<br>
<br>
Cheers<br>
<br>
On Wed, Apr 03, 2019 at 02:15:55PM -0400, Mosleh Uddin wrote:<br>
> I apologize, I will give the bigger picture of what I am trying to do.<br>
> <br>
> So the restraint I have is that I can't install lttng-tools and lttng-ust<br>
> libraries as part of the yocto build, mostly because we have release<br>
> software (for the public) and we don't want these CLI features available to<br>
> the public (if they were to somehow access the CLI).<br>
> <br>
> I have compiled a userspace application using the 'lttng-ust' compile flag<br>
> with lttng tracepoints distributed throughout the code. I am creating a<br>
> separate custom lttng application (compiled with lttng-ctl) which will<br>
> communicate with the application (via domain socket) in order to dictate<br>
> when to start/stop sessions. I want the this custom application to have the<br>
> ability to not only start/stop sessions but also spawn the session daemon.<br>
> <br>
> From my description, you see that the system we are building for will not<br>
> any have lttng libraries installed, I will be cross-compiling the<br>
> applications with the libraries that are needed. I know you said lttng-ctl<br>
> doesn't expose spawning sessiond, so I was curious how I could get this<br>
> functionality for my custom lttng application.<br>
> <br>
> Regards,<br>
> Mosleh<br>
> <br>
> On Wed, Apr 3, 2019 at 11:55 AM Jonathan Rajotte-Julien <<br>
> <a href="mailto:jonathan.rajotte-julien@efficios.com" target="_blank">jonathan.rajotte-julien@efficios.com</a>> wrote:<br>
> <br>
> > On Wed, Apr 03, 2019 at 11:04:19AM -0400, Mosleh Uddin wrote:<br>
> > > Hello,<br>
> > ><br>
> > > It is a limitation for both size and some security measures. We want to<br>
> > > ensure that we can set limits controlled by our custom application.<br>
> ><br>
> > What security measure? What limits? Unless you provide clear requirement<br>
> > it is<br>
> > quite hard to understand where you are going and how we can help you get<br>
> > there.<br>
> ><br>
> > ><br>
> > > For testing purposes, I did initially have lttng-tools and lttng-ust<br>
> > added<br>
> > > to the build image but again for the limitations described it cannot go<br>
> > > into the final 'production' rootfs. So it's nice that the service file<br>
> > > exists, but without the tools installed I do not think I can make use of<br>
> > > it, unless there is a way to strip out everything from lttng-tools except<br>
> > > for the sessiond functionality.<br>
> ><br>
> > Well the biggest part of lttng-tools project is lttng-sessiond and<br>
> > lttng-consumerd. If the cli is the problem you can pass<br>
> > "--disable-bin-lttng" at<br>
> > configure time to simply exclude it from being built and installed.<br>
> ><br>
> > As for lttng-sessiond executable, you can limit the user able to use it via<br>
> > regular user/group permissions.<br>
> ><br>
> > ><br>
> > > My guess from everything you are saying is that I will have to create a<br>
> > > custom method for spawning a session daemon without having lttng-tools<br>
> > > available, however I am unsure where to start.<br>
> ><br>
> > No, you will need lttng-tools (in the sense of the project, no the<br>
> > executable) to<br>
> > be present on the system if you want to trace at all.<br>
> ><br>
> > > From way lttng-tools does<br>
> > > it, I see it call the executable 'lttng-sessiond', but I cannot find a<br>
> > > reference to when or how that executable is getting built.<br>
> ><br>
> > Take a look at the src/bin folder (git tree). The "lttng" subfolder is<br>
> > only the<br>
> > CLI. The meat of lttng is lttng-sessiond/relayd/consumerd.<br>
> ><br>
> > ><br>
> > > Thanks again for quick responses.<br>
> > ><br>
> > > Regards,<br>
> > > Mosleh<br>
> > ><br>
> > ><br>
> > ><br>
> > > On Wed, Apr 3, 2019 at 10:25 AM Jonathan Rajotte-Julien <<br>
> > > <a href="mailto:jonathan.rajotte-julien@efficios.com" target="_blank">jonathan.rajotte-julien@efficios.com</a>> wrote:<br>
> > ><br>
> > > > On Wed, Apr 03, 2019 at 09:08:45AM -0400, Mosleh Uddin wrote:<br>
> > > > > Hello,<br>
> > > > ><br>
> > > > > Sorry, I should be more specific. I am creating a custom yocto<br>
> > build. I<br>
> > > > > have seen some examples where systemd is utilized to start the<br>
> > sessiond<br>
> > > > as<br>
> > > > > a service. The limitation I have is that I don't want to include the<br>
> > > > whole<br>
> > > > > lttng-tools librray in my build. I understand that the sessiond is an<br>
> > > ><br>
> > > > You will have to if you plan on tracing any applications on your<br>
> > resulting<br>
> > > > image. Why is it a limitation? Size constraint?<br>
> > > ><br>
> > > > lttng-tools is already part of OE-core (the meta/ layer). Use this<br>
> > recipe<br>
> > > > to<br>
> > > > build it [1] or as a base for a custom one.<br>
> > > ><br>
> > > > [1]<br>
> > > ><br>
> > <a href="https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-kernel/lttng/lttng-tools_2.10.6.bb" rel="noreferrer" target="_blank">https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-kernel/lttng/lttng-tools_2.10.6.bb</a><br>
> > > ><br>
> > > > You can add the following to your local.conf file to build only<br>
> > lttng-ust<br>
> > > > and<br>
> > > > lttng-tools.<br>
> > > ><br>
> > > > CORE_IMAGE_EXTRA_INSTALL += "lttng-ust lttng-tools"<br>
> > > > PACKAGECONFIG_pn-lttng-tools_append = " lttng-ust"<br>
> > > ><br>
> > > > By default a systemd service file is installed but is not activated<br>
> > (which<br>
> > > > seems<br>
> > > > to be what you want).<br>
> > > ><br>
> > > > Cheers<br>
> > > ><br>
> > > ><br>
> > > > > executable, I am just unsure how I could build or get this in my<br>
> > build.<br>
> > > > > Moving forward from this I could use fork/exec to daemonize which<br>
> > would<br>
> > > > be<br>
> > > > > simple.<br>
> > > > > Is there perhaps a existing recipe?<br>
> > > > ><br>
> > > > > Regards,<br>
> > > > > Mosleh<br>
> > > > ><br>
> > > > > On Tue, Apr 2, 2019 at 6:01 PM Mosleh Uddin <<a href="mailto:mosleh1235@gmail.com" target="_blank">mosleh1235@gmail.com</a>><br>
> > > > wrote:<br>
> > > > ><br>
> > > > > > Hi,<br>
> > > > > ><br>
> > > > > > That makes complete sense. I was more curious about the sessiond<br>
> > > > > > executable. I'm guessing this is something I will have to create<br>
> > along<br>
> > > > with<br>
> > > > > > my build?<br>
> > > > > ><br>
> > > > > > Regards,<br>
> > > > > > Mosleh<br>
> > > > > ><br>
> > > > > > On Tue, Apr 2, 2019 at 5:18 PM Jonathan Rajotte-Julien <<br>
> > > > > > <a href="mailto:jonathan.rajotte-julien@efficios.com" target="_blank">jonathan.rajotte-julien@efficios.com</a>> wrote:<br>
> > > > > ><br>
> > > > > >> On Tue, Apr 02, 2019 at 04:54:00PM -0400, Mosleh Uddin wrote:<br>
> > > > > >> > Hello,<br>
> > > > > >> ><br>
> > > > > >> > Could you give me some more insight into spawning my own<br>
> > sessiond?<br>
> > > > Sorry<br>
> > > > > >> > I'm not completely clear on the topic.<br>
> > > > > >> > Thank you for all your assistance.<br>
> > > > > >><br>
> > > > > >> Normally lttng-sessiond is treated as a "server/service/daemon"<br>
> > (think<br>
> > > > > >> http<br>
> > > > > >> server as apache) and is *normally* launched as a daemon<br>
> > > > > >> (systemd/sysVinit) at<br>
> > > > > >> boot time.<br>
> > > > > >><br>
> > > > > >> Managing manually the lifetime of a lttng-sessiond process is<br>
> > done the<br>
> > > > > >> same way<br>
> > > > > >> as any other process. You can manage it via the command line<br>
> > > > > >> (./lttng-sessiond), via a<br>
> > > > > >> service manager (systemd/upstart etc.) or with a custom service<br>
> > > > manager (a<br>
> > > > > >> python script/c etc.).<br>
> > > > > >><br>
> > > > > >> You could spawn a lttng-sessiond from your application with the<br>
> > > > > >> appropriate<br>
> > > > > >> parameters set to isolate it if you need. LTTNG_HOME is an<br>
> > important<br>
> > > > one.<br>
> > > > > >> The<br>
> > > > > >> output directory also can be manipulated. See man lttng-sessiond<br>
> > for<br>
> > > > more<br>
> > > > > >> details. You will need to manage the process or leave it to a<br>
> > system<br>
> > > > > >> administrator and only active tracing when a sessiond is present<br>
> > for<br>
> > > > > >> example.<br>
> > > > > >><br>
> > > > > >> Cheers<br>
> > > > > >><br>
> > > > > >> ><br>
> > > > > >> > Regards,<br>
> > > > > >> > Mosleh<br>
> > > > > >> ><br>
> > > > > >> > On Wed, Mar 27, 2019 at 1:52 PM Jonathan Rajotte-Julien <<br>
> > > > > >> > <a href="mailto:jonathan.rajotte-julien@efficios.com" target="_blank">jonathan.rajotte-julien@efficios.com</a>> wrote:<br>
> > > > > >> ><br>
> > > > > >> > > Hi Mosleh,<br>
> > > > > >> > ><br>
> > > > > >> > > On Wed, Mar 27, 2019 at 12:09:54PM -0400, Mosleh Uddin wrote:<br>
> > > > > >> > > > Hello,<br>
> > > > > >> > > ><br>
> > > > > >> > > > Thank you for the quick response. I was able to use the<br>
> > > > > >> documentation you<br>
> > > > > >> > > > provided to start a session and get tracepoint list. I do<br>
> > have<br>
> > > > some<br>
> > > > > >> > > > follow-up questions:<br>
> > > > > >> > > ><br>
> > > > > >> > > > 1) I needed to create a session daemon before executing my<br>
> > > > custom<br>
> > > > > >> > > > application. In the API I did see functionality to see if a<br>
> > > > daemon<br>
> > > > > >> is<br>
> > > > > >> > > > active, however, it is possible to spawn a session daemon<br>
> > in my<br>
> > > > > >> custom<br>
> > > > > >> > > app?<br>
> > > > > >> > ><br>
> > > > > >> > > liblttng-ctl does not expose a lttng-sessiond spawning<br>
> > function<br>
> > > > since<br>
> > > > > >> by<br>
> > > > > >> > > definition it is a daemon executable (think apache,mysql<br>
> > etc.),<br>
> > > > you<br>
> > > > > >> will<br>
> > > > > >> > > have to<br>
> > > > > >> > > use system/popen/exec.. to spawn the lttng-sessiond process<br>
> > etc.<br>
> > > > if<br>
> > > > > >> you<br>
> > > > > >> > > want to<br>
> > > > > >> > > control its lifetime using your custom application.<br>
> > > > > >> > ><br>
> > > > > >> > > ><br>
> > > > > >> > > > 2) I am able to get a list of active traces lttng can see in<br>
> > > > > >> userspace, I<br>
> > > > > >> > > > enable all the traces and start tracing. The traces however<br>
> > > > seem to<br>
> > > > > >> not<br>
> > > > > >> > > be<br>
> > > > > >> > > > written anywhere on my filesystem. Do I have to specify a<br>
> > > > location?<br>
> > > > > >> Or<br>
> > > > > >> > > am I<br>
> > > > > >> > > > missing something? My current flow is:<br>
> > > > > >> > ><br>
> > > > > >> > > Please refer to the create command. If outputting locally you<br>
> > will<br>
> > > > > >> need to<br>
> > > > > >> > > pass<br>
> > > > > >> > > a "file://...." url to lttng_create_session.<br>
> > > > > >> > ><br>
> > > > > >> > > You can check on the result for each steps using "lttng list"<br>
> > and<br>
> > > > > >> "lttng<br>
> > > > > >> > > list<br>
> > > > > >> > > <session_name>" as you go to troubleshot your setup script.<br>
> > > > > >> > ><br>
> > > > > >> > > While debugging you can also start the lttng-sessiond in<br>
> > verbose<br>
> > > > mode<br>
> > > > > >> to<br>
> > > > > >> > > understand what is going on.<br>
> > > > > >> > ><br>
> > > > > >> > > Also note that you could also use the lttng "load" api if the<br>
> > > > session<br>
> > > > > >> you<br>
> > > > > >> > > are<br>
> > > > > >> > > trying to load is "static" and always the same. You would only<br>
> > > > need to<br>
> > > > > >> > > ship an<br>
> > > > > >> > > xml file with your application.<br>
> > > > > >> > ><br>
> > > > > >> > > Cheers<br>
> > > > > >> > ><br>
> > > > > >> > > ><br>
> > > > > >> > > >    - Creating a session<br>
> > > > > >> > > >    - Specifying the domain<br>
> > > > > >> > > >    - Creating a handle<br>
> > > > > >> > > >    - Creating a channel (with default attributes)<br>
> > > > > >> > > >    - Enabling the channel<br>
> > > > > >> > > >    - Enabling event (for all traces)<br>
> > > > > >> > > >    - Start tracing<br>
> > > > > >> > > ><br>
> > > > > >> > > > Thanks again for all the assistance.<br>
> > > > > >> > > ><br>
> > > > > >> > > > Regards,<br>
> > > > > >> > > > Mosleh<br>
> > > > > >> > > ><br>
> > > > > >> > > > On Tue, Mar 26, 2019 at 11:29 AM Jonathan Rajotte-Julien <<br>
> > > > > >> > > > <a href="mailto:jonathan.rajotte-julien@efficios.com" target="_blank">jonathan.rajotte-julien@efficios.com</a>> wrote:<br>
> > > > > >> > > ><br>
> > > > > >> > ><br>
> > > > > >><br>
> > > > > >> --<br>
> > > > > >> Jonathan Rajotte-Julien<br>
> > > > > >> EfficiOS<br>
> > > > > >><br>
> > > > > ><br>
> > > ><br>
> > > > --<br>
> > > > Jonathan Rajotte-Julien<br>
> > > > EfficiOS<br>
> > > ><br>
> ><br>
> > --<br>
> > Jonathan Rajotte-Julien<br>
> > EfficiOS<br>
> ><br>
<br>
-- <br>
Jonathan Rajotte-Julien<br>
EfficiOS<br>
</blockquote></div>