Filter: document ust app ctx limitation
[lttng-tools.git] / doc / man / lttng-enable-event.1.txt
index 1a80fe774aaa4a8ba7574ca056d719efbf5ab7ac..92fd5f51f22d65910f951edbed665cfed84df63d 100644 (file)
@@ -107,10 +107,10 @@ a _don't care_.
 For example, consider the following commands:
 
 [role="term"]
-----------------------------------------------------------------
-lttng enable-event --userspace hello:world
-lttng enable-event --userspace hello:world --loglevel=TRACE_INFO
-----------------------------------------------------------------
+----
+lttng enable-event --userspace hello:world
+lttng enable-event --userspace hello:world --loglevel=TRACE_INFO
+----
 
 Here, two event rules are created. The first one has a single condition:
 the tracepoint name must match `hello:world`. The second one has two
@@ -133,8 +133,9 @@ The available conditions for the Linux kernel domain are:
   (option:--probe or option:--function option's argument) which must
   match event source's equivalent.
 +
-Wildcard using the `*` character are supported _at the end_ of
-tracepoint and system call names.
+You can use `*` characters at any place in the tracepoint or system
+call name as wildcards to match zero or more characters. To use a
+literal `*` character, use :escwc:.
 
 * Filter expression (option:--filter option) executed against the
   dynamic values of event fields at execution time that must evaluate
@@ -146,10 +147,11 @@ The available conditions for the application domains are:
 * Tracepoint name ('EVENT' with option:--tracepoint option) which must
   match event source's equivalent.
 +
-Wildcard using the `*` character are supported _at the end_ of
-tracepoint names. When creating an event rule with a tracepoint name
-containing a wildcard, specific tracepoint names can be excluded from
-the match using the option:--exclude option.
+You can use `*` characters at any place in the tracepoint name as
+wildcards to match zero or more characters. To use a literal `*`
+character, use :escwc:. When you create an event rule with a tracepoint
+name containing a wildcard, you can exclude specific tracepoint names
+from the match with the option:--exclude option.
 
 * Filter expression (option:--filter option) executed against the
   dynamic values of event fields at execution time that must evaluate
@@ -176,10 +178,10 @@ argument named `*` (wildcard).
 [[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
@@ -216,13 +218,14 @@ The arithmetic and bitwise operators are :not: supported.
 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
@@ -232,9 +235,9 @@ When a comparison includes a non existent event field, the whole filter
 expression evaluates to false (the event is discarded).
 
 C integer and floating point number constants are supported, as well as
-literal strings between double quotes (`"`). Literal strings can contain
-a wildcard character (`*`) at the end to match more than one string.
-This wildcard can be escaped using :escwc:.
+literal strings between double quotes (`"`). You can use `*` characters
+at any place in a literal string as wildcards to match zero or more
+characters. To use a literal `*` character, use :escwc:.
 
 LTTng-UST enumeration fields can be compared to integer values (fields
 or constants).
@@ -258,6 +261,10 @@ $ctx.procname == "lttng*" && (!flag || poel < 34)
 $app.my_provider:my_context == 17.34e9 || some_enum >= 14
 ---------------------------------------------------------
 
+---------------------------------------
+$ctx.cpu_id == 2 && filename != "*.log"
+---------------------------------------
+
 
 [[log-levels]]
 Log levels
@@ -411,9 +418,11 @@ Filtering and exclusion
 ~~~~~~~~~~~~~~~~~~~~~~~
 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.
+    can be used when the command's 'EVENT' argument contains at least
+    one wildcard star (`*`) to exclude specific names. 'EVENT' can also
+    contain wildcard stars. To use a
+    literal `,` character, use :esccomma:.
+    Only available with the option:--userspace domain.
 
 option:-f 'EXPR', option:--filter='EXPR'::
     Add filter expression condition to the event rule. Expression 'EXPR'
This page took 0.025165 seconds and 4 git commands to generate.