Update the remaining manual pages for LTTng-tools 2.13
[lttng-tools.git] / doc / man / lttng-add-context.1.txt
CommitLineData
2e4886b8
PP
1lttng-add-context(1)
2====================
26f0c779 3:revdate: 3 May 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--------
26f0c779
PP
13Add context fields to be recorded to the event records of one or more
14channels:
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-----------
26f0c779 30The `lttng add-context` command can:
484b2a0c 31
26f0c779
PP
32Without 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:
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).
484b2a0c 42
26f0c779
PP
43With the option:--list option::
44 List the available context field types.
484b2a0c 45
26f0c779
PP
46See man:lttng-concepts(7) to learn more about tracing sessions and
47channels.
484b2a0c
PP
48
49Without the option:--channel option, LTTng adds context fields to be
50recorded to the event records of *all* the channels of the selected
51tracing session.
52
26f0c779
PP
53Repeat the option:--type='TYPE' option to add more than one context
54field to be recorded. 'TYPE' is one of:
484b2a0c 55
26f0c779 56* A statically-known, or built-in context field named.
484b2a0c 57
26f0c779
PP
58* A perf counter name:
59+
60--
484b2a0c 61Per-CPU::
26f0c779 62 Prefix: `perf:cpu:`
484b2a0c 63+
26f0c779 64Only available with the option:--kernel option.
484b2a0c
PP
65
66Per-thread::
26f0c779 67 Prefix: `perf:thread:`
484b2a0c 68+
26f0c779
PP
69Only available with the option:--userspace, option:--jul, or
70option:--log4j option.
71--
72+
73Add Performance Monitoring Unit (PMU) counter context fields by raw ID
74with the ++perf:cpu:raw:r++__N__++:++__NAME__ (option:--kernel option)
75or ++perf:thread:raw:r++__N__++:++__NAME__ (option:--userspace,
76option:--jul, or option:--log4j option) types, with:
77+
78--
484b2a0c
PP
79'N'::
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.
83+
26f0c779 84The possible values for this part are processor-specific.
484b2a0c
PP
85
86'NAME'::
26f0c779
PP
87 Custom name to identify the counter.
88--
2e4886b8 89
26f0c779
PP
90* An LTTng application-specific context field name:
91+
2e4886b8
PP
92[verse]
93$app.'PROVIDER':__TYPE__
26f0c779 94+
2e4886b8
PP
95'PROVIDER'::
96 Provider name.
97
98'TYPE'::
99 Context type name.
100
26f0c779
PP
101IMPORTANT: Make sure to **single-quote** 'TYPE' when you run the
102`add-context` command from a shell, as `$` is a special character for
103variable substitution in most shells.
484b2a0c 104
26f0c779
PP
105NOTE: As of LTTng{nbsp}{lttng_version}, you may :not: add context fields
106to be recorded to the event records of a given channel once its tracing
107session has been started (see man:lttng-start(1)) at least once.
2e4886b8
PP
108
109
110include::common-cmd-options-head.txt[]
111
112
484b2a0c
PP
113Tracing domain
114~~~~~~~~~~~~~~
2e4886b8
PP
115One of:
116
117option:-j, option:--jul::
484b2a0c
PP
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.
2e4886b8
PP
120
121option:-k, option:--kernel::
484b2a0c
PP
122 Add context fields to be recorded to the event records of one or
123 more channels of the Linux kernel tracing domain.
2e4886b8
PP
124
125option:-l, option:--log4j::
484b2a0c
PP
126 Add context fields to be recorded to the event records of one or
127 more channels of the Apache log4j tracing domain.
2e4886b8
PP
128
129option:-u, option:--userspace::
484b2a0c
PP
130 Add context fields to be recorded to the event records of one or
131 more channels of the user space tracing domain.
2e4886b8
PP
132
133
484b2a0c
PP
134Recording target
135~~~~~~~~~~~~~~~~
59b19c3c 136option:-c 'CHANNEL', option:--channel='CHANNEL'::
484b2a0c
PP
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
139 tracing session.
2e4886b8 140
59b19c3c 141option:-s 'SESSION', option:--session='SESSION'::
484b2a0c
PP
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.
2e4886b8
PP
145
146
484b2a0c
PP
147Context field type
148~~~~~~~~~~~~~~~~~~
2e4886b8 149option:--list::
484b2a0c
PP
150 List the available context field types.
151+
152You may :not: use this option with the option:--channel,
153option:--session, or option:--type options.
2e4886b8 154
59b19c3c 155option:-t 'TYPE', option:--type='TYPE'::
484b2a0c
PP
156 Add a context field having the type 'TYPE' to be recorded.
157+
158Repeat this option to add more than one context field.
2e4886b8
PP
159
160
161include::common-cmd-help-options.txt[]
162
163
164include::common-cmd-footer.txt[]
165
166
167SEE ALSO
168--------
484b2a0c 169man:lttng(1),
26f0c779
PP
170man:lttng-concepts(7),
171man:lttng-enable-channel(1)
This page took 0.039816 seconds and 4 git commands to generate.