doc/man/manpage.xsl: do not indent the title of an admonition block
[lttng-tools.git] / doc / man / lttng-add-context.1.txt
... / ...
CommitLineData
1lttng-add-context(1)
2====================
3:revdate: 8 April 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 LTTng event records of
14one or more channels:
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 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'::
78 Custom name to easily recognize the counter.
79
80Add an application-specific context field with the following syntax:
81
82[verse]
83$app.'PROVIDER':__TYPE__
84
85'PROVIDER'::
86 Provider name.
87
88'TYPE'::
89 Context type name.
90
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.
94
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.
101
102
103include::common-cmd-options-head.txt[]
104
105
106Tracing domain
107~~~~~~~~~~~~~~
108One of:
109
110option:-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.
113
114option:-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.
117
118option:-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.
121
122option:-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.
125
126
127Recording target
128~~~~~~~~~~~~~~~~
129option:-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
132 tracing session.
133
134option:-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.
138
139
140Context field type
141~~~~~~~~~~~~~~~~~~
142option:--list::
143 List the available context field types.
144+
145You may :not: use this option with the option:--channel,
146option:--session, or option:--type options.
147
148option:-t 'TYPE', option:--type='TYPE'::
149 Add a context field having the type 'TYPE' to be recorded.
150+
151Repeat this option to add more than one context field.
152
153
154include::common-cmd-help-options.txt[]
155
156
157include::common-cmd-footer.txt[]
158
159
160SEE ALSO
161--------
162man:lttng(1),
163man:lttng-enable-channel(1),
164man:lttng-set-session(1)
This page took 0.029078 seconds and 4 git commands to generate.