Rename "tracing session" -> "recording session"
[lttng-tools.git] / doc / man / lttng-track.1.txt
CommitLineData
65226554
PP
1lttng-track(1)
2==============
aaae4813 3:revdate: 14 June 2021
65226554
PP
4
5
6NAME
7----
188419c4 8lttng-track - Allow specific processes to record LTTng events
65226554
PP
9
10
11SYNOPSIS
12--------
188419c4 13Allow specific processes to record Linux kernel events:
de332339
JG
14
15[verse]
188419c4 16*lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *track* option:--kernel [option:--session='SESSION']
de332339 17 (option:--pid=PID[,PID]... | option:--vpid=VPID[,VPID]... |
188419c4
PP
18 option:--uid=UID[,UID]... | option:--vuid=VUSER[,VUSER]... |
19 option:--gid=GID[,GID]... | option:--vgid=VGROUP[,VGROUP]...)...
de332339 20
de332339 21
65226554 22[verse]
188419c4
PP
23*lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *track* option:--kernel [option:--session='SESSION']
24 option:--all (option:--pid | option:--vpid | option:--uid | option:--vuid | option:--gid | option:--vgid)...
de332339 25
188419c4 26Allow specific processes to record user space events:
de332339
JG
27
28[verse]
188419c4
PP
29*lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *track* option:--userspace [option:--session='SESSION']
30 (option:--vpid=VPID[,VPID]... | option:--vuid=VUSER[,VUSER]... |
31 option:--vgid=VGROUP[,VGROUP]...)...
de332339
JG
32
33[verse]
188419c4 34*lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *track* option:--userspace [option:--session='SESSION']
de332339 35 option:--all (option:--vpid | option:--vgid | option:--vuid)...
65226554
PP
36
37
38DESCRIPTION
39-----------
188419c4
PP
40The `lttng track` command allows one or more processes to record LTTng
41events based on their attributes within:
65226554 42
188419c4 43With the option:--session='SESSION' option::
aaae4813 44 The recording session named 'SESSION'.
65226554 45
188419c4 46Without the option:--session option::
aaae4813
PP
47 The current recording session (see man:lttng-concepts(7) to learn
48 more about the current recording session).
65226554 49
aaae4813 50See man:lttng-concepts(7) to learn more about recording sessions and
188419c4 51recording event rules.
9bd01b5e 52
188419c4 53The `track` command adds values to _inclusion sets_ of process
aaae4813 54attributes. The available inclusion sets are, for a given recording
188419c4 55session:
65226554 56
188419c4
PP
57With the option:--kernel option::
58+
59* Process ID (PID).
de332339 60
188419c4
PP
61* Virtual process ID (VPID).
62+
63This is the PID as seen by the application.
65226554 64
188419c4 65* Unix user ID (UID).
65226554 66
188419c4
PP
67* Virtual Unix user ID (VUID).
68+
69This is the UID as seen by the application.
70
71* Unix group ID (GID).
72
73* Virtual Unix group ID (VGID).
74+
75This is the GID as seen by the application.
76
77With the option:--userspace option::
78+
79* VPID
80* VUID
81* VGID
82
83When an event{nbsp}__E__ satisfies all the other explicit and implicit
84conditions of an event rule{nbsp}__ER__, __ER__ matches{nbsp}__E__ if
85the attributes of the process for which LTTng creates{nbsp}__E__ are
aaae4813 86*all* part of the inclusion sets of the recording session and domain
188419c4
PP
87of{nbsp}__ER__.
88
aaae4813 89By default, on recording session creation (see man:lttng-create(1)),
188419c4 90all processes are allowed to record events. In other words, all the
aaae4813 91inclusion sets of the recording session contain all the possible
188419c4
PP
92process attribute values.
93
94If a given inclusion set{nbsp}__IS__ contains all the possible values
95(option:--all option), then using the `track` command to add one or more
96values{nbsp}__V__ to{nbsp}__IS__:
97
98. Removes all the values from{nbsp}__IS__.
99+
100This effectively makes{nbsp}__IS__ empty.
101
102. Adds{nbsp}__V__ to{nbsp}__IS__.
103
104Example: with the PID inclusion set, you can record all the system calls
105of a given process:
de332339
JG
106
107[role="term"]
108----
109$ lttng enable-event --kernel --all --syscall
110$ lttng track --kernel --pid=2345
111$ lttng start
112----
113
7d259724 114See the ``<<examples,EXAMPLES>>'' section below for usage examples.
e6e048b3 115
188419c4
PP
116Remove values from an inclusion set with the man:lttng-untrack(1)
117command.
65226554
PP
118
119
188419c4
PP
120Inclusion set example
121~~~~~~~~~~~~~~~~~~~~~
122This example operates on the Linux kernel process ID (PID) inclusion set
aaae4813 123of the current recording session to show how an inclusion set works.
65226554 124
188419c4 125Assume the maximum system PID is 7 for this example.
65226554 126
188419c4
PP
127. Initial inclusion set:
128+
65226554
PP
129-------------------------------
130[0] [1] [2] [3] [4] [5] [6] [7]
131-------------------------------
132
188419c4
PP
133. Command:
134+
d4f093aa 135[role="term"]
03c5529d 136----
de332339 137$ lttng track --kernel --pid=3,6,7
03c5529d 138----
188419c4
PP
139+
140Inclusion set is now:
141+
65226554
PP
142-------------------------------
143[ ] [ ] [ ] [3] [ ] [ ] [6] [7]
144-------------------------------
145
188419c4
PP
146. Command:
147+
d4f093aa 148[role="term"]
03c5529d 149----
de332339 150$ lttng untrack --kernel --pid=7
03c5529d 151----
188419c4
PP
152+
153Inclusion set is now:
154+
65226554
PP
155-------------------------------
156[ ] [ ] [ ] [3] [ ] [ ] [6] [ ]
157-------------------------------
158
188419c4
PP
159. Command:
160+
d4f093aa 161[role="term"]
03c5529d 162----
de332339 163$ lttng track --kernel --pid=1,5
03c5529d 164----
188419c4
PP
165+
166Inclusion set is now:
167+
65226554
PP
168-------------------------------
169[ ] [1] [ ] [3] [ ] [5] [6] [ ]
170-------------------------------
171
188419c4
PP
172Remove values from an inclusion set with the man:lttng-untrack(1)
173command.
65226554
PP
174
175
55e06994 176include::common-lttng-cmd-options-head.txt[]
65226554
PP
177
178
188419c4
PP
179Tracing domain
180~~~~~~~~~~~~~~
65226554
PP
181One of:
182
183option:-k, option:--kernel::
188419c4 184 Add values to one or more Linux kernel inclusion sets.
65226554
PP
185
186option:-u, option:--userspace::
188419c4 187 Add values to one or more user space inclusion sets.
65226554 188
188419c4
PP
189Recording target
190~~~~~~~~~~~~~~~~
59b19c3c 191option:-s 'SESSION', option:--session='SESSION'::
aaae4813
PP
192 Add values to one or more inclusion sets of the recording session
193 named 'SESSION' instead of the current recording session.
65226554
PP
194
195
188419c4
PP
196Inclusion set selection
197~~~~~~~~~~~~~~~~~~~~~~~
59b19c3c 198option:-p ['PID'[,'PID']...], option:--pid[='PID'[,'PID']...]::
188419c4 199 For each 'PID' argument, add 'PID' to the process ID inclusion set
aaae4813 200 of the selected recording session and domain.
de332339 201+
188419c4
PP
202'PID' is the process ID attribute of a process as seen from the root
203PID namespace (see man:pid_namespaces(7)).
65226554 204+
188419c4 205Only available with option:--kernel option.
65226554 206
de332339 207option:--vpid[='VPID'[,'VPID']...]::
188419c4 208 For each 'VPID' argument, add 'VPID' to the virtual process ID
aaae4813 209 inclusion set of the selected recording session and domain.
de332339
JG
210+
211'VPID' is the virtual process ID attribute of a process as seen from
188419c4 212the PID namespace of the process (see man:pid_namespaces(7)).
9bd01b5e 213
de332339 214option:--uid[='USER'[,'USER']...]::
188419c4 215 For each 'USER' argument, add 'USER' to the user ID inclusion set of
aaae4813 216 the selected recording session and domain.
de332339 217+
188419c4 218'USER' is either:
de332339 219+
188419c4
PP
220--
221* The real user ID (see man:getuid(3)) of a process as seen
222 from the root user namespace (see man:user_namespaces(7)).
223
224* A user name.
225+
226The connected LTTng session daemon (see man:lttng-sessiond(8)) performs
227the user name resolution on addition to the user ID inclusion set.
228--
9bd01b5e 229+
188419c4 230Only available with option:--kernel option.
9bd01b5e 231
188419c4
PP
232option:--vuid[='VUSER'[,'VUSER']...]::
233 For each 'VUSER' argument, add 'VUSER' to the virtual user ID
aaae4813 234 inclusion set of the selected recording session and domain.
9bd01b5e 235+
188419c4 236'VUSER' is either:
de332339 237+
188419c4
PP
238--
239* The real user ID (see man:getuid(3)) of a process as seen
240 from the user namespace (see man:user_namespaces(7)).
241
242* A user name.
de332339 243+
188419c4
PP
244The connected LTTng session daemon (see man:lttng-sessiond(8)) performs
245the user name resolution on addition to the virtual user ID inclusion
246set.
247--
9bd01b5e 248
de332339 249option:--gid[='GROUP'[,'GROUP']...]::
188419c4 250 For each 'GROUP' argument, add 'GROUP' to the group ID
aaae4813 251 inclusion set of the selected recording session and domain.
de332339 252+
188419c4 253'GROUP' is either:
9bd01b5e 254+
188419c4
PP
255--
256* The real group ID (see man:getgid(3)) of a process as seen from the
257 root user namespace (see man:user_namespaces(7)).
258
259* A group name.
260+
261The connected LTTng session daemon (see man:lttng-sessiond(8)) performs
262the group name resolution on addition to the group ID inclusion set.
263--
de332339 264+
188419c4 265Only available with option:--kernel option.
9bd01b5e 266
188419c4
PP
267option:--vgid[='VGROUP'[,'VGROUP']...]::
268 For each 'VGROUP' argument, add 'VGROUP' to the virtual group ID
aaae4813 269 inclusion set of the selected recording session and domain.
de332339 270+
188419c4 271'VGROUP' is either:
de332339 272+
188419c4
PP
273--
274* The real group ID (see man:getgid(3)) of a process as seen
275 from the user namespace (see man:user_namespaces(7)).
276
277* A group name.
9bd01b5e 278+
188419c4
PP
279The connected LTTng session daemon (see man:lttng-sessiond(8)) performs
280the group name resolution on addition to the virtual group ID inclusion
281set.
282--
283
284
285Inclusion set operation
286~~~~~~~~~~~~~~~~~~~~~~~
287option:-a, option:--all::
288 With one or more empty option:--pid, option:--vpid, option:--uid,
289 option:--vuid, option:--gid, and option:--vgid options: add *all*
290 the possible values to the selected inclusion sets.
9bd01b5e 291
65226554 292
55e06994 293include::common-lttng-cmd-help-options.txt[]
65226554
PP
294
295
55e06994
PP
296include::common-lttng-cmd-after-options.txt[]
297
298
e6e048b3
PP
299[[examples]]
300EXAMPLES
301--------
aaae4813 302.Add the PIDs 1728 and 3775 to the Linux kernel process ID inclusion set of the current recording session.
e6e048b3
PP
303====
304See the option:--pid option.
305
306[role="term"]
307----
308$ lttng track --kernel --pid=1728,3775
309----
310====
311
aaae4813 312.Add the ID of a specific user to the user space virtual user ID inclusion set of a specific recording session.
e6e048b3
PP
313====
314See the option:--vuid and option:--session options.
315
316[role="term"]
317----
318$ lttng track --userspace --session=my-session --vuid=http
319----
320====
321
aaae4813 322.Add all the possible group IDs to the Linux kernel group ID inclusion set of the current recording session.
e6e048b3
PP
323====
324See the option:--all and option:--gid options.
325
326[role="term"]
327----
328$ lttng track --kernel --all --gid
329----
330====
331
332
55e06994 333include::common-footer.txt[]
65226554
PP
334
335
336SEE ALSO
337--------
188419c4 338man:lttng(1),
21b35b3a
PP
339man:lttng-untrack(1),
340man:lttng-concepts(7)
This page took 0.063243 seconds and 5 git commands to generate.