[lttng-dev] [LTTng UST] [RFC] Event exclusion feature

Ikaheimonen, JP jp_ikaheimonen at mentor.com
Mon Sep 23 04:01:17 EDT 2013

After some discussion on and off this mailing list, I present the interface to the event exclusion feature.

Use case:
We are providing libraries for an application developer. The libraries contain LTTng UST tracepoints, and we use them to get information about how the application uses the library.
The application developer also uses LTTng UST tracepoints, for their own use, over which we have no control. We also do not know the names of their tracepoints.
We want to use LTTng to separate the events to two different channels. One would contain all our library events, whereas the other would contain all other events.

Currently there is no way in LTTng to trace 'all events except these ones whose names I know'.
I suggest the following:

1) Enhance enable-event command for UST tracepoint events. Add an --exclude parameter to specify exclusions to enabling wildcards.

$ lttng enable-event -u -c mychan 'myapp*' --exclude myapp_comp1  
UST event myapp* excluding myapp_comp1* created in channel mychan

This command enabled all events starting with myapp, except those starting with myapp_comp1.

2) You can specify multiple exclusions. The following is valid:

$ lttng enable-event 'myapp*' --exclude 'myapp_comp1*, myapp_comp2*'
 UST event myapp* excluding myapp_comp1*, myapp_comp2* created in channel mychan

3) The -exclude option applies to all given events in the command. That is, the command 

$ lttng enable-event 'myap*,m*' --exclude 'myapp_comp1*'

would be equivalent to

$ lttng enable-event 'myap*' --exclude 'myapp_comp1*'
 $ lttng enable-event 'm*' --exclude 'myapp_comp1*'

4) When using --exclude, the event name should be a wildcard specification, and the excluded events should be a proper subset of the event specification. Otherwise, a warning is given, and the excluder is discarded. If the excluder fully covers the given event so that no events would be enabled, an error is given.

$ lttng enable-event 'myap2*' --exclude 'myapp_comp1*'
Warning: Event myap2*: myapp_comp1* does not exclude any events from myap2* 
UST event myap2* created in channel mychan

$ lttng enable-event 'myap2*' --exclude 'my*'
Error: Event myap2*: my* excludes all events from myap2*.

5) When disabling an event that has been enabled with exclusions, the exclusions do not need to be specified again. 

$ lttng enable-event -u -c mychan 'myapp2*' --exclude 'myapp2_comp1*' 
UST event myapp2* excluding myapp2_comp1* created in channel mychan 
$ lttng disable-event -u -c mychan 'myapp2*' 
UST event myapp2* disabled in channel mychan

JP Ikaheimonen | SW Development Engineer http://go.mentor.com/sourceryanalyzer

Mentor Embedded(tm) | Nucleus(r) | Linux(r) | Android(tm) | Services | UI | Multi-OS

Android is a trademark of Google Inc. Use of this trademark is subject to Google Permissions.
Linux is the registered trademark of Linus Torvalds in the U.S. and other countries.

More information about the lttng-dev mailing list