---
name: "lttng"
section: "1"
platform: "linux"
package: "lttng-tools"
version: "2.13.15-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/lttng"
---

# lttng(1)

Control LTTng tracing

## NAME

lttng - Control LTTng tracing

## SYNOPSIS

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

## DESCRIPTION

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)](/lttng-sessiond/8.md)). A session daemon:

• Manages recording sessions (see [**lttng-concepts**(7)](/lttng-concepts/7.md) to learn more about recording sessions).

• Controls the various components (like tracers and consumer daemons) of LTTng.

• Sends asynchronous notifications to user applications.

By default, the [**lttng-create**(1)](/lttng-create/1.md) command automatically spawns:

• A session daemon for your Unix user if none is currently running.

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.

• A relay daemon (see [**lttng-relayd**(8)](/lttng-relayd/8.md)) if all the following statements are true:

• You specify the **--live** option.

• You don’t specify any of the **--set-url**, **--ctrl-url**, or **--data-url** options.

• No relay daemon is currently listening for TCP connections on **127.0.0.1:5344** (default LTTng live reader connection address and port).

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)](/lttng-concepts/7.md) 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.

### Session daemon connection

For most of its commands, the **lttng** tool needs to connect to a listening LTTng session daemon ([**lttng-sessiond**(8)](/lttng-sessiond/8.md)) 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**

Connect to the root session daemon.

If your Unix user is not **root**

If your Unix user is part of the Unix tracing group

Try to connect to the root session daemon.

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

Connect to the session daemon of your Unix user.

The name of the Unix tracing group is one of:

With the **--group**=*GROUP* option of the root session daemon ([**lttng-sessiond**(8)](/lttng-sessiond/8.md))

*GROUP*

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

**tracing**

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)](/lttng-list/1.md)).

## OPTIONS

- **-g** *GROUP*, **--group**=*GROUP*

  Set the name of the Unix tracing group to *GROUP* instead of **tracing**.

  You must use this option to be able to connect to a root session daemon ([**lttng-sessiond**(8)](/lttng-sessiond/8.md)) which was started with its own **--group**=*GROUP* option.

- **-m** **xml**, **--mi**=**xml**

  Print the command’s result using a stable XML machine interface (MI) output instead of the default, unstable human-readable output.

  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**

  Do not automatically spawn a session daemon for your Unix user when running the [**lttng-create**(1)](/lttng-create/1.md) command.

  You may NOT use this option with the **--sessiond-path** option.

- **-q**, **--quiet**

  Suppress all messages, including warnings and errors.

  You may NOT use this option with the **--verbose** option.

- **--sessiond-path**=*PATH*

  Set the absolute path of the session daemon binary to spawn from the [**lttng-create**(1)](/lttng-create/1.md) command to *PATH*.

  You may NOT use this option with the **--no-sessiond** option.

- **--relayd-path**=*PATH*

  Set the absolute path of the relay daemon binary to spawn from the [**lttng-create**(1)](/lttng-create/1.md) command to *PATH*.

- **-v**, **--verbose**

  Increase verbosity.

  Specify this option up to three times to get more levels of verbosity.

  You may NOT use this option with the **--quiet** option.

### Program information

- **-h**, **--help**

  Show 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 available command options and quit.

- **--list-commands**

  List available commands and quit.

- **-V**, **--version**

  Show version and quit.

## COMMANDS

The following commands also have their own **--help** option.

### Recording session

| | |
| --- | --- |
| **Command** | **Description** |
| [**lttng-create**(1)](/lttng-create/1.md) | Create a recording session. |
| [**lttng-destroy**(1)](/lttng-destroy/1.md) | Destroy recording sessions. |
| [**lttng-disable-rotation**(1)](/lttng-disable-rotation/1.md) | Unset a recording session rotation schedule. |
| [**lttng-enable-rotation**(1)](/lttng-enable-rotation/1.md) | Set a recording session rotation schedule. |
| [**lttng-load**(1)](/lttng-load/1.md) | Load recording session configurations. |
| [**lttng-regenerate**(1)](/lttng-regenerate/1.md) | Regenerate specific recording session data. |
| [**lttng-rotate**(1)](/lttng-rotate/1.md) | Archive the current trace chunk of a recording session. |
| [**lttng-save**(1)](/lttng-save/1.md) | Save recording session configurations. |
| [**lttng-set-session**(1)](/lttng-set-session/1.md) | Set the current recording session. |
| [**lttng-snapshot**(1)](/lttng-snapshot/1.md) | Take a recording session snapshot. |
| [**lttng-start**(1)](/lttng-start/1.md) | Start a recording session. |
| [**lttng-status**(1)](/lttng-status/1.md) | Show the status of the current recording session. |
| [**lttng-stop**(1)](/lttng-stop/1.md) | Stop a recording session. |

### Channel

| | |
| --- | --- |
| **Command** | **Description** |
| [**lttng-add-context**(1)](/lttng-add-context/1.md) | Add context fields to be recorded. |
| [**lttng-disable-channel**(1)](/lttng-disable-channel/1.md) | Disable channels. |
| [**lttng-enable-channel**(1)](/lttng-enable-channel/1.md) | Create or enable a channel. |

### Recording event rule

| | |
| --- | --- |
| **Command** | **Description** |
| [**lttng-disable-event**(1)](/lttng-disable-event/1.md) | Disable recording event rules. |
| [**lttng-enable-event**(1)](/lttng-enable-event/1.md) | Create or enable recording event rules. |

### Information

| | |
| --- | --- |
| **Command** | **Description** |
| [**lttng-list**(1)](/lttng-list/1.md) | List recording sessions and instrumentation points. |

### Resource tracking

| | |
| --- | --- |
| **Command** | **Description** |
| [**lttng-track**(1)](/lttng-track/1.md) | Allow specific processes to record events. |
| [**lttng-untrack**(1)](/lttng-untrack/1.md) | Disallow specific processes to record events. |

### Trigger

| | |
| --- | --- |
| **Command** | **Description** |
| [**lttng-add-trigger**(1)](/lttng-add-trigger/1.md) | Add a trigger. |
| [**lttng-list-triggers**(1)](/lttng-list-triggers/1.md) | List triggers. |
| [**lttng-remove-trigger**(1)](/lttng-remove-trigger/1.md) | Remove a trigger. |

### Miscellaneous

| | |
| --- | --- |
| **Command** | **Description** |
| [**lttng-help**(1)](/lttng-help/1.md) | Show the help of a command. |
| [**lttng-version**(1)](/lttng-version/1.md) | Show LTTng-tools version information. |
| [**lttng-view**(1)](/lttng-view/1.md) | Launch a trace reader. |

## EXIT STATUS

**0**

Success

**1**

Command error

**2**

Undefined command

**3**

Fatal error

**4**

Command warning (something went wrong during the command)

## ENVIRONMENT

**LTTNG\_ABORT\_ON\_ERROR**

Set to **1** to abort the process after the first error is encountered.

**LTTNG\_HOME**

Path to the LTTng home directory.

Defaults to **$HOME**.

Useful when the Unix user running the commands has a non-writable home directory.

**LTTNG\_MAN\_BIN\_PATH**

Absolute path to the manual pager to use to read the LTTng command-line help (with [**lttng-help**(1)](/lttng-help/1.md) or with the **--help** option) instead of **/usr/bin/man**.

**LTTNG\_SESSION\_CONFIG\_XSD\_PATH**

Path to the directory containing the **session.xsd** recording session configuration XML schema.

**LTTNG\_SESSIOND\_PATH**

Absolute path to the LTTng session daemon binary (see [**lttng-sessiond**(8)](/lttng-sessiond/8.md)) to spawn from the [**lttng-create**(1)](/lttng-create/1.md) command.

The **--sessiond-path** general option overrides this environment variable.

## FILES

**$LTTNG\_HOME/.lttngrc**

Unix user’s LTTng runtime configuration.

This is where LTTng stores the name of the Unix user’s current recording session between executions of [**lttng**(1)](/lttng/1.md). [**lttng-create**(1)](/lttng-create/1.md) and [**lttng-set-session**(1)](/lttng-set-session/1.md) set the current recording session.

**$LTTNG\_HOME/lttng-traces**

Default output directory of LTTng traces in local and snapshot modes.

Override this path with the **--output** option of the [**lttng-create**(1)](/lttng-create/1.md) command.

**$LTTNG\_HOME/.lttng**

Unix user’s LTTng runtime and configuration directory.

**$LTTNG\_HOME/.lttng/sessions**

Default directory containing the Unix user’s saved recording session configurations (see [**lttng-save**(1)](/lttng-save/1.md) and [**lttng-load**(1)](/lttng-load/1.md)).

**/etc/lttng/sessions**

Directory containing the system-wide saved recording session configurations (see [**lttng-save**(1)](/lttng-save/1.md) and [**lttng-load**(1)](/lttng-load/1.md)).

**Note**\

**$LTTNG\_HOME** defaults to the value of the **HOME** environment variable.

## RESOURCES

• LTTng project website \<https://lttng.org\>

• LTTng documentation \<https://lttng.org/docs\>

• LTTng bug tracker \<https://bugs.lttng.org\>

• Git repositories \<https://git.lttng.org\>

• GitHub organization \<https://github.com/lttng\>

• Continuous integration \<https://ci.lttng.org/\>

• Mailing list \<https://lists.lttng.org/\> for support and development: **lttng-dev@lists.lttng.org**

• IRC channel \<irc://irc.oftc.net/lttng\>: **#lttng** on **irc.oftc.net**

## COPYRIGHT

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.

## THANKS

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.

## SEE ALSO

[**lttng-concepts**(7)](/lttng-concepts/7.md) [**lttng-relayd**(8)](/lttng-relayd/8.md), [**lttng-sessiond**(8)](/lttng-sessiond/8.md)
