[lttng-dev] Enable/disable TPs per executing process

David Goulet dgoulet at efficios.com
Mon Mar 5 11:22:27 EST 2012

Hash: SHA1

Hi Stanislav,

On 12-03-05 04:52 AM, Stanislav Vovk wrote:
> Hi
> In my case LTTng will collect TPs from a number of running processes. I would
> like to enable/disable tracepoints per process. For example, two processes p1 &
> p2 running and there exist a tracepoint called INFO which is used in both p1 and
> p2. I would like to enable INFO for p1 only. So later, looking at my traces I
> should only see INFO triggered by p1 and nothing from p2. Is there a way to do
> like that?

At this point in time, this feature is not implemented yet. The per-pid tracing
is on the roadmap for future release.

> I was thinking to enable one channel per process and and then I could
> enable/disable tracepoints per channel. Can a channel be associated with a process?

A channel can not be associated with a process. However, you can enable only
tracepoints of a process in one channel and the other process in a second
channel. Disabling one channel will only give you the tracepoints of a process.

You can also add the "vpid" context information to the channel or/and events and
with that you'll be able to pin an event to a precise PID. (Note, if context is
added to the channel, it's also enabled for events registered in that channel).

$ lttng add-context -t vpid -u -e EVENT_NAME

> In LTTng control API I found a following function,
> /*
>  * Set the tracing group for the *current* flow of execution.
>  *
>  * On success, returns 0, on error, returns -1 (null name) or -ENOMEM.
>  */
> extern int lttng_set_tracing_group(const char *name);
> I dont really understand how and where I can use these tracing groups? Is this
> something that I can use in the above scenario?

Users in the tracing group are able to trace the kernel without root access.
This API call allows you to set the group name *if* it is different from the
default one ("tracing") only for the execution you are using the liblttng-ctl.

For your use case, user space tracing, no need at all :).

> Thanks!
Version: GnuPG v1.4.10 (GNU/Linux)


More information about the lttng-dev mailing list