[lttng-dev] Enabling and disabling events

Ikaheimonen, JP jp_ikaheimonen at mentor.com
Tue Sep 10 07:40:51 EDT 2013


Hi Daniel,
as you can see, things easily get too complicated.

Currently in LTTng you can only disable events that are enabled in the first place. In other words, an event is born disabled, as if 'lttng disable-event "*"' had been issued whenever a channel is created. We already have a mechanism to un-disable events - this is the enable-event command. I do not see any reason to add another command to do exactly what enable-event already does. If we want to 'disable all events except 'a'' we can call lttng enable-event 'a'. Symmetrically, I would like to have 'enable all events except 'a'', but currently this is impossible.

I still propose keeping the disable-event and enable-event commands asymmetrical. Based on your thoughts below, I also suggest keeping two lists for the enabled events: one for the enablements, and one for the exceptions to the enablements. The items in the latter list would point to specific items in the former list, so that the exceptions would be tied to certain enablements.

So for instance,

$ lttng enable-event -u 'x'
$ lttng list session
Events:
  x [enabled]
$ lttng enable-event -u "x*" --except "xa*"
$ lttng list session
Events:
  x [enabled]
  x* [enabled, exception xa*]
$ lttng enable-event -u "x*" --except "xb*"
$ lttng list session
  x [enabled]
  x* [enabled, exception xa*]
  x* [enabled, exception xb*]

Again, all the enablements would be checked, and the event would be enabled if any of the enablements match.

If an event enablement has an exception, it must be used in the disable-event command also:
$ lttng disable-event -u "x*" --except "xb*"
$ lttng list session
  x [enabled]
  x* [enabled, exception xa*]
  x* [disabled, exception xb*]

Comments are very welcome.

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