All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Creating custom application
       [not found] <CAJyWpKHE_4eZwMAhU-q4sbAAA3-nPWgxtGqpXYLpMyztNzmm-w@mail.gmail.com>
@ 2019-03-26 15:29 ` Jonathan Rajotte-Julien
       [not found] ` <20190326152942.GE17481@joraj-alpa>
  1 sibling, 0 replies; 12+ messages in thread
From: Jonathan Rajotte-Julien @ 2019-03-26 15:29 UTC (permalink / raw)
  To: Mosleh Uddin; +Cc: lttng-dev

Hi Mosleh,

On Tue, Mar 26, 2019 at 11:11:41AM -0400, Mosleh Uddin wrote:
> Hi all,
> 
> I am working with an embedded system and for security purposes I don't
> necessarily want the user to have the ability to execute lttng commands
> (lttng-sessiond, lttng create, etc.). In order to create a session/start I
> am creating a custom application which will communicate through my
> application via a socket. This way my application only control lttng
> functionalities.
> 
> I was wondering if you guys can direct me to some documentation where I can
> understand how I can approach creating a session and implementing the
> functionalities that commands like (lttng-sessiond, lttng create and lttng
> start) provide. Thank you for any information.

Note that lttng-sessiond can be started with a specific group id for "control"
purpose that allow only users of the group to control it. From there you could
have a simple popen based custom application that run the cli client. There are
multiple ways to achieve what you are looking for.

We also expose an API/lib (liblttng-ctl) to talk to the sessiond [1].

The best documentation on how to use this API is the headers [1] and the command
line client implementation [3].

[1] https://github.com/lttng/lttng-tools/tree/master/include/lttng
[2] https://github.com/lttng/lttng-tools/tree/master/src/bin/lttng
    https://github.com/lttng/lttng-tools/tree/master/src/bin/lttng/commands

Let us know how it goes.

Cheers

-- 
Jonathan Rajotte-Julien
EfficiOS

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

* Re: Creating custom application
       [not found] ` <20190326152942.GE17481@joraj-alpa>
@ 2019-03-27 16:09   ` Mosleh Uddin
       [not found]   ` <CAJyWpKHtXHAgyjwZVnSCnnDTmCsOVsydaZgqpMuALQWMy5nfiA@mail.gmail.com>
  1 sibling, 0 replies; 12+ messages in thread
From: Mosleh Uddin @ 2019-03-27 16:09 UTC (permalink / raw)
  To: Jonathan Rajotte-Julien; +Cc: lttng-dev


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

Hello,

Thank you for the quick response. I was able to use the documentation you
provided to start a session and get tracepoint list. I do have some
follow-up questions:

1) I needed to create a session daemon before executing my custom
application. In the API I did see functionality to see if a daemon is
active, however, it is possible to spawn a session daemon in my custom app?

2) I am able to get a list of active traces lttng can see in userspace, I
enable all the traces and start tracing. The traces however seem to not be
written anywhere on my filesystem. Do I have to specify a location? Or am I
missing something? My current flow is:

   - Creating a session
   - Specifying the domain
   - Creating a handle
   - Creating a channel (with default attributes)
   - Enabling the channel
   - Enabling event (for all traces)
   - Start tracing

Thanks again for all the assistance.

Regards,
Mosleh

On Tue, Mar 26, 2019 at 11:29 AM Jonathan Rajotte-Julien <
jonathan.rajotte-julien@efficios.com> wrote:

> Hi Mosleh,
>
> On Tue, Mar 26, 2019 at 11:11:41AM -0400, Mosleh Uddin wrote:
> > Hi all,
> >
> > I am working with an embedded system and for security purposes I don't
> > necessarily want the user to have the ability to execute lttng commands
> > (lttng-sessiond, lttng create, etc.). In order to create a session/start
> I
> > am creating a custom application which will communicate through my
> > application via a socket. This way my application only control lttng
> > functionalities.
> >
> > I was wondering if you guys can direct me to some documentation where I
> can
> > understand how I can approach creating a session and implementing the
> > functionalities that commands like (lttng-sessiond, lttng create and
> lttng
> > start) provide. Thank you for any information.
>
> Note that lttng-sessiond can be started with a specific group id for
> "control"
> purpose that allow only users of the group to control it. From there you
> could
> have a simple popen based custom application that run the cli client.
> There are
> multiple ways to achieve what you are looking for.
>
> We also expose an API/lib (liblttng-ctl) to talk to the sessiond [1].
>
> The best documentation on how to use this API is the headers [1] and the
> command
> line client implementation [3].
>
> [1] https://github.com/lttng/lttng-tools/tree/master/include/lttng
> [2] https://github.com/lttng/lttng-tools/tree/master/src/bin/lttng
>
> https://github.com/lttng/lttng-tools/tree/master/src/bin/lttng/commands
>
> Let us know how it goes.
>
> Cheers
>
> --
> Jonathan Rajotte-Julien
> EfficiOS
>

[-- Attachment #1.2: Type: text/html, Size: 3558 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] 12+ messages in thread

* Re: Creating custom application
       [not found]   ` <CAJyWpKHtXHAgyjwZVnSCnnDTmCsOVsydaZgqpMuALQWMy5nfiA@mail.gmail.com>
@ 2019-03-27 17:52     ` Jonathan Rajotte-Julien
       [not found]     ` <20190327175251.GA7976@joraj-alpa>
  1 sibling, 0 replies; 12+ messages in thread
From: Jonathan Rajotte-Julien @ 2019-03-27 17:52 UTC (permalink / raw)
  To: Mosleh Uddin; +Cc: lttng-dev

Hi Mosleh,

On Wed, Mar 27, 2019 at 12:09:54PM -0400, Mosleh Uddin wrote:
> Hello,
> 
> Thank you for the quick response. I was able to use the documentation you
> provided to start a session and get tracepoint list. I do have some
> follow-up questions:
> 
> 1) I needed to create a session daemon before executing my custom
> application. In the API I did see functionality to see if a daemon is
> active, however, it is possible to spawn a session daemon in my custom app?

liblttng-ctl does not expose a lttng-sessiond spawning function since by
definition it is a daemon executable (think apache,mysql etc.), you will have to
use system/popen/exec.. to spawn the lttng-sessiond process etc. if you want to
control its lifetime using your custom application.

> 
> 2) I am able to get a list of active traces lttng can see in userspace, I
> enable all the traces and start tracing. The traces however seem to not be
> written anywhere on my filesystem. Do I have to specify a location? Or am I
> missing something? My current flow is:

Please refer to the create command. If outputting locally you will need to pass
a "file://...." url to lttng_create_session.

You can check on the result for each steps using "lttng list" and "lttng list
<session_name>" as you go to troubleshot your setup script.

While debugging you can also start the lttng-sessiond in verbose mode to
understand what is going on.

Also note that you could also use the lttng "load" api if the session you are
trying to load is "static" and always the same. You would only need to ship an
xml file with your application.

Cheers

> 
>    - Creating a session
>    - Specifying the domain
>    - Creating a handle
>    - Creating a channel (with default attributes)
>    - Enabling the channel
>    - Enabling event (for all traces)
>    - Start tracing
> 
> Thanks again for all the assistance.
> 
> Regards,
> Mosleh
> 
> On Tue, Mar 26, 2019 at 11:29 AM Jonathan Rajotte-Julien <
> jonathan.rajotte-julien@efficios.com> wrote:
> 

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

* Re: Creating custom application
       [not found]     ` <20190327175251.GA7976@joraj-alpa>
@ 2019-04-02 20:54       ` Mosleh Uddin
       [not found]       ` <CAJyWpKEhLdREuCFJEfSojHuqQ9jTA12SWE_FAJ3HTdP1irO-sw@mail.gmail.com>
  1 sibling, 0 replies; 12+ messages in thread
From: Mosleh Uddin @ 2019-04-02 20:54 UTC (permalink / raw)
  To: Jonathan Rajotte-Julien; +Cc: lttng-dev


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

Hello,

Could you give me some more insight into spawning my own sessiond? Sorry
I'm not completely clear on the topic.
Thank you for all your assistance.

Regards,
Mosleh

On Wed, Mar 27, 2019 at 1:52 PM Jonathan Rajotte-Julien <
jonathan.rajotte-julien@efficios.com> wrote:

> Hi Mosleh,
>
> On Wed, Mar 27, 2019 at 12:09:54PM -0400, Mosleh Uddin wrote:
> > Hello,
> >
> > Thank you for the quick response. I was able to use the documentation you
> > provided to start a session and get tracepoint list. I do have some
> > follow-up questions:
> >
> > 1) I needed to create a session daemon before executing my custom
> > application. In the API I did see functionality to see if a daemon is
> > active, however, it is possible to spawn a session daemon in my custom
> app?
>
> liblttng-ctl does not expose a lttng-sessiond spawning function since by
> definition it is a daemon executable (think apache,mysql etc.), you will
> have to
> use system/popen/exec.. to spawn the lttng-sessiond process etc. if you
> want to
> control its lifetime using your custom application.
>
> >
> > 2) I am able to get a list of active traces lttng can see in userspace, I
> > enable all the traces and start tracing. The traces however seem to not
> be
> > written anywhere on my filesystem. Do I have to specify a location? Or
> am I
> > missing something? My current flow is:
>
> Please refer to the create command. If outputting locally you will need to
> pass
> a "file://...." url to lttng_create_session.
>
> You can check on the result for each steps using "lttng list" and "lttng
> list
> <session_name>" as you go to troubleshot your setup script.
>
> While debugging you can also start the lttng-sessiond in verbose mode to
> understand what is going on.
>
> Also note that you could also use the lttng "load" api if the session you
> are
> trying to load is "static" and always the same. You would only need to
> ship an
> xml file with your application.
>
> Cheers
>
> >
> >    - Creating a session
> >    - Specifying the domain
> >    - Creating a handle
> >    - Creating a channel (with default attributes)
> >    - Enabling the channel
> >    - Enabling event (for all traces)
> >    - Start tracing
> >
> > Thanks again for all the assistance.
> >
> > Regards,
> > Mosleh
> >
> > On Tue, Mar 26, 2019 at 11:29 AM Jonathan Rajotte-Julien <
> > jonathan.rajotte-julien@efficios.com> wrote:
> >
>

[-- Attachment #1.2: Type: text/html, Size: 3175 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] 12+ messages in thread

* Re: Creating custom application
       [not found]       ` <CAJyWpKEhLdREuCFJEfSojHuqQ9jTA12SWE_FAJ3HTdP1irO-sw@mail.gmail.com>
@ 2019-04-02 21:18         ` Jonathan Rajotte-Julien
       [not found]         ` <20190402211757.GA23381@joraj-alpa>
  1 sibling, 0 replies; 12+ messages in thread
From: Jonathan Rajotte-Julien @ 2019-04-02 21:18 UTC (permalink / raw)
  To: Mosleh Uddin; +Cc: lttng-dev

On Tue, Apr 02, 2019 at 04:54:00PM -0400, Mosleh Uddin wrote:
> Hello,
> 
> Could you give me some more insight into spawning my own sessiond? Sorry
> I'm not completely clear on the topic.
> Thank you for all your assistance.

Normally lttng-sessiond is treated as a "server/service/daemon" (think http
server as apache) and is *normally* launched as a daemon (systemd/sysVinit) at
boot time.

Managing manually the lifetime of a lttng-sessiond process is done the same way
as any other process. You can manage it via the command line (./lttng-sessiond), via a
service manager (systemd/upstart etc.) or with a custom service manager (a
python script/c etc.).

You could spawn a lttng-sessiond from your application with the appropriate
parameters set to isolate it if you need. LTTNG_HOME is an important one. The
output directory also can be manipulated. See man lttng-sessiond for more
details. You will need to manage the process or leave it to a system
administrator and only active tracing when a sessiond is present for example.

Cheers

> 
> Regards,
> Mosleh
> 
> On Wed, Mar 27, 2019 at 1:52 PM Jonathan Rajotte-Julien <
> jonathan.rajotte-julien@efficios.com> wrote:
> 
> > Hi Mosleh,
> >
> > On Wed, Mar 27, 2019 at 12:09:54PM -0400, Mosleh Uddin wrote:
> > > Hello,
> > >
> > > Thank you for the quick response. I was able to use the documentation you
> > > provided to start a session and get tracepoint list. I do have some
> > > follow-up questions:
> > >
> > > 1) I needed to create a session daemon before executing my custom
> > > application. In the API I did see functionality to see if a daemon is
> > > active, however, it is possible to spawn a session daemon in my custom
> > app?
> >
> > liblttng-ctl does not expose a lttng-sessiond spawning function since by
> > definition it is a daemon executable (think apache,mysql etc.), you will
> > have to
> > use system/popen/exec.. to spawn the lttng-sessiond process etc. if you
> > want to
> > control its lifetime using your custom application.
> >
> > >
> > > 2) I am able to get a list of active traces lttng can see in userspace, I
> > > enable all the traces and start tracing. The traces however seem to not
> > be
> > > written anywhere on my filesystem. Do I have to specify a location? Or
> > am I
> > > missing something? My current flow is:
> >
> > Please refer to the create command. If outputting locally you will need to
> > pass
> > a "file://...." url to lttng_create_session.
> >
> > You can check on the result for each steps using "lttng list" and "lttng
> > list
> > <session_name>" as you go to troubleshot your setup script.
> >
> > While debugging you can also start the lttng-sessiond in verbose mode to
> > understand what is going on.
> >
> > Also note that you could also use the lttng "load" api if the session you
> > are
> > trying to load is "static" and always the same. You would only need to
> > ship an
> > xml file with your application.
> >
> > Cheers
> >
> > >
> > >    - Creating a session
> > >    - Specifying the domain
> > >    - Creating a handle
> > >    - Creating a channel (with default attributes)
> > >    - Enabling the channel
> > >    - Enabling event (for all traces)
> > >    - Start tracing
> > >
> > > Thanks again for all the assistance.
> > >
> > > Regards,
> > > Mosleh
> > >
> > > On Tue, Mar 26, 2019 at 11:29 AM Jonathan Rajotte-Julien <
> > > jonathan.rajotte-julien@efficios.com> wrote:
> > >
> >

-- 
Jonathan Rajotte-Julien
EfficiOS

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

* Re: Creating custom application
       [not found]         ` <20190402211757.GA23381@joraj-alpa>
@ 2019-04-02 22:01           ` Mosleh Uddin
       [not found]           ` <CAJyWpKGDrF9J=yDALm+1cn7cTd+TJZK30tXLHKKKXvkntmQDoQ@mail.gmail.com>
  1 sibling, 0 replies; 12+ messages in thread
From: Mosleh Uddin @ 2019-04-02 22:01 UTC (permalink / raw)
  To: Jonathan Rajotte-Julien; +Cc: lttng-dev


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

Hi,

That makes complete sense. I was more curious about the sessiond
executable. I'm guessing this is something I will have to create along with
my build?

Regards,
Mosleh

On Tue, Apr 2, 2019 at 5:18 PM Jonathan Rajotte-Julien <
jonathan.rajotte-julien@efficios.com> wrote:

> On Tue, Apr 02, 2019 at 04:54:00PM -0400, Mosleh Uddin wrote:
> > Hello,
> >
> > Could you give me some more insight into spawning my own sessiond? Sorry
> > I'm not completely clear on the topic.
> > Thank you for all your assistance.
>
> Normally lttng-sessiond is treated as a "server/service/daemon" (think http
> server as apache) and is *normally* launched as a daemon
> (systemd/sysVinit) at
> boot time.
>
> Managing manually the lifetime of a lttng-sessiond process is done the
> same way
> as any other process. You can manage it via the command line
> (./lttng-sessiond), via a
> service manager (systemd/upstart etc.) or with a custom service manager (a
> python script/c etc.).
>
> You could spawn a lttng-sessiond from your application with the appropriate
> parameters set to isolate it if you need. LTTNG_HOME is an important one.
> The
> output directory also can be manipulated. See man lttng-sessiond for more
> details. You will need to manage the process or leave it to a system
> administrator and only active tracing when a sessiond is present for
> example.
>
> Cheers
>
> >
> > Regards,
> > Mosleh
> >
> > On Wed, Mar 27, 2019 at 1:52 PM Jonathan Rajotte-Julien <
> > jonathan.rajotte-julien@efficios.com> wrote:
> >
> > > Hi Mosleh,
> > >
> > > On Wed, Mar 27, 2019 at 12:09:54PM -0400, Mosleh Uddin wrote:
> > > > Hello,
> > > >
> > > > Thank you for the quick response. I was able to use the
> documentation you
> > > > provided to start a session and get tracepoint list. I do have some
> > > > follow-up questions:
> > > >
> > > > 1) I needed to create a session daemon before executing my custom
> > > > application. In the API I did see functionality to see if a daemon is
> > > > active, however, it is possible to spawn a session daemon in my
> custom
> > > app?
> > >
> > > liblttng-ctl does not expose a lttng-sessiond spawning function since
> by
> > > definition it is a daemon executable (think apache,mysql etc.), you
> will
> > > have to
> > > use system/popen/exec.. to spawn the lttng-sessiond process etc. if you
> > > want to
> > > control its lifetime using your custom application.
> > >
> > > >
> > > > 2) I am able to get a list of active traces lttng can see in
> userspace, I
> > > > enable all the traces and start tracing. The traces however seem to
> not
> > > be
> > > > written anywhere on my filesystem. Do I have to specify a location?
> Or
> > > am I
> > > > missing something? My current flow is:
> > >
> > > Please refer to the create command. If outputting locally you will
> need to
> > > pass
> > > a "file://...." url to lttng_create_session.
> > >
> > > You can check on the result for each steps using "lttng list" and
> "lttng
> > > list
> > > <session_name>" as you go to troubleshot your setup script.
> > >
> > > While debugging you can also start the lttng-sessiond in verbose mode
> to
> > > understand what is going on.
> > >
> > > Also note that you could also use the lttng "load" api if the session
> you
> > > are
> > > trying to load is "static" and always the same. You would only need to
> > > ship an
> > > xml file with your application.
> > >
> > > Cheers
> > >
> > > >
> > > >    - Creating a session
> > > >    - Specifying the domain
> > > >    - Creating a handle
> > > >    - Creating a channel (with default attributes)
> > > >    - Enabling the channel
> > > >    - Enabling event (for all traces)
> > > >    - Start tracing
> > > >
> > > > Thanks again for all the assistance.
> > > >
> > > > Regards,
> > > > Mosleh
> > > >
> > > > On Tue, Mar 26, 2019 at 11:29 AM Jonathan Rajotte-Julien <
> > > > jonathan.rajotte-julien@efficios.com> wrote:
> > > >
> > >
>
> --
> Jonathan Rajotte-Julien
> EfficiOS
>

[-- Attachment #1.2: Type: text/html, Size: 5384 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] 12+ messages in thread

* Re: Creating custom application
       [not found]           ` <CAJyWpKGDrF9J=yDALm+1cn7cTd+TJZK30tXLHKKKXvkntmQDoQ@mail.gmail.com>
@ 2019-04-03 13:08             ` Mosleh Uddin
       [not found]             ` <CAJyWpKFxRqsVYc=dDvaoTMGkrkLmktaudYJgvVkzzvUyeFx-NQ@mail.gmail.com>
  1 sibling, 0 replies; 12+ messages in thread
From: Mosleh Uddin @ 2019-04-03 13:08 UTC (permalink / raw)
  To: Jonathan Rajotte-Julien; +Cc: lttng-dev


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

Hello,

Sorry, I should be more specific. I am creating a custom yocto build. I
have seen some examples where systemd is utilized to start the sessiond as
a service. The limitation I have is that I don't want to include the whole
lttng-tools librray in my build. I understand that the sessiond is an
executable, I am just unsure how I could build or get this in my build.
Moving forward from this I could use fork/exec to daemonize which would be
simple.
Is there perhaps a existing recipe?

Regards,
Mosleh

On Tue, Apr 2, 2019 at 6:01 PM Mosleh Uddin <mosleh1235@gmail.com> wrote:

> Hi,
>
> That makes complete sense. I was more curious about the sessiond
> executable. I'm guessing this is something I will have to create along with
> my build?
>
> Regards,
> Mosleh
>
> On Tue, Apr 2, 2019 at 5:18 PM Jonathan Rajotte-Julien <
> jonathan.rajotte-julien@efficios.com> wrote:
>
>> On Tue, Apr 02, 2019 at 04:54:00PM -0400, Mosleh Uddin wrote:
>> > Hello,
>> >
>> > Could you give me some more insight into spawning my own sessiond? Sorry
>> > I'm not completely clear on the topic.
>> > Thank you for all your assistance.
>>
>> Normally lttng-sessiond is treated as a "server/service/daemon" (think
>> http
>> server as apache) and is *normally* launched as a daemon
>> (systemd/sysVinit) at
>> boot time.
>>
>> Managing manually the lifetime of a lttng-sessiond process is done the
>> same way
>> as any other process. You can manage it via the command line
>> (./lttng-sessiond), via a
>> service manager (systemd/upstart etc.) or with a custom service manager (a
>> python script/c etc.).
>>
>> You could spawn a lttng-sessiond from your application with the
>> appropriate
>> parameters set to isolate it if you need. LTTNG_HOME is an important one.
>> The
>> output directory also can be manipulated. See man lttng-sessiond for more
>> details. You will need to manage the process or leave it to a system
>> administrator and only active tracing when a sessiond is present for
>> example.
>>
>> Cheers
>>
>> >
>> > Regards,
>> > Mosleh
>> >
>> > On Wed, Mar 27, 2019 at 1:52 PM Jonathan Rajotte-Julien <
>> > jonathan.rajotte-julien@efficios.com> wrote:
>> >
>> > > Hi Mosleh,
>> > >
>> > > On Wed, Mar 27, 2019 at 12:09:54PM -0400, Mosleh Uddin wrote:
>> > > > Hello,
>> > > >
>> > > > Thank you for the quick response. I was able to use the
>> documentation you
>> > > > provided to start a session and get tracepoint list. I do have some
>> > > > follow-up questions:
>> > > >
>> > > > 1) I needed to create a session daemon before executing my custom
>> > > > application. In the API I did see functionality to see if a daemon
>> is
>> > > > active, however, it is possible to spawn a session daemon in my
>> custom
>> > > app?
>> > >
>> > > liblttng-ctl does not expose a lttng-sessiond spawning function since
>> by
>> > > definition it is a daemon executable (think apache,mysql etc.), you
>> will
>> > > have to
>> > > use system/popen/exec.. to spawn the lttng-sessiond process etc. if
>> you
>> > > want to
>> > > control its lifetime using your custom application.
>> > >
>> > > >
>> > > > 2) I am able to get a list of active traces lttng can see in
>> userspace, I
>> > > > enable all the traces and start tracing. The traces however seem to
>> not
>> > > be
>> > > > written anywhere on my filesystem. Do I have to specify a location?
>> Or
>> > > am I
>> > > > missing something? My current flow is:
>> > >
>> > > Please refer to the create command. If outputting locally you will
>> need to
>> > > pass
>> > > a "file://...." url to lttng_create_session.
>> > >
>> > > You can check on the result for each steps using "lttng list" and
>> "lttng
>> > > list
>> > > <session_name>" as you go to troubleshot your setup script.
>> > >
>> > > While debugging you can also start the lttng-sessiond in verbose mode
>> to
>> > > understand what is going on.
>> > >
>> > > Also note that you could also use the lttng "load" api if the session
>> you
>> > > are
>> > > trying to load is "static" and always the same. You would only need to
>> > > ship an
>> > > xml file with your application.
>> > >
>> > > Cheers
>> > >
>> > > >
>> > > >    - Creating a session
>> > > >    - Specifying the domain
>> > > >    - Creating a handle
>> > > >    - Creating a channel (with default attributes)
>> > > >    - Enabling the channel
>> > > >    - Enabling event (for all traces)
>> > > >    - Start tracing
>> > > >
>> > > > Thanks again for all the assistance.
>> > > >
>> > > > Regards,
>> > > > Mosleh
>> > > >
>> > > > On Tue, Mar 26, 2019 at 11:29 AM Jonathan Rajotte-Julien <
>> > > > jonathan.rajotte-julien@efficios.com> wrote:
>> > > >
>> > >
>>
>> --
>> Jonathan Rajotte-Julien
>> EfficiOS
>>
>

[-- Attachment #1.2: Type: text/html, Size: 6338 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] 12+ messages in thread

* Re: Creating custom application
       [not found]             ` <CAJyWpKFxRqsVYc=dDvaoTMGkrkLmktaudYJgvVkzzvUyeFx-NQ@mail.gmail.com>
@ 2019-04-03 14:25               ` Jonathan Rajotte-Julien
       [not found]               ` <20190403142514.GB23381@joraj-alpa>
  1 sibling, 0 replies; 12+ messages in thread
From: Jonathan Rajotte-Julien @ 2019-04-03 14:25 UTC (permalink / raw)
  To: Mosleh Uddin; +Cc: lttng-dev

On Wed, Apr 03, 2019 at 09:08:45AM -0400, Mosleh Uddin wrote:
> Hello,
> 
> Sorry, I should be more specific. I am creating a custom yocto build. I
> have seen some examples where systemd is utilized to start the sessiond as
> a service. The limitation I have is that I don't want to include the whole
> lttng-tools librray in my build. I understand that the sessiond is an

You will have to if you plan on tracing any applications on your resulting
image. Why is it a limitation? Size constraint?

lttng-tools is already part of OE-core (the meta/ layer). Use this recipe to
build it [1] or as a base for a custom one.

[1] https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-kernel/lttng/lttng-tools_2.10.6.bb

You can add the following to your local.conf file to build only lttng-ust and
lttng-tools.

CORE_IMAGE_EXTRA_INSTALL += "lttng-ust lttng-tools"
PACKAGECONFIG_pn-lttng-tools_append = " lttng-ust"

By default a systemd service file is installed but is not activated (which seems
to be what you want).

Cheers


> executable, I am just unsure how I could build or get this in my build.
> Moving forward from this I could use fork/exec to daemonize which would be
> simple.
> Is there perhaps a existing recipe?
> 
> Regards,
> Mosleh
> 
> On Tue, Apr 2, 2019 at 6:01 PM Mosleh Uddin <mosleh1235@gmail.com> wrote:
> 
> > Hi,
> >
> > That makes complete sense. I was more curious about the sessiond
> > executable. I'm guessing this is something I will have to create along with
> > my build?
> >
> > Regards,
> > Mosleh
> >
> > On Tue, Apr 2, 2019 at 5:18 PM Jonathan Rajotte-Julien <
> > jonathan.rajotte-julien@efficios.com> wrote:
> >
> >> On Tue, Apr 02, 2019 at 04:54:00PM -0400, Mosleh Uddin wrote:
> >> > Hello,
> >> >
> >> > Could you give me some more insight into spawning my own sessiond? Sorry
> >> > I'm not completely clear on the topic.
> >> > Thank you for all your assistance.
> >>
> >> Normally lttng-sessiond is treated as a "server/service/daemon" (think
> >> http
> >> server as apache) and is *normally* launched as a daemon
> >> (systemd/sysVinit) at
> >> boot time.
> >>
> >> Managing manually the lifetime of a lttng-sessiond process is done the
> >> same way
> >> as any other process. You can manage it via the command line
> >> (./lttng-sessiond), via a
> >> service manager (systemd/upstart etc.) or with a custom service manager (a
> >> python script/c etc.).
> >>
> >> You could spawn a lttng-sessiond from your application with the
> >> appropriate
> >> parameters set to isolate it if you need. LTTNG_HOME is an important one.
> >> The
> >> output directory also can be manipulated. See man lttng-sessiond for more
> >> details. You will need to manage the process or leave it to a system
> >> administrator and only active tracing when a sessiond is present for
> >> example.
> >>
> >> Cheers
> >>
> >> >
> >> > Regards,
> >> > Mosleh
> >> >
> >> > On Wed, Mar 27, 2019 at 1:52 PM Jonathan Rajotte-Julien <
> >> > jonathan.rajotte-julien@efficios.com> wrote:
> >> >
> >> > > Hi Mosleh,
> >> > >
> >> > > On Wed, Mar 27, 2019 at 12:09:54PM -0400, Mosleh Uddin wrote:
> >> > > > Hello,
> >> > > >
> >> > > > Thank you for the quick response. I was able to use the
> >> documentation you
> >> > > > provided to start a session and get tracepoint list. I do have some
> >> > > > follow-up questions:
> >> > > >
> >> > > > 1) I needed to create a session daemon before executing my custom
> >> > > > application. In the API I did see functionality to see if a daemon
> >> is
> >> > > > active, however, it is possible to spawn a session daemon in my
> >> custom
> >> > > app?
> >> > >
> >> > > liblttng-ctl does not expose a lttng-sessiond spawning function since
> >> by
> >> > > definition it is a daemon executable (think apache,mysql etc.), you
> >> will
> >> > > have to
> >> > > use system/popen/exec.. to spawn the lttng-sessiond process etc. if
> >> you
> >> > > want to
> >> > > control its lifetime using your custom application.
> >> > >
> >> > > >
> >> > > > 2) I am able to get a list of active traces lttng can see in
> >> userspace, I
> >> > > > enable all the traces and start tracing. The traces however seem to
> >> not
> >> > > be
> >> > > > written anywhere on my filesystem. Do I have to specify a location?
> >> Or
> >> > > am I
> >> > > > missing something? My current flow is:
> >> > >
> >> > > Please refer to the create command. If outputting locally you will
> >> need to
> >> > > pass
> >> > > a "file://...." url to lttng_create_session.
> >> > >
> >> > > You can check on the result for each steps using "lttng list" and
> >> "lttng
> >> > > list
> >> > > <session_name>" as you go to troubleshot your setup script.
> >> > >
> >> > > While debugging you can also start the lttng-sessiond in verbose mode
> >> to
> >> > > understand what is going on.
> >> > >
> >> > > Also note that you could also use the lttng "load" api if the session
> >> you
> >> > > are
> >> > > trying to load is "static" and always the same. You would only need to
> >> > > ship an
> >> > > xml file with your application.
> >> > >
> >> > > Cheers
> >> > >
> >> > > >
> >> > > >    - Creating a session
> >> > > >    - Specifying the domain
> >> > > >    - Creating a handle
> >> > > >    - Creating a channel (with default attributes)
> >> > > >    - Enabling the channel
> >> > > >    - Enabling event (for all traces)
> >> > > >    - Start tracing
> >> > > >
> >> > > > Thanks again for all the assistance.
> >> > > >
> >> > > > Regards,
> >> > > > Mosleh
> >> > > >
> >> > > > On Tue, Mar 26, 2019 at 11:29 AM Jonathan Rajotte-Julien <
> >> > > > jonathan.rajotte-julien@efficios.com> wrote:
> >> > > >
> >> > >
> >>
> >> --
> >> Jonathan Rajotte-Julien
> >> EfficiOS
> >>
> >

-- 
Jonathan Rajotte-Julien
EfficiOS

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

* Re: Creating custom application
       [not found]               ` <20190403142514.GB23381@joraj-alpa>
@ 2019-04-03 15:04                 ` Mosleh Uddin
       [not found]                 ` <CAJyWpKGTZTKELQxb_XfnEhEjzMmSWe6oarR_XgS-9qmkoKfvNA@mail.gmail.com>
  1 sibling, 0 replies; 12+ messages in thread
From: Mosleh Uddin @ 2019-04-03 15:04 UTC (permalink / raw)
  To: Jonathan Rajotte-Julien; +Cc: lttng-dev


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

Hello,

It is a limitation for both size and some security measures. We want to
ensure that we can set limits controlled by our custom application.

For testing purposes, I did initially have lttng-tools and lttng-ust added
to the build image but again for the limitations described it cannot go
into the final 'production' rootfs. So it's nice that the service file
exists, but without the tools installed I do not think I can make use of
it, unless there is a way to strip out everything from lttng-tools except
for the sessiond functionality.

My guess from everything you are saying is that I will have to create a
custom method for spawning a session daemon without having lttng-tools
available, however I am unsure where to start. From way lttng-tools does
it, I see it call the executable 'lttng-sessiond', but I cannot find a
reference to when or how that executable is getting built.

Thanks again for quick responses.

Regards,
Mosleh



On Wed, Apr 3, 2019 at 10:25 AM Jonathan Rajotte-Julien <
jonathan.rajotte-julien@efficios.com> wrote:

> On Wed, Apr 03, 2019 at 09:08:45AM -0400, Mosleh Uddin wrote:
> > Hello,
> >
> > Sorry, I should be more specific. I am creating a custom yocto build. I
> > have seen some examples where systemd is utilized to start the sessiond
> as
> > a service. The limitation I have is that I don't want to include the
> whole
> > lttng-tools librray in my build. I understand that the sessiond is an
>
> You will have to if you plan on tracing any applications on your resulting
> image. Why is it a limitation? Size constraint?
>
> lttng-tools is already part of OE-core (the meta/ layer). Use this recipe
> to
> build it [1] or as a base for a custom one.
>
> [1]
> https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-kernel/lttng/lttng-tools_2.10.6.bb
>
> You can add the following to your local.conf file to build only lttng-ust
> and
> lttng-tools.
>
> CORE_IMAGE_EXTRA_INSTALL += "lttng-ust lttng-tools"
> PACKAGECONFIG_pn-lttng-tools_append = " lttng-ust"
>
> By default a systemd service file is installed but is not activated (which
> seems
> to be what you want).
>
> Cheers
>
>
> > executable, I am just unsure how I could build or get this in my build.
> > Moving forward from this I could use fork/exec to daemonize which would
> be
> > simple.
> > Is there perhaps a existing recipe?
> >
> > Regards,
> > Mosleh
> >
> > On Tue, Apr 2, 2019 at 6:01 PM Mosleh Uddin <mosleh1235@gmail.com>
> wrote:
> >
> > > Hi,
> > >
> > > That makes complete sense. I was more curious about the sessiond
> > > executable. I'm guessing this is something I will have to create along
> with
> > > my build?
> > >
> > > Regards,
> > > Mosleh
> > >
> > > On Tue, Apr 2, 2019 at 5:18 PM Jonathan Rajotte-Julien <
> > > jonathan.rajotte-julien@efficios.com> wrote:
> > >
> > >> On Tue, Apr 02, 2019 at 04:54:00PM -0400, Mosleh Uddin wrote:
> > >> > Hello,
> > >> >
> > >> > Could you give me some more insight into spawning my own sessiond?
> Sorry
> > >> > I'm not completely clear on the topic.
> > >> > Thank you for all your assistance.
> > >>
> > >> Normally lttng-sessiond is treated as a "server/service/daemon" (think
> > >> http
> > >> server as apache) and is *normally* launched as a daemon
> > >> (systemd/sysVinit) at
> > >> boot time.
> > >>
> > >> Managing manually the lifetime of a lttng-sessiond process is done the
> > >> same way
> > >> as any other process. You can manage it via the command line
> > >> (./lttng-sessiond), via a
> > >> service manager (systemd/upstart etc.) or with a custom service
> manager (a
> > >> python script/c etc.).
> > >>
> > >> You could spawn a lttng-sessiond from your application with the
> > >> appropriate
> > >> parameters set to isolate it if you need. LTTNG_HOME is an important
> one.
> > >> The
> > >> output directory also can be manipulated. See man lttng-sessiond for
> more
> > >> details. You will need to manage the process or leave it to a system
> > >> administrator and only active tracing when a sessiond is present for
> > >> example.
> > >>
> > >> Cheers
> > >>
> > >> >
> > >> > Regards,
> > >> > Mosleh
> > >> >
> > >> > On Wed, Mar 27, 2019 at 1:52 PM Jonathan Rajotte-Julien <
> > >> > jonathan.rajotte-julien@efficios.com> wrote:
> > >> >
> > >> > > Hi Mosleh,
> > >> > >
> > >> > > On Wed, Mar 27, 2019 at 12:09:54PM -0400, Mosleh Uddin wrote:
> > >> > > > Hello,
> > >> > > >
> > >> > > > Thank you for the quick response. I was able to use the
> > >> documentation you
> > >> > > > provided to start a session and get tracepoint list. I do have
> some
> > >> > > > follow-up questions:
> > >> > > >
> > >> > > > 1) I needed to create a session daemon before executing my
> custom
> > >> > > > application. In the API I did see functionality to see if a
> daemon
> > >> is
> > >> > > > active, however, it is possible to spawn a session daemon in my
> > >> custom
> > >> > > app?
> > >> > >
> > >> > > liblttng-ctl does not expose a lttng-sessiond spawning function
> since
> > >> by
> > >> > > definition it is a daemon executable (think apache,mysql etc.),
> you
> > >> will
> > >> > > have to
> > >> > > use system/popen/exec.. to spawn the lttng-sessiond process etc.
> if
> > >> you
> > >> > > want to
> > >> > > control its lifetime using your custom application.
> > >> > >
> > >> > > >
> > >> > > > 2) I am able to get a list of active traces lttng can see in
> > >> userspace, I
> > >> > > > enable all the traces and start tracing. The traces however
> seem to
> > >> not
> > >> > > be
> > >> > > > written anywhere on my filesystem. Do I have to specify a
> location?
> > >> Or
> > >> > > am I
> > >> > > > missing something? My current flow is:
> > >> > >
> > >> > > Please refer to the create command. If outputting locally you will
> > >> need to
> > >> > > pass
> > >> > > a "file://...." url to lttng_create_session.
> > >> > >
> > >> > > You can check on the result for each steps using "lttng list" and
> > >> "lttng
> > >> > > list
> > >> > > <session_name>" as you go to troubleshot your setup script.
> > >> > >
> > >> > > While debugging you can also start the lttng-sessiond in verbose
> mode
> > >> to
> > >> > > understand what is going on.
> > >> > >
> > >> > > Also note that you could also use the lttng "load" api if the
> session
> > >> you
> > >> > > are
> > >> > > trying to load is "static" and always the same. You would only
> need to
> > >> > > ship an
> > >> > > xml file with your application.
> > >> > >
> > >> > > Cheers
> > >> > >
> > >> > > >
> > >> > > >    - Creating a session
> > >> > > >    - Specifying the domain
> > >> > > >    - Creating a handle
> > >> > > >    - Creating a channel (with default attributes)
> > >> > > >    - Enabling the channel
> > >> > > >    - Enabling event (for all traces)
> > >> > > >    - Start tracing
> > >> > > >
> > >> > > > Thanks again for all the assistance.
> > >> > > >
> > >> > > > Regards,
> > >> > > > Mosleh
> > >> > > >
> > >> > > > On Tue, Mar 26, 2019 at 11:29 AM Jonathan Rajotte-Julien <
> > >> > > > jonathan.rajotte-julien@efficios.com> wrote:
> > >> > > >
> > >> > >
> > >>
> > >> --
> > >> Jonathan Rajotte-Julien
> > >> EfficiOS
> > >>
> > >
>
> --
> Jonathan Rajotte-Julien
> EfficiOS
>

[-- Attachment #1.2: Type: text/html, Size: 10507 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] 12+ messages in thread

* Re: Creating custom application
       [not found]                 ` <CAJyWpKGTZTKELQxb_XfnEhEjzMmSWe6oarR_XgS-9qmkoKfvNA@mail.gmail.com>
@ 2019-04-03 15:55                   ` Jonathan Rajotte-Julien
       [not found]                   ` <20190403155531.GA8451@joraj-alpa>
  1 sibling, 0 replies; 12+ messages in thread
From: Jonathan Rajotte-Julien @ 2019-04-03 15:55 UTC (permalink / raw)
  To: Mosleh Uddin; +Cc: lttng-dev

On Wed, Apr 03, 2019 at 11:04:19AM -0400, Mosleh Uddin wrote:
> Hello,
> 
> It is a limitation for both size and some security measures. We want to
> ensure that we can set limits controlled by our custom application.

What security measure? What limits? Unless you provide clear requirement it is
quite hard to understand where you are going and how we can help you get there.

> 
> For testing purposes, I did initially have lttng-tools and lttng-ust added
> to the build image but again for the limitations described it cannot go
> into the final 'production' rootfs. So it's nice that the service file
> exists, but without the tools installed I do not think I can make use of
> it, unless there is a way to strip out everything from lttng-tools except
> for the sessiond functionality.

Well the biggest part of lttng-tools project is lttng-sessiond and
lttng-consumerd. If the cli is the problem you can pass "--disable-bin-lttng" at
configure time to simply exclude it from being built and installed.

As for lttng-sessiond executable, you can limit the user able to use it via
regular user/group permissions.

> 
> My guess from everything you are saying is that I will have to create a
> custom method for spawning a session daemon without having lttng-tools
> available, however I am unsure where to start.

No, you will need lttng-tools (in the sense of the project, no the executable) to
be present on the system if you want to trace at all.

> From way lttng-tools does
> it, I see it call the executable 'lttng-sessiond', but I cannot find a
> reference to when or how that executable is getting built.

Take a look at the src/bin folder (git tree). The "lttng" subfolder is only the
CLI. The meat of lttng is lttng-sessiond/relayd/consumerd.

> 
> Thanks again for quick responses.
> 
> Regards,
> Mosleh
> 
> 
> 
> On Wed, Apr 3, 2019 at 10:25 AM Jonathan Rajotte-Julien <
> jonathan.rajotte-julien@efficios.com> wrote:
> 
> > On Wed, Apr 03, 2019 at 09:08:45AM -0400, Mosleh Uddin wrote:
> > > Hello,
> > >
> > > Sorry, I should be more specific. I am creating a custom yocto build. I
> > > have seen some examples where systemd is utilized to start the sessiond
> > as
> > > a service. The limitation I have is that I don't want to include the
> > whole
> > > lttng-tools librray in my build. I understand that the sessiond is an
> >
> > You will have to if you plan on tracing any applications on your resulting
> > image. Why is it a limitation? Size constraint?
> >
> > lttng-tools is already part of OE-core (the meta/ layer). Use this recipe
> > to
> > build it [1] or as a base for a custom one.
> >
> > [1]
> > https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-kernel/lttng/lttng-tools_2.10.6.bb
> >
> > You can add the following to your local.conf file to build only lttng-ust
> > and
> > lttng-tools.
> >
> > CORE_IMAGE_EXTRA_INSTALL += "lttng-ust lttng-tools"
> > PACKAGECONFIG_pn-lttng-tools_append = " lttng-ust"
> >
> > By default a systemd service file is installed but is not activated (which
> > seems
> > to be what you want).
> >
> > Cheers
> >
> >
> > > executable, I am just unsure how I could build or get this in my build.
> > > Moving forward from this I could use fork/exec to daemonize which would
> > be
> > > simple.
> > > Is there perhaps a existing recipe?
> > >
> > > Regards,
> > > Mosleh
> > >
> > > On Tue, Apr 2, 2019 at 6:01 PM Mosleh Uddin <mosleh1235@gmail.com>
> > wrote:
> > >
> > > > Hi,
> > > >
> > > > That makes complete sense. I was more curious about the sessiond
> > > > executable. I'm guessing this is something I will have to create along
> > with
> > > > my build?
> > > >
> > > > Regards,
> > > > Mosleh
> > > >
> > > > On Tue, Apr 2, 2019 at 5:18 PM Jonathan Rajotte-Julien <
> > > > jonathan.rajotte-julien@efficios.com> wrote:
> > > >
> > > >> On Tue, Apr 02, 2019 at 04:54:00PM -0400, Mosleh Uddin wrote:
> > > >> > Hello,
> > > >> >
> > > >> > Could you give me some more insight into spawning my own sessiond?
> > Sorry
> > > >> > I'm not completely clear on the topic.
> > > >> > Thank you for all your assistance.
> > > >>
> > > >> Normally lttng-sessiond is treated as a "server/service/daemon" (think
> > > >> http
> > > >> server as apache) and is *normally* launched as a daemon
> > > >> (systemd/sysVinit) at
> > > >> boot time.
> > > >>
> > > >> Managing manually the lifetime of a lttng-sessiond process is done the
> > > >> same way
> > > >> as any other process. You can manage it via the command line
> > > >> (./lttng-sessiond), via a
> > > >> service manager (systemd/upstart etc.) or with a custom service
> > manager (a
> > > >> python script/c etc.).
> > > >>
> > > >> You could spawn a lttng-sessiond from your application with the
> > > >> appropriate
> > > >> parameters set to isolate it if you need. LTTNG_HOME is an important
> > one.
> > > >> The
> > > >> output directory also can be manipulated. See man lttng-sessiond for
> > more
> > > >> details. You will need to manage the process or leave it to a system
> > > >> administrator and only active tracing when a sessiond is present for
> > > >> example.
> > > >>
> > > >> Cheers
> > > >>
> > > >> >
> > > >> > Regards,
> > > >> > Mosleh
> > > >> >
> > > >> > On Wed, Mar 27, 2019 at 1:52 PM Jonathan Rajotte-Julien <
> > > >> > jonathan.rajotte-julien@efficios.com> wrote:
> > > >> >
> > > >> > > Hi Mosleh,
> > > >> > >
> > > >> > > On Wed, Mar 27, 2019 at 12:09:54PM -0400, Mosleh Uddin wrote:
> > > >> > > > Hello,
> > > >> > > >
> > > >> > > > Thank you for the quick response. I was able to use the
> > > >> documentation you
> > > >> > > > provided to start a session and get tracepoint list. I do have
> > some
> > > >> > > > follow-up questions:
> > > >> > > >
> > > >> > > > 1) I needed to create a session daemon before executing my
> > custom
> > > >> > > > application. In the API I did see functionality to see if a
> > daemon
> > > >> is
> > > >> > > > active, however, it is possible to spawn a session daemon in my
> > > >> custom
> > > >> > > app?
> > > >> > >
> > > >> > > liblttng-ctl does not expose a lttng-sessiond spawning function
> > since
> > > >> by
> > > >> > > definition it is a daemon executable (think apache,mysql etc.),
> > you
> > > >> will
> > > >> > > have to
> > > >> > > use system/popen/exec.. to spawn the lttng-sessiond process etc.
> > if
> > > >> you
> > > >> > > want to
> > > >> > > control its lifetime using your custom application.
> > > >> > >
> > > >> > > >
> > > >> > > > 2) I am able to get a list of active traces lttng can see in
> > > >> userspace, I
> > > >> > > > enable all the traces and start tracing. The traces however
> > seem to
> > > >> not
> > > >> > > be
> > > >> > > > written anywhere on my filesystem. Do I have to specify a
> > location?
> > > >> Or
> > > >> > > am I
> > > >> > > > missing something? My current flow is:
> > > >> > >
> > > >> > > Please refer to the create command. If outputting locally you will
> > > >> need to
> > > >> > > pass
> > > >> > > a "file://...." url to lttng_create_session.
> > > >> > >
> > > >> > > You can check on the result for each steps using "lttng list" and
> > > >> "lttng
> > > >> > > list
> > > >> > > <session_name>" as you go to troubleshot your setup script.
> > > >> > >
> > > >> > > While debugging you can also start the lttng-sessiond in verbose
> > mode
> > > >> to
> > > >> > > understand what is going on.
> > > >> > >
> > > >> > > Also note that you could also use the lttng "load" api if the
> > session
> > > >> you
> > > >> > > are
> > > >> > > trying to load is "static" and always the same. You would only
> > need to
> > > >> > > ship an
> > > >> > > xml file with your application.
> > > >> > >
> > > >> > > Cheers
> > > >> > >
> > > >> > > >
> > > >> > > >    - Creating a session
> > > >> > > >    - Specifying the domain
> > > >> > > >    - Creating a handle
> > > >> > > >    - Creating a channel (with default attributes)
> > > >> > > >    - Enabling the channel
> > > >> > > >    - Enabling event (for all traces)
> > > >> > > >    - Start tracing
> > > >> > > >
> > > >> > > > Thanks again for all the assistance.
> > > >> > > >
> > > >> > > > Regards,
> > > >> > > > Mosleh
> > > >> > > >
> > > >> > > > On Tue, Mar 26, 2019 at 11:29 AM Jonathan Rajotte-Julien <
> > > >> > > > jonathan.rajotte-julien@efficios.com> wrote:
> > > >> > > >
> > > >> > >
> > > >>
> > > >> --
> > > >> Jonathan Rajotte-Julien
> > > >> EfficiOS
> > > >>
> > > >
> >
> > --
> > Jonathan Rajotte-Julien
> > EfficiOS
> >

-- 
Jonathan Rajotte-Julien
EfficiOS

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

* Re: Creating custom application
       [not found]                       ` <20190403200054.GC8743@joraj-alpa>
@ 2019-04-03 20:50                         ` Mosleh Uddin
  0 siblings, 0 replies; 12+ messages in thread
From: Mosleh Uddin @ 2019-04-03 20:50 UTC (permalink / raw)
  To: Jonathan Rajotte-Julien, lttng-dev


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

Apologies, did not mean for the message to be private.

Thank you for all your assistance, for now I think compiling with the flag
to disable cli is the way to go.

Regards,
Mosleh

On Wed, Apr 3, 2019 at 4:00 PM Jonathan Rajotte-Julien <
jonathan.rajotte-julien@efficios.com> wrote:

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

[-- Attachment #1.2: Type: text/html, Size: 19429 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] 12+ messages in thread

* Creating custom application
@ 2019-03-26 15:11 Mosleh Uddin
  0 siblings, 0 replies; 12+ messages in thread
From: Mosleh Uddin @ 2019-03-26 15:11 UTC (permalink / raw)
  To: lttng-dev


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

Hi all,

I am working with an embedded system and for security purposes I don't
necessarily want the user to have the ability to execute lttng commands
(lttng-sessiond, lttng create, etc.). In order to create a session/start I
am creating a custom application which will communicate through my
application via a socket. This way my application only control lttng
functionalities.

I was wondering if you guys can direct me to some documentation where I can
understand how I can approach creating a session and implementing the
functionalities that commands like (lttng-sessiond, lttng create and lttng
start) provide. Thank you for any information.

Regards,
Mosleh

[-- Attachment #1.2: Type: text/html, Size: 776 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] 12+ messages in thread

end of thread, other threads:[~2019-04-03 20:50 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAJyWpKHE_4eZwMAhU-q4sbAAA3-nPWgxtGqpXYLpMyztNzmm-w@mail.gmail.com>
2019-03-26 15:29 ` Creating custom application Jonathan Rajotte-Julien
     [not found] ` <20190326152942.GE17481@joraj-alpa>
2019-03-27 16:09   ` Mosleh Uddin
     [not found]   ` <CAJyWpKHtXHAgyjwZVnSCnnDTmCsOVsydaZgqpMuALQWMy5nfiA@mail.gmail.com>
2019-03-27 17:52     ` Jonathan Rajotte-Julien
     [not found]     ` <20190327175251.GA7976@joraj-alpa>
2019-04-02 20:54       ` Mosleh Uddin
     [not found]       ` <CAJyWpKEhLdREuCFJEfSojHuqQ9jTA12SWE_FAJ3HTdP1irO-sw@mail.gmail.com>
2019-04-02 21:18         ` Jonathan Rajotte-Julien
     [not found]         ` <20190402211757.GA23381@joraj-alpa>
2019-04-02 22:01           ` Mosleh Uddin
     [not found]           ` <CAJyWpKGDrF9J=yDALm+1cn7cTd+TJZK30tXLHKKKXvkntmQDoQ@mail.gmail.com>
2019-04-03 13:08             ` Mosleh Uddin
     [not found]             ` <CAJyWpKFxRqsVYc=dDvaoTMGkrkLmktaudYJgvVkzzvUyeFx-NQ@mail.gmail.com>
2019-04-03 14:25               ` Jonathan Rajotte-Julien
     [not found]               ` <20190403142514.GB23381@joraj-alpa>
2019-04-03 15:04                 ` Mosleh Uddin
     [not found]                 ` <CAJyWpKGTZTKELQxb_XfnEhEjzMmSWe6oarR_XgS-9qmkoKfvNA@mail.gmail.com>
2019-04-03 15:55                   ` Jonathan Rajotte-Julien
     [not found]                   ` <20190403155531.GA8451@joraj-alpa>
     [not found]                     ` <CAJyWpKH0RSfkTNmDqasq+1KoSOdL6VFA84vBSWH6xpYqdOMRLQ@mail.gmail.com>
     [not found]                       ` <20190403200054.GC8743@joraj-alpa>
2019-04-03 20:50                         ` Mosleh Uddin
2019-03-26 15:11 Mosleh Uddin

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.