doc/man: use double quotes when referring to internal section
[lttng-tools.git] / doc / man / lttng-add-context.1.txt
... / ...
CommitLineData
1lttng-add-context(1)
2====================
3:revdate: 6 May 2021
4
5
6NAME
7----
8lttng-add-context - Add context fields to be recorded by LTTng
9
10
11SYNOPSIS
12--------
13Add context fields to be recorded to the event records of one or more
14channels:
15
16[verse]
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']...
21
22List the available context field types:
23
24[verse]
25*lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *add-context* option:--list
26
27
28DESCRIPTION
29-----------
30The `lttng add-context` command can:
31
32Without the option:--list option::
33 Add one or more context fields to be recorded by LTTng to the event
34 records of:
35+
36With the option:--session='SESSION' option:::
37 The tracing session named 'SESSION'.
38
39Without the option:--session option:::
40 The current tracing session (see man:lttng-concepts(7) to learn more
41 about the current tracing session).
42
43With the option:--channel='CHANNEL':::
44 The channel named 'CHANNEL'.
45
46Without the option:--channel option:::
47 *All* the channels of the selected tracing session.
48
49With the option:--list option::
50 List the available context field types.
51
52See man:lttng-concepts(7) to learn more about tracing sessions and
53channels.
54
55Repeat the option:--type='TYPE' option to add more than one context
56field to be recorded. 'TYPE' is one of:
57
58* A statically-known, or built-in context field named.
59
60* A perf counter name:
61+
62--
63Per-CPU::
64 Prefix: `perf:cpu:`
65+
66Only available with the option:--kernel option.
67
68Per-thread::
69 Prefix: `perf:thread:`
70+
71Only available with the option:--userspace, option:--jul, or
72option:--log4j option.
73--
74+
75Add Performance Monitoring Unit (PMU) counter context fields by raw ID
76with the ++perf:cpu:raw:r++__N__++:++__NAME__ (option:--kernel option)
77or ++perf:thread:raw:r++__N__++:++__NAME__ (option:--userspace,
78option:--jul, or option:--log4j option) types, with:
79+
80--
81'N'::
82 A hexadecimal event descriptor which follows the man:perf-record(1)
83 format: a concatenation of the event number and umask value which
84 the manufacturer of the processor provides.
85+
86The possible values for this part are processor-specific.
87
88'NAME'::
89 Custom name to identify the counter.
90--
91
92* An LTTng application-specific context field name:
93+
94--
95[verse]
96$app.'PROVIDER':__TYPE__
97+
98'PROVIDER'::
99 Provider name.
100
101'TYPE'::
102 Context type name.
103--
104+
105Only available with the option:--jul and option:--log4j options.
106
107IMPORTANT: Make sure to **single-quote** 'TYPE' when you run the
108`add-context` command from a shell, as `$` is a special character for
109variable substitution in most shells.
110
111NOTE: As of LTTng{nbsp}{lttng_version}, you may :not: add context fields
112to be recorded to the event records of a given channel once its tracing
113session has been started (see man:lttng-start(1)) at least once.
114
115See the ``<<examples,EXAMPLES>>'' section below for usage examples.
116
117
118include::common-lttng-cmd-options-head.txt[]
119
120
121Tracing domain
122~~~~~~~~~~~~~~
123One of:
124
125option:-j, option:--jul::
126 Add context fields to be recorded to the event records of one or
127 more channels of the `java.util.logging` (JUL) tracing domain.
128
129option:-k, option:--kernel::
130 Add context fields to be recorded to the event records of one or
131 more channels of the Linux kernel tracing domain.
132
133option:-l, option:--log4j::
134 Add context fields to be recorded to the event records of one or
135 more channels of the Apache log4j tracing domain.
136
137option:-u, option:--userspace::
138 Add context fields to be recorded to the event records of one or
139 more channels of the user space tracing domain.
140
141
142Recording target
143~~~~~~~~~~~~~~~~
144option:-c 'CHANNEL', option:--channel='CHANNEL'::
145 Add context fields to be recorded to the event records of a channel
146 named 'CHANNEL' instead of all the channels of the selected
147 tracing session.
148
149option:-s 'SESSION', option:--session='SESSION'::
150 Add context fields to be recorded to the event records of one or
151 more channels of the tracing session named 'SESSION' instead of the
152 current tracing session.
153
154
155Context field type
156~~~~~~~~~~~~~~~~~~
157option:--list::
158 List the available context field types.
159+
160You may :not: use this option with the option:--channel,
161option:--session, or option:--type options.
162
163option:-t 'TYPE', option:--type='TYPE'::
164 Add a context field having the type 'TYPE' to be recorded.
165+
166Repeat this option to add more than one context field.
167
168
169include::common-lttng-cmd-help-options.txt[]
170
171
172include::common-lttng-cmd-after-options.txt[]
173
174
175[[examples]]
176EXAMPLES
177--------
178.List the available context field types.
179====
180See the option:--list option.
181
182[role="term"]
183----
184$ lttng add-context --list
185----
186====
187
188.Add a single statically-known context field to be recorded to all the Linux kernel channels of the current tracing session.
189====
190[role="term"]
191----
192$ lttng add-context --kernel --type=pid
193----
194====
195
196.Add three statically-known context fields to be recorded to a specific user space channel of a specific tracing session.
197====
198See the option:--session and option:--channel options.
199
200[role="term"]
201----
202$ lttng add-context --userspace --session=my-session \
203 --channel=my-channel \
204 --type=vpid --type=procname --type=ip
205----
206====
207
208.Add a perf counter context field to be recorded to a specific Linux kernel channel of the current tracing session.
209====
210See the option:--channel option.
211
212[role="term"]
213----
214$ lttng add-context --kernel --channel=my-channel \
215 --type=perf:cpu:cache-misses
216----
217====
218
219.Add an LTTng application-specific context field to be recorded to all the JUL channels of the current tracing session.
220====
221[role="term"]
222----
223$ lttng add-context --jul --type='$app.my_server:user_cnt'
224----
225====
226
227
228include::common-footer.txt[]
229
230
231SEE ALSO
232--------
233man:lttng(1),
234man:lttng-enable-channel(1),
235man:lttng-concepts(7)
This page took 0.023124 seconds and 4 git commands to generate.