1LTTNG(1)                         LTTng Manual                         LTTNG(1)
2
3
4

NAME

6       lttng - Control LTTng tracing
7

SYNOPSIS

9       lttng [--group=GROUP] [--mi=xml] [--no-sessiond | --sessiond-path=PATH]
10             [--relayd-path=PATH] [--quiet | -verbose...]
11             COMMAND [COMMAND OPTIONS]
12

DESCRIPTION

14       The Linux Trace Toolkit: next generation <https://lttng.org/> is an
15       open-source software package used for correlated tracing of the Linux
16       kernel, user applications, and user libraries.
17
18       LTTng consists of Linux kernel modules (for Linux kernel tracing) and
19       dynamically loaded libraries (for user application and library
20       tracing).
21
22       The lttng command-line tool, as well as any user application linked
23       with the LTTng control library (liblttng-ctl), sends commands to a
24       listening LTTng session daemon (lttng-sessiond(8)). A session daemon:
25
26       •   Manages recording sessions (see lttng-concepts(7) to learn more
27           about recording sessions).
28
29       •   Controls the various components (like tracers and consumer daemons)
30           of LTTng.
31
32       •   Sends asynchronous notifications to user applications.
33
34       By default, the lttng-create(1) command automatically spawns:
35
36       •   A session daemon for your Unix user if none is currently running.
37
38           Override the path of the session daemon binary to spawn with the
39           --sessiond-path option.
40
41           Avoid automatically spawning a session daemon with the --no-
42           sessiond option.
43
44       •   A relay daemon (see lttng-relayd(8)) if all the following
45           statements are true:
46
47           •   You specify the --live option.
48
49           •   You don’t specify any of the --set-url, --ctrl-url, or --data-
50               url options.
51
52           •   No relay daemon is currently listening for TCP connections on
53               127.0.0.1:5344 (default LTTng live reader connection address
54               and port).
55
56           Override the path of the relay daemon binary to spawn with the
57           --relayd-path option.
58
59       Note
60           The LTTng project recommends that you start the session daemon at
61           boot time for stable and long-term tracing.
62
63       See lttng-concepts(7) to learn more about the foundational concepts of
64       LTTng.
65
66       The lttng tool offers a subcommand-based command-line interface. The
67       “COMMANDS” section below lists the available commands.
68
69   Session daemon connection
70       For most of its commands, the lttng tool needs to connect to a
71       listening LTTng session daemon (lttng-sessiond(8)) to control LTTng
72       tracing.
73
74       Each Unix user may have its own independent running session daemon.
75       However, the lttng tool must connect to the session daemon of the root
76       user (the root session daemon) to control Linux kernel tracing.
77
78       How the lttng tool chooses which session daemon to connect to is as
79       follows:
80
81       If your Unix user is root
82           Connect to the root session daemon.
83
84       If your Unix user is not root
85
86           If your Unix user is part of the Unix tracing group
87               Try to connect to the root session daemon.
88
89               If the root session daemon isn’t running, connect to the
90               session daemon of your Unix user.
91
92           If your Unix user is not part of the tracing group
93               Connect to the session daemon of your Unix user.
94
95       The name of the Unix tracing group is one of:
96
97       With the --group=GROUP option of the root session daemon (lttng-
98       sessiond(8))
99           GROUP
100
101           In that case, you must use the --group=GROUP option, with the same
102           GROUP argument, of the lttng tool.
103
104       Without the --group option of the root session daemon
105           tracing
106
107       LTTng-instrumented user applications automatically register to both the
108       root and user session daemons. This makes it possible for both session
109       daemons to list the available instrumented applications and their
110       instrumentation points (see lttng-list(1)).
111

OPTIONS

113       -g GROUP, --group=GROUP
114           Set the name of the Unix tracing group to GROUP instead of tracing.
115
116           You must use this option to be able to connect to a root session
117           daemon (lttng-sessiond(8)) which was started with its own
118           --group=GROUP option.
119
120       -m xml, --mi=xml
121           Print the command’s result using a stable XML machine interface
122           (MI) output instead of the default, unstable human-readable output.
123
124           With this mode, lttng prints the resulting XML document to the
125           standard output, while it prints any error/warning to the standard
126           error with an unstable, human-readable format.
127
128           If any error occurs during the execution of lttng, the command
129           exits with a status different than 0, and lttng does NOT guarantee
130           the syntax and data validity of its MI output.
131
132           An XML schema definition (XSD) file used for validation of the MI
133           output is available: see the src/common/mi_lttng.xsd file in the
134           LTTng-tools source tree.
135
136       -n, --no-sessiond
137           Do not automatically spawn a session daemon for your Unix user when
138           running the lttng-create(1) command.
139
140           You may NOT use this option with the --sessiond-path option.
141
142       -q, --quiet
143           Suppress all messages, including warnings and errors.
144
145           You may NOT use this option with the --verbose option.
146
147       --sessiond-path=PATH
148           Set the absolute path of the session daemon binary to spawn from
149           the lttng-create(1) command to PATH.
150
151           You may NOT use this option with the --no-sessiond option.
152
153       --relayd-path=PATH
154           Set the absolute path of the relay daemon binary to spawn from the
155           lttng-create(1) command to PATH.
156
157       -v, --verbose
158           Increase verbosity.
159
160           Specify this option up to three times to get more levels of
161           verbosity.
162
163           You may NOT use this option with the --quiet option.
164
165   Program information
166       -h, --help
167           Show help.
168
169           This option attempts to launch /usr/bin/man to view this manual
170           page. Override the manual pager path with the LTTNG_MAN_BIN_PATH
171           environment variable.
172
173       --list-options
174           List available command options and quit.
175
176       --list-commands
177           List available commands and quit.
178
179       -V, --version
180           Show version and quit.
181

COMMANDS

183       The following commands also have their own --help option.
184
185   Recording session
186       ┌──────────────────────────┬────────────────────────────┐
187Command                   Description                
188       ├──────────────────────────┼────────────────────────────┤
189       │                          │                            │
190lttng-create(1)           │ Create a recording         │
191       │                          │ session.                   │
192       ├──────────────────────────┼────────────────────────────┤
193       │                          │                            │
194lttng-destroy(1)          │ Destroy recording          │
195       │                          │ sessions.                  │
196       ├──────────────────────────┼────────────────────────────┤
197       │                          │                            │
198lttng-disable-rotation(1) │ Unset a recording session  │
199       │                          │ rotation schedule.         │
200       ├──────────────────────────┼────────────────────────────┤
201       │                          │                            │
202lttng-enable-rotation(1)  │ Set a recording session    │
203       │                          │ rotation schedule.         │
204       ├──────────────────────────┼────────────────────────────┤
205       │                          │                            │
206lttng-load(1)             │ Load recording session     │
207       │                          │ configurations.            │
208       ├──────────────────────────┼────────────────────────────┤
209       │                          │                            │
210lttng-regenerate(1)       │ Regenerate specific        │
211       │                          │ recording session data.    │
212       ├──────────────────────────┼────────────────────────────┤
213       │                          │                            │
214lttng-rotate(1)           │ Archive the current trace  │
215       │                          │ chunk of a recording       │
216       │                          │ session.                   │
217       ├──────────────────────────┼────────────────────────────┤
218       │                          │                            │
219lttng-save(1)             │ Save recording session     │
220       │                          │ configurations.            │
221       ├──────────────────────────┼────────────────────────────┤
222       │                          │                            │
223lttng-set-session(1)      │ Set the current recording  │
224       │                          │ session.                   │
225       ├──────────────────────────┼────────────────────────────┤
226       │                          │                            │
227lttng-snapshot(1)         │ Take a recording session   │
228       │                          │ snapshot.                  │
229       ├──────────────────────────┼────────────────────────────┤
230       │                          │                            │
231lttng-start(1)            │ Start a recording session. │
232       ├──────────────────────────┼────────────────────────────┤
233       │                          │                            │
234lttng-status(1)           │ Show the status of the     │
235       │                          │ current recording session. │
236       ├──────────────────────────┼────────────────────────────┤
237       │                          │                            │
238lttng-stop(1)             │ Stop a recording session.  │
239       └──────────────────────────┴────────────────────────────┘
240
241   Channel
242       ┌─────────────────────────┬──────────────────────────┐
243Command                  Description              
244       ├─────────────────────────┼──────────────────────────┤
245       │                         │                          │
246lttng-add-context(1)     │ Add context fields to be │
247       │                         │ recorded.                │
248       ├─────────────────────────┼──────────────────────────┤
249       │                         │                          │
250lttng-disable-channel(1) │ Disable channels.        │
251       ├─────────────────────────┼──────────────────────────┤
252       │                         │                          │
253lttng-enable-channel(1)  │ Create or enable a       │
254       │                         │ channel.                 │
255       └─────────────────────────┴──────────────────────────┘
256
257   Recording event rule
258       ┌───────────────────────┬────────────────────────────┐
259Command                Description                
260       ├───────────────────────┼────────────────────────────┤
261       │                       │                            │
262lttng-disable-event(1) │ Disable recording event    │
263       │                       │ rules.                     │
264       ├───────────────────────┼────────────────────────────┤
265       │                       │                            │
266lttng-enable-event(1)  │ Create or enable recording │
267       │                       │ event rules.               │
268       └───────────────────────┴────────────────────────────┘
269
270   Information
271       ┌──────────────┬─────────────────────────┐
272Command       Description             
273       ├──────────────┼─────────────────────────┤
274       │              │                         │
275lttng-list(1) │ List recording sessions │
276       │              │ and instrumentation     │
277       │              │ points.                 │
278       └──────────────┴─────────────────────────┘
279
280   Resource tracking
281       ┌─────────────────┬──────────────────────────┐
282Command          Description              
283       ├─────────────────┼──────────────────────────┤
284       │                 │                          │
285lttng-track(1)   │ Allow specific processes │
286       │                 │ to record events.        │
287       ├─────────────────┼──────────────────────────┤
288       │                 │                          │
289lttng-untrack(1) │ Disallow specific        │
290       │                 │ processes to record      │
291       │                 │ events.                  │
292       └─────────────────┴──────────────────────────┘
293
294   Trigger
295       ┌────────────────────────┬───────────────────┐
296Command                 Description       
297       ├────────────────────────┼───────────────────┤
298       │                        │                   │
299lttng-add-trigger(1)    │ Add a trigger.    │
300       ├────────────────────────┼───────────────────┤
301       │                        │                   │
302lttng-list-triggers(1)  │ List triggers.    │
303       ├────────────────────────┼───────────────────┤
304       │                        │                   │
305lttng-remove-trigger(1) │ Remove a trigger. │
306       └────────────────────────┴───────────────────┘
307
308   Miscellaneous
309       ┌─────────────────┬──────────────────────────┐
310Command          Description              
311       ├─────────────────┼──────────────────────────┤
312       │                 │                          │
313lttng-help(1)    │ Show the help of a       │
314       │                 │ command.                 │
315       ├─────────────────┼──────────────────────────┤
316       │                 │                          │
317lttng-version(1) │ Show LTTng-tools version │
318       │                 │ information.             │
319       ├─────────────────┼──────────────────────────┤
320       │                 │                          │
321lttng-view(1)    │ Launch a trace reader.   │
322       └─────────────────┴──────────────────────────┘
323

EXIT STATUS

325       0
326           Success
327
328       1
329           Command error
330
331       2
332           Undefined command
333
334       3
335           Fatal error
336
337       4
338           Command warning (something went wrong during the command)
339

ENVIRONMENT

341       LTTNG_ABORT_ON_ERROR
342           Set to 1 to abort the process after the first error is encountered.
343
344       LTTNG_HOME
345           Path to the LTTng home directory.
346
347           Defaults to $HOME.
348
349           Useful when the Unix user running the commands has a non-writable
350           home directory.
351
352       LTTNG_MAN_BIN_PATH
353           Absolute path to the manual pager to use to read the LTTng
354           command-line help (with lttng-help(1) or with the --help option)
355           instead of /usr/bin/man.
356
357       LTTNG_SESSION_CONFIG_XSD_PATH
358           Path to the directory containing the session.xsd recording session
359           configuration XML schema.
360
361       LTTNG_SESSIOND_PATH
362           Absolute path to the LTTng session daemon binary (see lttng-
363           sessiond(8)) to spawn from the lttng-create(1) command.
364
365           The --sessiond-path general option overrides this environment
366           variable.
367

FILES

369       $LTTNG_HOME/.lttngrc
370           Unix user’s LTTng runtime configuration.
371
372           This is where LTTng stores the name of the Unix user’s current
373           recording session between executions of lttng(1).  lttng-create(1)
374           and lttng-set-session(1) set the current recording session.
375
376       $LTTNG_HOME/lttng-traces
377           Default output directory of LTTng traces in local and snapshot
378           modes.
379
380           Override this path with the --output option of the lttng-create(1)
381           command.
382
383       $LTTNG_HOME/.lttng
384           Unix user’s LTTng runtime and configuration directory.
385
386       $LTTNG_HOME/.lttng/sessions
387           Default directory containing the Unix user’s saved recording
388           session configurations (see lttng-save(1) and lttng-load(1)).
389
390       /usr/local/etc/lttng/sessions
391           Directory containing the system-wide saved recording session
392           configurations (see lttng-save(1) and lttng-load(1)).
393
394       Note
395           $LTTNG_HOME defaults to the value of the HOME environment variable.
396

RESOURCES

398       •   LTTng project website <https://lttng.org>
399
400       •   LTTng documentation <https://lttng.org/docs>
401
402       •   LTTng bug tracker <https://bugs.lttng.org>
403
404       •   Git repositories <https://git.lttng.org>
405
406       •   GitHub organization <https://github.com/lttng>
407
408       •   Continuous integration <https://ci.lttng.org/>
409
410       •   Mailing list <https://lists.lttng.org/> for support and
411           development: lttng-dev@lists.lttng.org
412
413       •   IRC channel <irc://irc.oftc.net/lttng>: #lttng on irc.oftc.net
414
416       This program is part of the LTTng-tools project.
417
418       LTTng-tools is distributed under the GNU General Public License
419       version 2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html>.
420       See the LICENSE <https://github.com/lttng/lttng-
421       tools/blob/master/LICENSE> file for details.
422

THANKS

424       Special thanks to Michel Dagenais and the DORSAL laboratory
425       <http://www.dorsal.polymtl.ca/> at École Polytechnique de Montréal for
426       the LTTng journey.
427
428       Also thanks to the Ericsson teams working on tracing which helped us
429       greatly with detailed bug reports and unusual test cases.
430

SEE ALSO

432       lttng-concepts(7) lttng-relayd(8), lttng-sessiond(8)
433
434
435
436LTTng 2.13.10                    14 June 2021                         LTTNG(1)
Impressum