doc/man/manpage.xsl: do not indent the title of an admonition block
[lttng-tools.git] / doc / man / lttng-add-context.1.txt
CommitLineData
2e4886b8
PP
1lttng-add-context(1)
2====================
484b2a0c 3:revdate: 8 April 2021
2e4886b8
PP
4
5
6NAME
7----
484b2a0c 8lttng-add-context - Add context fields to be recorded by LTTng
2e4886b8
PP
9
10
11SYNOPSIS
12--------
484b2a0c
PP
13Add context fields to be recorded to the LTTng event records of
14one or more channels:
2e4886b8
PP
15
16[verse]
ce19b9ed 17*lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *add-context*
2e4886b8
PP
18 (option:--kernel | option:--userspace | option:--jul | option:--log4j)
19 [option:--session='SESSION'] [option:--channel='CHANNEL']
20 option:--type='TYPE' [option:--type='TYPE']...
21
484b2a0c 22List the available context field types:
2e4886b8
PP
23
24[verse]
d1cff337 25*lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *add-context* option:--list
2e4886b8
PP
26
27
28DESCRIPTION
29-----------
484b2a0c
PP
30The `lttng add-context` command adds one or more context fields to be
31recorded to the event records of a given channel, or of all the channels
32of a selected tracing session, by LTTng.
33
34See man:lttng-enable-channel(1) to learn more about LTTng channels.
35
36When you use the `add-context` command to add context fields for a given
37channel, all the event records which LTTng writes to a sub-buffer of
38that channel contain the dynamic values of those context fields.
39
40Without the option:--session option, the `add-context` command selects
41the current tracing session (see man:lttng-create(1) and
42man:lttng-set-session(1) to learn more about the current tracing
43session).
44
45Without the option:--channel option, LTTng adds context fields to be
46recorded to the event records of *all* the channels of the selected
47tracing session.
48
49Repeat the option:--type option to add more than one context field to be
50recorded.
51
52perf counter context fields are available:
53
54Per-CPU::
55 Prefix: `perf:cpu:`.
56+
57Only available for Linux kernel (option:--kernel option) channels.
58
59Per-thread::
60 Prefix: `perf:thread:`.
61+
62Only available for user application/library (option:--userspace,
63option:--jul, and option:--log4j options) channels.
64
65Add 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)
68types, with:
69
70'N'::
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.
74+
75The possible values for this field are processor-specific.
76
77'NAME'::
954eb3bf 78 Custom name to easily recognize the counter.
4fe444da 79
484b2a0c 80Add an application-specific context field with the following syntax:
2e4886b8
PP
81
82[verse]
83$app.'PROVIDER':__TYPE__
84
2e4886b8
PP
85'PROVIDER'::
86 Provider name.
87
88'TYPE'::
89 Context type name.
90
484b2a0c
PP
91NOTE: Make sure to **single-quote** the argument of the option:--type
92option when you run the `add-context` command from a shell, as `$` is a
93special character for variable substitution in most shells.
60f7980c 94
484b2a0c
PP
95List the available context field types with the option:--list option and
96without other arguments.
97
98NOTE: As of LTTng{nbsp}{lttng_version}, you may :not: add context
99fields to be recorded to the event records of a given channel once its
100tracing session has been started (see man:lttng-start(1)) at least once.
2e4886b8
PP
101
102
103include::common-cmd-options-head.txt[]
104
105
484b2a0c
PP
106Tracing domain
107~~~~~~~~~~~~~~
2e4886b8
PP
108One of:
109
110option:-j, option:--jul::
484b2a0c
PP
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.
2e4886b8
PP
113
114option:-k, option:--kernel::
484b2a0c
PP
115 Add context fields to be recorded to the event records of one or
116 more channels of the Linux kernel tracing domain.
2e4886b8
PP
117
118option:-l, option:--log4j::
484b2a0c
PP
119 Add context fields to be recorded to the event records of one or
120 more channels of the Apache log4j tracing domain.
2e4886b8
PP
121
122option:-u, option:--userspace::
484b2a0c
PP
123 Add context fields to be recorded to the event records of one or
124 more channels of the user space tracing domain.
2e4886b8
PP
125
126
484b2a0c
PP
127Recording target
128~~~~~~~~~~~~~~~~
59b19c3c 129option:-c 'CHANNEL', option:--channel='CHANNEL'::
484b2a0c
PP
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
132 tracing session.
2e4886b8 133
59b19c3c 134option:-s 'SESSION', option:--session='SESSION'::
484b2a0c
PP
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.
2e4886b8
PP
138
139
484b2a0c
PP
140Context field type
141~~~~~~~~~~~~~~~~~~
2e4886b8 142option:--list::
484b2a0c
PP
143 List the available context field types.
144+
145You may :not: use this option with the option:--channel,
146option:--session, or option:--type options.
2e4886b8 147
59b19c3c 148option:-t 'TYPE', option:--type='TYPE'::
484b2a0c
PP
149 Add a context field having the type 'TYPE' to be recorded.
150+
151Repeat this option to add more than one context field.
2e4886b8
PP
152
153
154include::common-cmd-help-options.txt[]
155
156
157include::common-cmd-footer.txt[]
158
159
160SEE ALSO
161--------
484b2a0c
PP
162man:lttng(1),
163man:lttng-enable-channel(1),
164man:lttng-set-session(1)
This page took 0.037629 seconds and 4 git commands to generate.