8 lttng-add-context - Add context fields to be recorded by LTTng
13 Add context fields to be recorded to the event records of one or more
17 *lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *add-context*
18 (option:--kernel | option:--userspace | option:--jul | option:--log4j)
19 [option:--session='SESSION'] [option:--channel='CHANNEL']
20 option:--type='TYPE' [option:--type='TYPE']...
22 List the available context field types:
25 *lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *add-context* option:--list
30 The `lttng add-context` command can:
32 Without the option:--list option::
33 Add one or more context fields to be recorded by LTTng to the event
34 records of a given channel, or of all the channels of:
36 With the option:--session='SESSION' option:::
37 The tracing session named 'SESSION'.
39 Without the option:--session option:::
40 The current tracing session (see man:lttng-concepts(7) to learn more
41 about the current tracing session).
43 With the option:--list option::
44 List the available context field types.
46 See man:lttng-concepts(7) to learn more about tracing sessions and
49 Without the option:--channel option, LTTng adds context fields to be
50 recorded to the event records of *all* the channels of the selected
53 Repeat the option:--type='TYPE' option to add more than one context
54 field to be recorded. 'TYPE' is one of:
56 * A statically-known, or built-in context field named.
58 * A perf counter name:
64 Only available with the option:--kernel option.
67 Prefix: `perf:thread:`
69 Only available with the option:--userspace, option:--jul, or
70 option:--log4j option.
73 Add Performance Monitoring Unit (PMU) counter context fields by raw ID
74 with the ++perf:cpu:raw:r++__N__++:++__NAME__ (option:--kernel option)
75 or ++perf:thread:raw:r++__N__++:++__NAME__ (option:--userspace,
76 option:--jul, or option:--log4j option) types, with:
80 A hexadecimal event descriptor which follows the man:perf-record(1)
81 format: a concatenation of the event number and umask value which
82 the manufacturer of the processor provides.
84 The possible values for this part are processor-specific.
87 Custom name to identify the counter.
90 * An LTTng application-specific context field name:
93 $app.'PROVIDER':__TYPE__
101 IMPORTANT: Make sure to **single-quote** 'TYPE' when you run the
102 `add-context` command from a shell, as `$` is a special character for
103 variable substitution in most shells.
105 NOTE: As of LTTng{nbsp}{lttng_version}, you may :not: add context fields
106 to be recorded to the event records of a given channel once its tracing
107 session has been started (see man:lttng-start(1)) at least once.
110 include::common-cmd-options-head.txt[]
117 option:-j, option:--jul::
118 Add context fields to be recorded to the event records of one or
119 more channels of the `java.util.logging` (JUL) tracing domain.
121 option:-k, option:--kernel::
122 Add context fields to be recorded to the event records of one or
123 more channels of the Linux kernel tracing domain.
125 option:-l, option:--log4j::
126 Add context fields to be recorded to the event records of one or
127 more channels of the Apache log4j tracing domain.
129 option:-u, option:--userspace::
130 Add context fields to be recorded to the event records of one or
131 more channels of the user space tracing domain.
136 option:-c 'CHANNEL', option:--channel='CHANNEL'::
137 Add context fields to be recorded to the event records of a channel
138 named 'CHANNEL' instead of all the channels of the selected
141 option:-s 'SESSION', option:--session='SESSION'::
142 Add context fields to be recorded to the event records of one or
143 more channels of the tracing session named 'SESSION' instead of the
144 current tracing session.
150 List the available context field types.
152 You may :not: use this option with the option:--channel,
153 option:--session, or option:--type options.
155 option:-t 'TYPE', option:--type='TYPE'::
156 Add a context field having the type 'TYPE' to be recorded.
158 Repeat this option to add more than one context field.
161 include::common-cmd-help-options.txt[]
164 include::common-cmd-footer.txt[]
170 man:lttng-enable-channel(1),
171 man:lttng-concepts(7)