[[filter-syntax]]
Filter expression syntax
~~~~~~~~~~~~~~~~~~~~~~~~
-Filter expressions can be specified with the option:--filter option
-when creating a new event rule. If the filter expression evaluates
-to true when executed against the dynamic values of an event's fields
-when tracing, the filtering condition passes.
+A filter expression can be specified with the option:--filter option
+when creating a new event rule. If the filter expression evaluates to
+true when executed against the dynamic values of an event's fields when
+tracing, the filtering condition passes.
NOTE: Make sure to **single-quote** the filter expression when running
the command from a shell, as filter expressions typically include
The precedence table of the operators above is the same as the one of
the C language. Parentheses are supported to bypass this.
-The dynamic value of an event field is read by using its name as
-a C identifier.
+The dynamic value of an event field is read by using its name as a C
+identifier.
The dynamic value of a statically-known context field is read by
prefixing its name with `$ctx.`. Statically-known context fields are
context fields added to channels without the `$app.` prefix using the
-man:lttng-add-context(1) command.
+man:lttng-add-context(1) command. `$ctx.cpu_id` is also available as the
+ID of the CPU which emits the event.
The dynamic value of an application-specific context field is read by
prefixing its name with `$app.` (follows the format used to add such a
Target
~~~~~~
-option:-c, option:--channel='CHANNEL'::
+option:-c 'CHANNEL', option:--channel='CHANNEL'::
Create or enable event rules in the channel named 'CHANNEL' instead
of the default channel name `channel0`.
-option:-s, option:--session='SESSION'::
+option:-s 'SESSION', option:--session='SESSION'::
Create or enable event rules in the tracing session named 'SESSION'
instead of the current tracing session.
Filtering and exclusion
~~~~~~~~~~~~~~~~~~~~~~~
-option:-x, option:--exclude='EVENT'[,'EVENT']...::
+option:-x 'EVENT'[,'EVENT']..., option:--exclude='EVENT'[,'EVENT']...::
Exclude events named 'EVENT' from the event rule. This option
can be used when the command's 'EVENT' argument contains a wildcard
(`*`) to exclude specific names. Only available with application
domains.
-option:-f, option:--filter='EXPR'::
+option:-f 'EXPR', option:--filter='EXPR'::
Add filter expression condition to the event rule. Expression 'EXPR'
must evaluate to true when executed against the dynamic values of
event fields. See the <<filter-syntax,Filter expression syntax>>