8 lttng-add-context - Add context fields to be recorded by LTTng
13 Add context fields to be recorded to the LTTng event records of
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 adds one or more context fields to be
31 recorded to the event records of a given channel, or of all the channels
32 of a selected tracing session, by LTTng.
34 See man:lttng-enable-channel(1) to learn more about LTTng channels.
36 When you use the `add-context` command to add context fields for a given
37 channel, all the event records which LTTng writes to a sub-buffer of
38 that channel contain the dynamic values of those context fields.
40 Without the option:--session option, the `add-context` command selects
41 the current tracing session (see man:lttng-create(1) and
42 man:lttng-set-session(1) to learn more about the current tracing
45 Without the option:--channel option, LTTng adds context fields to be
46 recorded to the event records of *all* the channels of the selected
49 Repeat the option:--type option to add more than one context field to be
52 perf counter context fields are available:
57 Only available for Linux kernel (option:--kernel option) channels.
60 Prefix: `perf:thread:`.
62 Only available for user application/library (option:--userspace,
63 option:--jul, and option:--log4j options) channels.
65 Add PMU counter context fields by raw ID with the
66 ++perf:cpu:raw:r++__N__++:++__NAME__ (Linux kernel tracing domain) or
67 ++perf:thread:raw:r++__N__++:++__NAME__ (user space tracing domain)
71 A hexadecimal event descriptor which follows the man:perf-record(1)
72 format: a concatenation of the event number and umask value which
73 the manufacturer of the processor provides.
75 The possible values for this field are processor-specific.
78 Custom name to easily recognize the counter.
80 Add an application-specific context field with the following syntax:
83 $app.'PROVIDER':__TYPE__
91 NOTE: Make sure to **single-quote** the argument of the option:--type
92 option when you run the `add-context` command from a shell, as `$` is a
93 special character for variable substitution in most shells.
95 List the available context field types with the option:--list option and
96 without other arguments.
98 NOTE: As of LTTng{nbsp}{lttng_version}, you may :not: add context
99 fields to be recorded to the event records of a given channel once its
100 tracing session has been started (see man:lttng-start(1)) at least once.
103 include::common-cmd-options-head.txt[]
110 option:-j, option:--jul::
111 Add context fields to be recorded to the event records of one or
112 more channels of the `java.util.logging` (JUL) tracing domain.
114 option:-k, option:--kernel::
115 Add context fields to be recorded to the event records of one or
116 more channels of the Linux kernel tracing domain.
118 option:-l, option:--log4j::
119 Add context fields to be recorded to the event records of one or
120 more channels of the Apache log4j tracing domain.
122 option:-u, option:--userspace::
123 Add context fields to be recorded to the event records of one or
124 more channels of the user space tracing domain.
129 option:-c 'CHANNEL', option:--channel='CHANNEL'::
130 Add context fields to be recorded to the event records of a channel
131 named 'CHANNEL' instead of all the channels of the selected
134 option:-s 'SESSION', option:--session='SESSION'::
135 Add context fields to be recorded to the event records of one or
136 more channels of the tracing session named 'SESSION' instead of the
137 current tracing session.
143 List the available context field types.
145 You may :not: use this option with the option:--channel,
146 option:--session, or option:--type options.
148 option:-t 'TYPE', option:--type='TYPE'::
149 Add a context field having the type 'TYPE' to be recorded.
151 Repeat this option to add more than one context field.
154 include::common-cmd-help-options.txt[]
157 include::common-cmd-footer.txt[]
163 man:lttng-enable-channel(1),
164 man:lttng-set-session(1)