LTTNG(1) | LTTng Manual | LTTNG(1) |
lttng - Control LTTng tracing
lttng [--group=GROUP] [--mi=xml] [--no-sessiond | --sessiond-path=PATH]
[--relayd-path=PATH] [--quiet | -verbose...]
COMMAND [COMMAND OPTIONS]
The Linux Trace Toolkit: next generation <https://lttng.org/> is an open-source software package used for correlated tracing of the Linux kernel, user applications, and user libraries.
LTTng consists of Linux kernel modules (for Linux kernel tracing) and dynamically loaded libraries (for user application and library tracing).
The lttng command-line tool, as well as any user application linked with the LTTng control library (liblttng-ctl), sends commands to a listening LTTng session daemon (lttng-sessiond(8)). A session daemon:
By default, the lttng-create(1) command automatically spawns:
Override the path of the session daemon binary to spawn with the --sessiond-path option.
Avoid automatically spawning a session daemon with the --no-sessiond option.
Override the path of the relay daemon binary to spawn with the --relayd-path option.
Note
The LTTng project recommends that you start the session daemon at boot time for stable and long-term tracing.
See lttng-concepts(7) to learn more about the foundational concepts of LTTng.
The lttng tool offers a subcommand-based command-line interface. The “COMMANDS” section below lists the available commands.
For most of its commands, the lttng tool needs to connect to a listening LTTng session daemon (lttng-sessiond(8)) to control LTTng tracing.
Each Unix user may have its own independent running session daemon. However, the lttng tool must connect to the session daemon of the root user (the root session daemon) to control Linux kernel tracing.
How the lttng tool chooses which session daemon to connect to is as follows:
If your Unix user is root
If your Unix user is not root
If your Unix user is part of the Unix tracing group
If the root session daemon isn’t running, connect to the session daemon of your Unix user.
If your Unix user is not part of the tracing group
The name of the Unix tracing group is one of:
With the --group=GROUP option of the root session daemon (lttng-sessiond(8))
In that case, you must use the --group=GROUP option, with the same GROUP argument, of the lttng tool.
Without the --group option of the root session daemon
LTTng-instrumented user applications automatically register to both the root and user session daemons. This makes it possible for both session daemons to list the available instrumented applications and their instrumentation points (see lttng-list(1)).
-g GROUP, --group=GROUP
You must use this option to be able to connect to a root session daemon (lttng-sessiond(8)) which was started with its own --group=GROUP option.
-m xml, --mi=xml
With this mode, lttng prints the resulting XML document to the standard output, while it prints any error/warning to the standard error with an unstable, human-readable format.
If any error occurs during the execution of lttng, the command exits with a status different than 0, and lttng does NOT guarantee the syntax and data validity of its MI output.
An XML schema definition (XSD) file used for validation of the MI output is available: see the src/common/mi_lttng.xsd file in the LTTng-tools source tree.
-n, --no-sessiond
You may NOT use this option with the --sessiond-path option.
-q, --quiet
You may NOT use this option with the --verbose option.
--sessiond-path=PATH
You may NOT use this option with the --no-sessiond option.
--relayd-path=PATH
-v, --verbose
Specify this option up to three times to get more levels of verbosity.
You may NOT use this option with the --quiet option.
-h, --help
This option attempts to launch /usr/bin/man to view this manual page. Override the manual pager path with the LTTNG_MAN_BIN_PATH environment variable.
--list-options
--list-commands
-V, --version
The following commands also have their own --help option.
Command | Description |
lttng-create(1) | Create a recording session. |
lttng-destroy(1) | Destroy recording sessions. |
lttng-disable-rotation(1) | Unset a recording session rotation schedule. |
lttng-enable-rotation(1) | Set a recording session rotation schedule. |
lttng-load(1) | Load recording session configurations. |
lttng-regenerate(1) | Regenerate specific recording session data. |
lttng-rotate(1) | Archive the current trace chunk of a recording session. |
lttng-save(1) | Save recording session configurations. |
lttng-set-session(1) | Set the current recording session. |
lttng-snapshot(1) | Take a recording session snapshot. |
lttng-start(1) | Start a recording session. |
lttng-status(1) | Show the status of the current recording session. |
lttng-stop(1) | Stop a recording session. |
Command | Description |
lttng-add-context(1) | Add context fields to be recorded. |
lttng-disable-channel(1) | Disable channels. |
lttng-enable-channel(1) | Create or enable a channel. |
Command | Description |
lttng-disable-event(1) | Disable recording event rules. |
lttng-enable-event(1) | Create or enable recording event rules. |
Command | Description |
lttng-list(1) | List recording sessions and instrumentation points. |
Command | Description |
lttng-track(1) | Allow specific processes to record events. |
lttng-untrack(1) | Disallow specific processes to record events. |
Command | Description |
lttng-add-trigger(1) | Add a trigger. |
lttng-list-triggers(1) | List triggers. |
lttng-remove-trigger(1) | Remove a trigger. |
Command | Description |
lttng-help(1) | Show the help of a command. |
lttng-version(1) | Show LTTng-tools version information. |
lttng-view(1) | Launch a trace reader. |
0
1
2
3
4
LTTNG_ABORT_ON_ERROR
LTTNG_HOME
Defaults to $HOME.
Useful when the Unix user running the commands has a non-writable home directory.
LTTNG_MAN_BIN_PATH
LTTNG_SESSION_CONFIG_XSD_PATH
LTTNG_SESSIOND_PATH
The --sessiond-path general option overrides this environment variable.
$LTTNG_HOME/.lttngrc
This is where LTTng stores the name of the Unix user’s current recording session between executions of lttng(1). lttng-create(1) and lttng-set-session(1) set the current recording session.
$LTTNG_HOME/lttng-traces
Override this path with the --output option of the lttng-create(1) command.
$LTTNG_HOME/.lttng
$LTTNG_HOME/.lttng/sessions
/etc/lttng/sessions
Note
$LTTNG_HOME defaults to the value of the HOME environment variable.
This program is part of the LTTng-tools project.
LTTng-tools is distributed under the GNU General Public License version 2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html>. See the LICENSE <https://github.com/lttng/lttng-tools/blob/master/LICENSE> file for details.
Special thanks to Michel Dagenais and the DORSAL laboratory <http://www.dorsal.polymtl.ca/> at École Polytechnique de Montréal for the LTTng journey.
Also thanks to the Ericsson teams working on tracing which helped us greatly with detailed bug reports and unusual test cases.
14 June 2021 | LTTng 2.13.9 |