Fix: syscall event rule: emission sites not compared in is_equal
[lttng-tools.git] / doc / man / lttng-enable-event.1.txt
... / ...
CommitLineData
1lttng-enable-event(1)
2=====================
3:revdate: 14 June 2021
4
5
6NAME
7----
8lttng-enable-event - Create or enable LTTng recording event rules
9
10
11SYNOPSIS
12--------
13Create or enable one or more recording event rules to match Linux kernel
14tracepoint or system call events:
15
16[verse]
17*lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *enable-event* option:--kernel [option:--tracepoint | option:--syscall]
18 (option:--all | 'NAME'[,'NAME']...) [option:--filter='EXPR']
19 [option:--session='SESSION'] [option:--channel='CHANNEL']
20
21Create or enable a recording event rule to match Linux kernel events
22created from a dynamic instrumentation point:
23
24[verse]
25*lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *enable-event* option:--kernel
26 (option:--probe='LOC' | option:--function='LOC' | option:--userspace-probe='LOC') 'RECORDNAME'
27 [option:--session='SESSION'] [option:--channel='CHANNEL']
28
29Create or enable one or more recording event rules to match
30user space tracepoint events:
31
32[verse]
33*lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *enable-event* option:--userspace [option:--tracepoint]
34 (option:--all | 'NAME'[,'NAME']...) [option:--exclude='XNAME'[,'XNAME']...]
35 [option:--loglevel='LOGLEVEL' | option:--loglevel-only='LOGLEVEL'] [option:--filter='EXPR']
36 [option:--session='SESSION'] [option:--channel='CHANNEL']
37
38Create or enable one or more recording event rules to match
39Java/Python logging events:
40
41[verse]
42*lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *enable-event* (option:--jul | option:--log4j | option:--python)
43 [option:--tracepoint] (option:--all | 'NAME'[,'NAME']...)
44 [option:--loglevel='LOGLEVEL' | option:--loglevel-only='LOGLEVEL'] [option:--filter='EXPR']
45 [option:--session='SESSION'] [option:--channel='CHANNEL']
46
47DESCRIPTION
48-----------
49The `lttng enable-event` command does one of:
50
51* Create one or more recording event rules.
52
53* Enable one or more disabled recording event rules.
54+
55See the ``<<enable,Enable a disabled recording event rule>>'' section
56below.
57
58See man:lttng-concepts(7) to learn more about instrumentation points,
59events, recording event rules, and event records.
60
61The recording event rule(s) to create or enable belong to:
62
63With the option:--session='SESSION' option::
64 The recording session named 'SESSION'.
65
66Without the option:--session option::
67 The current recording session (see man:lttng-concepts(7) to learn
68 more about the current recording session).
69
70With the option:--channel='CHANNEL' option::
71 The channel named 'CHANNEL'.
72
73Without the option:--channel option::
74 The channel named `channel0`.
75+
76If there's already a channel for the selected recording session and
77domain which isn't named `channel0`, the `enable-event` command fails.
78Otherwise, it automatically creates it.
79
80See the ``<<examples,EXAMPLES>>'' section below for usage examples.
81
82List the recording event rules of a specific recording session
83and/or channel with the man:lttng-list(1) and man:lttng-status(1)
84commands.
85
86Disable an enabled recording event rule with the
87man:lttng-disable-event(1) command.
88
89
90Overview of recording event rule conditions
91~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
92For LTTng to emit and record an event{nbsp}__E__,{nbsp}__E__ must
93satisfy *all* the conditions of a recording event rule{nbsp}__ER__, that
94is:
95
96Explicit conditions::
97 You set the following conditions when you create or
98 enable{nbsp}__ER__ with the `enable-event` command:
99+
100--
101* The instrumentation point type from which LTTng creates{nbsp}__E__
102 has a specific type.
103+
104See the ``<<inst-point-type-cond,Instrumentation point type
105condition>>'' section below.
106
107* A pattern matches the name of{nbsp}__E__ while another pattern
108 doesn't.
109+
110See the ``<<event-name-cond,Event name condition>>'' section below.
111
112* The log level of the instrumentation point from which LTTng
113 creates{nbsp}__E__ is at least as severe as some value, or is exactly
114 some value.
115+
116See the ``<<inst-point-log-level-cond,Instrumentation point log level
117condition>>'' section below.
118
119* The fields of the payload of{nbsp}__E__ and the current context fields
120 satisfy a filter expression.
121+
122See the ``<<filter-cond,Event payload and context filter condition>>''
123section below.
124--
125
126Implicit conditions::
127+
128--
129* _ER_ itself is enabled.
130+
131A recording event rule is enabled on creation.
132+
133Enable a disabled recording event rule with the `enable-event` command.
134
135* The channel to which{nbsp}__ER__ is attached is enabled.
136+
137A channel is enabled on creation.
138+
139Enable a disabled channel with the man:lttng-enable-channel(1) command.
140
141* The recording session of{nbsp}__ER__ is active (started).
142+
143A recording session is inactive (stopped) on creation.
144+
145Start an inactive recording session with the man:lttng-start(1) command.
146
147* The process for which LTTng creates{nbsp}__E__ is allowed to record
148 events.
149+
150All processes are allowed to record events on recording session
151creation.
152+
153Use the man:lttng-track(1) and man:lttng-untrack(1) commands to select
154which processes are allowed to record events based on specific process
155attributes.
156--
157
158The dedicated command-line options of most conditions are optional: if
159you don't specify the option, the associated condition is always
160satisfied.
161
162
163[[inst-point-type-cond]]
164Instrumentation point type condition
165~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
166An event{nbsp}__E__ satisfies the instrumentation point type condition
167of a recording event rule if the instrumentation point from which LTTng
168creates{nbsp}__E__ is:
169
170For the Linux kernel tracing domain (option:--kernel option)::
171 With the option:--tracepoint option or without any other instrumentation point type option:::
172 An LTTng kernel tracepoint, that is, a statically defined point
173 in the source code of the kernel image or of a kernel module
174 with LTTng kernel tracer macros.
175+
176As of LTTng{nbsp}{lttng_version}, this is the default instrumentation
177point type of the Linux kernel tracing domain, but this may change in
178the future.
179+
180List the available Linux kernel tracepoints with `lttng list --kernel`.
181See man:lttng-list(1) to learn more.
182
183 With the option:--syscall option:::
184 The entry and exit of a Linux kernel system call.
185+
186List the available Linux kernel system call instrumentation points with
187`lttng list --kernel --syscall`. See man:lttng-list(1) to learn more.
188
189 With the option:--probe option:::
190 A Linux kprobe, that is, a single probe dynamically placed in
191 the compiled kernel code.
192+
193The argument of the option:--probe option is the location of the
194kprobe to insert, either a symbol or a
195memory address, while 'RECORDNAME' is the name of the record
196of{nbsp}__E__ (see the ``<<er-name,Event record name>>'' section below).
197+
198The payload of a Linux kprobe event is empty.
199
200 With the option:--userspace-probe option:::
201 A Linux user space probe, that is, a single probe dynamically
202 placed at the entry of a compiled user space application/library
203 function through the kernel.
204+
205The argument of the option:--userspace-probe option is the location
206of the user space probe to insert, one of:
207+
208--
209* A path and symbol (ELF method).
210* A path, provider name, and probe name (SystemTap User-level Statically
211 Defined Tracing (USDT) method; a DTrace-style marker).
212+
213As of LTTng{nbsp}{lttng_version}, LTTng only supports USDT probes which
214are :not: reference-counted.
215--
216+
217'RECORDNAME' is the name of the record of{nbsp}__E__ (see the
218``<<er-name,Event record name>>'' section below).
219+
220The payload of a Linux user space probe event is empty.
221
222 With the option:--function option:::
223 A Linux kretprobe, that is, two probes dynamically placed at the
224 entry and exit of a function in the compiled kernel code.
225+
226The argument of the option:--function option is the location of the
227Linux kretprobe to insert, either a symbol or
228a memory address, while 'RECORDNAME' is the name of the record
229of{nbsp}__E__ (see the ``<<er-name,Event record name>>'' section below).
230+
231The payload of a Linux kretprobe event is empty.
232
233For the user space tracing domain (option:--userspace option)::
234 With or without the option:--tracepoint option:::
235 An LTTng user space tracepoint, that is, a statically defined
236 point in the source code of a C/$$C++$$ application/library with
237 LTTng user space tracer macros.
238+
239As of LTTng{nbsp}{lttng_version}, this is the default and sole
240instrumentation point type of the user space tracing domain, but this
241may change in the future.
242+
243List the available user space tracepoints with `lttng list --userspace`.
244See man:lttng-list(1) to learn more.
245
246For the `java.util.logging` (option:--jul option), Apache log4j (option:--log4j option), and Python (option:--python option) tracing domains::
247 With or without the option:--tracepoint option:::
248 A logging statement.
249+
250As of LTTng{nbsp}{lttng_version}, this is the default and sole
251instrumentation point type of the `java.util.logging`, Apache log4j, and
252Python tracing domains, but this may change in the future.
253+
254List the available Java and Python loggers with `lttng list --jul`,
255`lttng list --log4j`, and `lttng list --python`. See man:lttng-list(1)
256to learn more.
257
258
259[[event-name-cond]]
260Event name condition
261~~~~~~~~~~~~~~~~~~~~
262An event{nbsp}__E__ satisfies the event name condition of a recording
263event rule{nbsp}__ER__ if the two following statements are true:
264
265* You specify the option:--all option or, depending on the
266 instrumentation type condition (see the
267 ``<<inst-point-type-cond,Instrumentation point type condition>>''
268 section above) of{nbsp}__ER__, 'NAME' matches:
269+
270--
271LTTng tracepoint::
272 The full name of the tracepoint from which LTTng creates{nbsp}__E__.
273+
274Note that the full name of a user space tracepoint is
275__PROVIDER__++:++__NAME__, where __PROVIDER__ is the tracepoint provider
276name and __NAME__ is the tracepoint name.
277
278Logging statement::
279 The name of the Java or Python logger from which LTTng
280 creates{nbsp}__E__.
281
282Linux system call::
283 The name of the system call, without any `sys_` prefix, from which
284 LTTng creates{nbsp}__E__.
285--
286
287* You don't specify the option:--exclude=__XNAME__[++,++__XNAME__]...
288 option or, depending on the instrumentation type condition
289 of{nbsp}__ER__, none of the 'XNAME' arguments matches the full name of
290 the user space tracepoint from which LTTng creates{nbsp}__E__.
291+
292The option:--exclude option is only available with the option:--userspace
293option.
294
295This condition is only meaningful for the LTTng tracepoint, logging
296statement, and Linux system call instrumentation point types: it's
297always satisfied for the other types.
298
299In all cases, 'NAME' and 'XNAME' are globbing patterns: the `*`
300character means ``match anything''. To match a literal `*` character,
301use :escwc:. To match a literal `,` character, use
302:esccomma:.
303
304IMPORTANT: Make sure to **single-quote** 'NAME' and 'XNAME' when they
305contain the `*` character and when you run the `enable-event` command
306from a shell.
307
308With the LTTng tracepoint, logging statement, and Linux system call
309instrumentation point types, the `enable-event` command creates or
310enables one independent recording event rule per 'NAME' argument
311(non-option, comma-separated). With the option:--all option, the
312`enable-event` command creates or enables a single recording event rule.
313
314
315[[inst-point-log-level-cond]]
316Instrumentation point log level condition
317~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
318An event{nbsp}__E__ satisfies the instrumentation point log level
319condition of a recording event rule if either:
320
321* The option:--loglevel and option:--loglevel-only options are
322 missing.
323
324* The log level of the LTTng user space tracepoint or logging statement
325 which creates{nbsp}__E__ is:
326 With the option:--loglevel='LOGLEVEL' option::
327 At least as severe as 'LOGLEVEL'.
328
329 With the option:--loglevel-only='LOGLEVEL' option::
330 Exactly 'LOGLEVEL'.
331
332This condition is only meaningful for the LTTng user space tracepoint
333and logging statement instrumentation point types: it's always satisfied
334for other types.
335
336The available values of 'LOGLEVEL' are, depending on the tracing domain,
337from the most to the least severe:
338
339User space (option:--userspace option)::
340+
341* `EMERG` (0)
342* `ALERT` (1)
343* `CRIT` (2)
344* `ERR` (3)
345* `WARNING` (4)
346* `NOTICE` (5)
347* `INFO` (6)
348* `DEBUG_SYSTEM` (7)
349* `DEBUG_PROGRAM` (8)
350* `DEBUG_PROCESS` (9)
351* `DEBUG_MODULE` (10)
352* `DEBUG_UNIT` (11)
353* `DEBUG_FUNCTION` (12)
354* `DEBUG_LINE` (13)
355* `DEBUG` (14)
356
357`java.util.logging` (option:--jul option)::
358+
359* `OFF` (`INT32_MAX`)
360* `SEVERE` (1000)
361* `WARNING` (900)
362* `INFO` (800)
363* `CONFIG` (700)
364* `FINE` (500)
365* `FINER` (400)
366* `FINEST` (300)
367* `ALL` (`INT32_MIN`)
368
369Apache log4j (option:--log4j option)::
370+
371* `OFF` (`INT32_MAX`)
372* `FATAL` (50000)
373* `ERROR` (40000)
374* `WARN` (30000)
375* `INFO` (20000)
376* `DEBUG` (10000)
377* `TRACE` (5000)
378* `ALL` (`INT32_MIN`)
379
380Python (option:--python option)::
381+
382* `CRITICAL` (50)
383* `ERROR` (40)
384* `WARNING` (30)
385* `INFO` (20)
386* `DEBUG` (10)
387* `NOTSET` (0)
388
389
390[[filter-cond]]
391Event payload and context filter condition
392~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
393An event{nbsp}__E__ satisfies the event payload and context filter
394condition of a recording event rule if the option:--filter='EXPR'
395option is missing or if 'EXPR' is _true_.
396
397This condition is only meaningful for the LTTng tracepoint and Linux
398system call instrumentation point types: it's always satisfied for other
399types.
400
401'EXPR' can contain references to the payload fields of{nbsp}__E__ and
402to the current context fields.
403
404IMPORTANT: Make sure to **single-quote** 'EXPR' when you run the
405`enable-event` command from a shell, as filter expressions typically
406include characters having a special meaning for most shells.
407
408The expected syntax of 'EXPR' is similar to the syntax of a
409C{nbsp}language conditional expression (an expression which an `if`
410statement can evaluate), but there are a few differences:
411
412* A _NAME_ expression identifies an event payload field named
413 _NAME_ (a C{nbsp}identifier).
414+
415Use the C{nbsp}language dot and square bracket notations to access
416nested structure and array/sequence fields. You can only use a constant,
417positive integer number within square brackets. If the index is out of
418bounds, 'EXPR' is _false_.
419+
420The value of an enumeration field is an integer.
421+
422When a field expression doesn't exist, 'EXPR' is _false_.
423+
424Examples: `my_field`, `target_cpu`, `seq[7]`, `msg.user[1].data[2][17]`.
425
426* A ++$ctx.++__TYPE__ expression identifies the statically-known context
427 field having the type _TYPE_ (a C{nbsp}identifier).
428+
429List the available statically-known context field names with the
430man:lttng-add-context(1) command.
431+
432When a field expression doesn't exist, 'EXPR' is _false_.
433+
434Examples: `$ctx.prio`, `$ctx.preemptible`,
435`$ctx.perf:cpu:stalled-cycles-frontend`.
436
437* A ++$app.++__PROVIDER__++:++__TYPE__ expression identifies the
438 application-specific context field having the type _TYPE_ (a
439 C{nbsp}identifier) from the provider _PROVIDER_ (a C{nbsp}identifier).
440+
441When a field expression doesn't exist, 'EXPR' is _false_.
442+
443Example: `$app.server:cur_user`.
444
445* Compare strings, either string fields or string literals
446 (double-quoted), with the `==` and `!=` operators.
447+
448When comparing to a string literal, the `*` character means ``match
449anything''. To match a literal `*` character, use :escwc:.
450+
451Examples: `my_field == "user34"`, `my_field == my_other_field`,
452`my_field == "192.168.*"`.
453
454* The precedence table of the operators which are supported in 'EXPR'
455 is as follows. In this table, the highest precedence is{nbsp}1:
456+
457[options="header"]
458|===
459|Precedence |Operator |Description |Associativity
460|1 |`-` |Unary minus |Right-to-left
461|1 |`+` |Unary plus |Right-to-left
462|1 |`!` |Logical NOT |Right-to-left
463|1 |`~` |Bitwise NOT |Right-to-left
464|2 |`<<` |Bitwise left shift |Left-to-right
465|2 |`>>` |Bitwise right shift |Left-to-right
466|3 |`&` |Bitwise AND |Left-to-right
467|4 |`^` |Bitwise XOR |Left-to-right
468|5 |`\|` |Bitwise OR |Left-to-right
469|6 |`<` |Less than |Left-to-right
470|6 |`<=` |Less than or equal to |Left-to-right
471|6 |`>` |Greater than |Left-to-right
472|6 |`>=` |Greater than or equal to |Left-to-right
473|7 |`==` |Equal to |Left-to-right
474|7 |`!=` |Not equal to |Left-to-right
475|8 |`&&` |Logical AND |Left-to-right
476|9 |`\|\|` |Logical OR |Left-to-right
477|===
478+
479Parentheses are supported to bypass the default order.
480+
481IMPORTANT: Unlike the C{nbsp}language, the bitwise AND and OR operators
482(`&` and `|`) in 'EXPR' take precedence over relational operators (`<`,
483`<=`, `>`, `>=`, `==`, and `!=`). This means the expression `2 & 2 == 2`
484is _true_ while the equivalent C{nbsp}expression is _false_.
485+
486The arithmetic operators are :not: supported.
487+
488LTTng first casts all integer constants and fields to signed 64-bit
489integers. The representation of negative integers is two's complement.
490This means that, for example, the signed 8-bit integer field 0xff (-1)
491becomes 0xffffffffffffffff (still -1) once casted.
492+
493Before a bitwise operator is applied, LTTng casts all its operands to
494unsigned 64-bit integers, and then casts the result back to a signed
49564-bit integer. For the bitwise NOT operator, it's the equivalent of
496this C{nbsp}expression:
497+
498[source,c]
499----
500(int64_t) ~((uint64_t) val)
501----
502+
503For the binary bitwise operators, it's the equivalent of those
504C{nbsp}expressions:
505+
506[source,c]
507----
508(int64_t) ((uint64_t) lhs >> (uint64_t) rhs)
509(int64_t) ((uint64_t) lhs << (uint64_t) rhs)
510(int64_t) ((uint64_t) lhs & (uint64_t) rhs)
511(int64_t) ((uint64_t) lhs ^ (uint64_t) rhs)
512(int64_t) ((uint64_t) lhs | (uint64_t) rhs)
513----
514+
515If the right-hand side of a bitwise shift operator (`<<` and `>>`) is
516not in the [0,{nbsp}63] range, then 'EXPR' is _false_.
517
518[NOTE]
519====
520Use the man:lttng-track(1) and man:lttng-untrack(1) commands to allow or
521disallow processes to record LTTng events based on their attributes
522instead of using equivalent statically-known context fields in 'EXPR'
523like `$ctx.pid`.
524
525The former method is much more efficient.
526====
527
528'EXPR' examples:
529
530----------------------------
531msg_id == 23 && size >= 2048
532----------------------------
533
534-------------------------------------------------
535$ctx.procname == "lttng*" && (!flag || poel < 34)
536-------------------------------------------------
537
538---------------------------------------------------------
539$app.my_provider:my_context == 17.34e9 || some_enum >= 14
540---------------------------------------------------------
541
542---------------------------------------
543$ctx.cpu_id == 2 && filename != "*.log"
544---------------------------------------
545
546------------------------------------------------
547eax_reg & 0xff7 == 0x240 && x[4] >> 12 <= 0x1234
548------------------------------------------------
549
550
551[[er-name]]
552Event record name
553~~~~~~~~~~~~~~~~~
554When LTTng records an event{nbsp}__E__, the resulting event record has a
555name which depends on the instrumentation point type condition (see the
556``<<inst-point-type-cond,Instrumentation point type condition>>''
557section above) of the recording event rule which matched{nbsp}__E__:
558
559LTTng tracepoint (option:--kernel/option:--userspace and option:--tracepoint options)::
560 Full name of the tracepoint from which LTTng creates{nbsp}__E__.
561+
562Note that the full name of a user space tracepoint is
563__PROVIDER__++:++__NAME__, where __PROVIDER__ is the tracepoint provider
564name and __NAME__ is the tracepoint name.
565
566`java.util.logging` logging statement (option:--jul and option:--tracepoint options)::
567 `lttng_jul:event`
568+
569Such an event record has a string field `logger_name` which contains the
570name of the `java.util.logging` logger from which LTTng
571creates{nbsp}__E__.
572
573Apache log4j logging statement (option:--log4j and option:--tracepoint options)::
574 `lttng_log4j:event`
575+
576Such an event record has a string field `logger_name` which contains the
577name of the Apache log4j logger from which LTTng creates{nbsp}__E__.
578
579Python logging statement (option:--python and option:--tracepoint options)::
580 `lttng_python:event`
581+
582Such an event record has a string field `logger_name` which contains the
583name of the Python logger from which LTTng creates{nbsp}__E__.
584
585Linux system call (option:--kernel and option:--syscall options)::
586 Entry:::
587 ++syscall_entry_++__NAME__, where _NAME_ is the name of the
588 system call from which LTTng creates{nbsp}__E__, without any
589 `sys_` prefix.
590
591 Exit:::
592 ++syscall_exit_++__NAME__, where _NAME_ is the name of the
593 system call from which LTTng creates{nbsp}__E__, without any
594 `sys_` prefix.
595
596Linux kprobe (option:--kernel and option:--probe options)::
597Linux user space probe (option:--kernel and option:--userspace-probe options)::
598 'RECORDNAME' (first non-option argument).
599
600Linux kretprobe (option:--kernel and option:--function options)::
601 Entry:::
602 __RECORDNAME__++_entry++
603
604 Exit:::
605 __RECORDNAME__++_exit++
606
607
608[[enable]]
609Enable a disabled recording event rule
610~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
611The `enable-event` command can enable a disabled recording event rule,
612as listed in the output of the man:lttng-list(1) command.
613
614You may enable a disabled recording event rule regardless of the
615activity (started or stopped) of its recording session (see
616man:lttng-start(1) and man:lttng-stop(1)).
617
618To enable a disabled recording event rule, run the `enable-event`
619command with the exact same options and arguments that you used to
620create it. In particular, with the option:--filter='EXPR' option, 'EXPR'
621must be the exact same string as the one you used on creation.
622
623
624include::common-lttng-cmd-options-head.txt[]
625
626
627Tracing domain
628~~~~~~~~~~~~~~
629One of:
630
631option:-j, option:--jul::
632 Create or enable recording event rules in the `java.util.logging`
633 (JUL) tracing domain.
634
635option:-k, option:--kernel::
636 Create or enable recording event rules in the Linux kernel tracing
637 domain.
638
639option:-l, option:--log4j::
640 Create or enable recording event rules in the Apache log4j tracing
641 domain.
642
643option:-p, option:--python::
644 Create or enable recording event rules in the Python tracing domain.
645
646option:-u, option:--userspace::
647 Create or enable recording event rules in the user space tracing
648 domain.
649
650
651Recording target
652~~~~~~~~~~~~~~~~
653option:-c 'CHANNEL', option:--channel='CHANNEL'::
654 Create or enable recording event rules attached to the channel named
655 'CHANNEL' instead of `channel0`.
656
657option:-s 'SESSION', option:--session='SESSION'::
658 Create or enable recording event rules in the recording session
659 named 'SESSION' instead of the current recording session.
660
661
662Instrumentation point type condition
663~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
664See the ``<<inst-point-type-cond,Instrumentation point type
665condition>>'' section above.
666
667At most one of:
668
669option:--function='LOC'::
670 Only match Linux kretprobe events.
671+
672Only available with the option:--kernel option.
673+
674'LOC' is one of:
675+
676--
677* A function address (`0x` hexadecimal prefix supported).
678* A function symbol name.
679* A function symbol name and an offset
680 (__SYMBOL__++pass:[+]++__OFFSET__ format).
681--
682+
683You must specify the event record name with 'RECORDNAME'. See the
684``<<er-name,Event record name>>'' section above to learn more.
685
686option:--probe='LOC'::
687 Only match Linux kprobe events.
688+
689Only available with the option:--kernel option.
690+
691'LOC' is one of:
692+
693--
694* An address (`0x` hexadecimal prefix supported).
695* A symbol name.
696* A symbol name and an offset (__SYMBOL__++pass:[+]++__OFFSET__ format).
697--
698+
699You must specify the event record name with 'RECORDNAME'. See the
700``<<er-name,Event record name>>'' section above to learn more.
701
702option:--userspace-probe='LOC'::
703 Only match Linux user space probe events.
704+
705Only available with the option:--kernel option.
706+
707'LOC' is one of:
708+
709--
710\[++elf:++]__PATH__++:++__SYMBOL__::
711 Probe an available symbol within a user space application or
712 library.
713+
714--
715'PATH'::
716 Application or library path.
717+
718One of:
719+
720* An absolute path.
721* A relative path.
722* The name of an application as found in the directories listed in the
723 `PATH` environment variable.
724
725'SYMBOL'::
726 Symbol name of the function of which to instrument the entry.
727+
728'SYMBOL' can be any defined code symbol in the output of the man:nm(1)
729command, including with its nloption:--dynamic option, which lists
730dynamic symbols.
731--
732+
733As of LTTng{nbsp}{lttng_version}, not specifying `elf:` is equivalent to
734specifying it, but this default may change in the future.
735+
736Examples:
737+
738* `--userspace-probe=/usr/lib/libc.so.6:malloc`
739* `--userspace-probe=./myapp:createUser`
740* `--userspace-probe=elf:httpd:ap_run_open_htaccess`
741
742++sdt:++__PATH__++:++__PROVIDER__++:++__NAME__::
743 Use a SystemTap User-level Statically Defined Tracing (USDT) probe
744 within a user space application or library.
745+
746--
747'PATH'::
748 Application or library path.
749+
750This can be:
751+
752* An absolute path.
753* A relative path.
754* The name of an application as found in the directories listed in the
755 `PATH` environment variable.
756
757'PROVIDER'::
758'NAME'::
759 USDT provider and probe names.
760+
761For example, with the following USDT probe:
762+
763[source,c]
764----
765DTRACE_PROBE2("server", "accept_request",
766 request_id, ip_addr);
767----
768+
769The provider/probe name pair is `server:accept_request`.
770--
771+
772Example: `--userspace-probe=sdt:./build/server:server:accept_request`
773--
774+
775You must specify the event record name with 'RECORDNAME'. See the
776``<<er-name,Event record name>>'' section above to learn more.
777
778option:--syscall::
779 Only match Linux system call events.
780+
781Only available with the option:--kernel option.
782
783option:--tracepoint::
784 Only match:
785+
786With the option:--kernel or option:--userspace option:::
787 LTTng tracepoint events.
788With the option:--jul, option:--log4j, or option:--python option:::
789 Logging events.
790
791With the option:--kernel, not specifying any of the instrumentation
792point type options is equivalent to specifying the option:--tracepoint
793option, but this default may change in the future.
794
795With the option:--userspace, option:--jul, option:--log4j, and
796option:--python options, not specifying the option:--tracepoint option
797is equivalent to specifying it, but this default may change in the
798future.
799
800
801Event name condition
802~~~~~~~~~~~~~~~~~~~~
803See the ``<<event-name-cond,Event name condition>>'' section above.
804
805option:-a, option:--all::
806 Equivalent to a single 'NAME' argument (LTTng tracepoint or logger
807 name) set to `*` (match anything).
808+
809You may :not: use this option with a 'NAME' argument.
810
811option:-x 'XNAME'[,'XNAME']..., option:--exclude='XNAME'[,'XNAME']...::
812 Only match events of which none of the 'XNAME' arguments
813 matches the full name of the LTTng user space tracepoint.
814+
815Only available with the option:--userspace option.
816+
817'XNAME' is a globbing pattern: the `*` character means ``match
818anything''. To match a literal `*` character, use :escwc:. To match
819a literal `,` character, use :esccomma:.
820
821
822Instrumentation point log level condition
823~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
824See the ``<<inst-point-log-level-cond,Instrumentation point log level
825condition>>'' section above.
826
827At most one of:
828
829option:--loglevel='LOGLEVEL'::
830 Only match events of which the log level of the LTTng tracepoint or
831 logging statement is at least as severe as 'LOGLEVEL'.
832
833option:--loglevel-only='LOGLEVEL'::
834 Only match events of which the log level of the LTTng tracepoint or
835 logging statement is exactly 'LOGLEVEL'.
836
837The instrumentation point log level options above are :not: available
838with the option:--kernel option.
839
840
841Event payload and context filter condition
842~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
843See the ``<<filter-cond,Event payload and context filter condition>>''
844section above.
845
846option:-f 'EXPR', option:--filter='EXPR'::
847 Only match events of which 'EXPR', which can contain references to
848 event payload and current context fields, is _true_.
849+
850This option is only available with the option:--tracepoint or
851option:--syscall option.
852
853
854include::common-lttng-cmd-help-options.txt[]
855
856
857include::common-lttng-cmd-after-options.txt[]
858
859
860[[examples]]
861EXAMPLES
862--------
863.Create a recording event rule which matches all Linux system call events (current recording session, default channel).
864====
865See the option:--all and option:--syscall options.
866
867[role="term"]
868----
869$ lttng enable-event --kernel --all --syscall
870----
871====
872
873.Create a recording event rule which matches user space tracepoint events named specifically (current recording session, default channel).
874====
875The recording event rule below matches all user space tracepoint events
876of which the name starts with `my_provider:msg`.
877
878[role="term"]
879----
880$ lttng enable-event --userspace 'my_provider:msg*'
881----
882====
883
884.Create three recording event rules which match Python logging events named specifically (current recording session, default channel).
885====
886[role="term"]
887----
888$ lttng enable-event --python server3,ui.window,user-mgmt
889----
890====
891
892.Create a recording event rule which matches Apache log4j logging events with a specific log level range (current recording session, specific channel).
893====
894See the option:--channel, option:--all, and option:--loglevel options.
895
896[role="term"]
897----
898$ lttng enable-event --log4j --channel=my-loggers \
899 --all --loglevel=INFO
900----
901====
902
903.Create a recording event rule which matches specific Linux kprobe events (current recording session, default channel).
904====
905The recording event rule below matches the entry of `usb_disconnect()`
906Linux kernel function calls. The records of such events are named `usbd`
907(see the ``<<er-name,Event record name>>'' section above).
908
909See the option:--probe option.
910
911[role="term"]
912----
913$ lttng enable-event --kernel --probe=usb_disconnect usbd
914----
915====
916
917.Create a recording event rule which matches Linux kernel tracepoint events which satisfy an event payload and context filter (specific recording session, default channel).
918====
919See the option:--session and option:--filter options.
920
921[role="term"]
922----
923$ lttng enable-event --kernel --session=my-session 'sched_*' \
924 --filter='$ctx.preemptible && comm != "systemd*"'
925----
926====
927
928.Enable two Linux kernel tracepoint recording event rules (current recording session, specific channel).
929====
930See the option:--channel option.
931
932[role="term"]
933----
934$ lttng enable-event --kernel --channel=tva ja,wendy
935----
936====
937
938
939include::common-footer.txt[]
940
941
942SEE ALSO
943--------
944man:lttng(1),
945man:lttng-disable-event(1),
946man:lttng-enable-channel(1),
947man:lttng-list(1),
948man:lttng-start(1),
949man:lttng-track(1),
950man:lttng-concepts(7)
This page took 0.026975 seconds and 5 git commands to generate.