[lttng-dev] Enable UST probes only in specific process

Dmitri Shubin sbn at tbricks.com
Thu Jul 31 13:03:17 EDT 2014

Hi Daniel,

On Wed, Jul 30, 2014 at 8:36 PM, Thibault, Daniel <
Daniel.Thibault at drdc-rddc.gc.ca> wrote:

>    I do believe that the filter drops the event before it starts resolving
> its arguments, so filtering should be enough.  Someone more familiar with
> the internals of LTTng should set us straight either way.

Simple demonstration using tracef():

$ cat a.c
#include <stdlib.h>
#include <unistd.h>
#include <lttng/tracef.h>

int main()
    for (;;) {
        tracef("hello", (abort(), 1));

    return 0;
$ gcc a.c -llttng-ust
$ ./a.out &
[1] 12820
$ ./a.out &
[2] 12823
$ lttng create
Session auto-20140731-205604 created.
Traces will be written in /home/sbn/lttng-traces/auto-20140731-205604
$ lttng add-context -u -t vpid
UST context vpid added to all channels
$ lttng enable-event -u lttng_ust_tracef:event -f '$ctx.vpid==12820'
Event lttng_ust_tracef:event: Filter '$ctx.vpid==12820' successfully set
$ lttng start
Tracing started for session auto-20140731-205604
[1]-  Aborted                 (core dumped) ./a.out
[2]+  Aborted                 (core dumped) ./a.out

So I specify filter on PID, but probe fired in both processes.
That's not what I want.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20140731/7870b75c/attachment.html>

More information about the lttng-dev mailing list