LTTNG-ENABLE-CHANN(1) | LTTng Manual | LTTNG-ENABLE-CHANN(1) |
lttng-enable-channel - Create or enable LTTng channels
Create a Linux kernel channel:
lttng [GENERAL OPTIONS] enable-channel --kernel
[--discard | --overwrite] [--output=(mmap | splice)]
[--subbuf-size=SIZE] [--num-subbuf=COUNT]
[--switch-timer=PERIODUS] [--read-timer=PERIODUS]
[--monitor-timer=PERIODUS] [--buffers-global]
[--tracefile-size=SIZE [--tracefile-count=COUNT]]
[--session=SESSION] CHANNEL
Create a user space channel:
lttng [GENERAL OPTIONS] enable-channel --userspace
[--overwrite | [--discard] --blocking-timeout=TIMEOUTUS]
[--output=mmap] [--buffers-uid | --buffers-pid]
[--subbuf-size=SIZE] [--num-subbuf=COUNT]
[--switch-timer=PERIODUS] [--read-timer=PERIODUS]
[--monitor-timer=PERIODUS]
[--tracefile-size=SIZE [--tracefile-count=COUNT]]
[--session=SESSION] CHANNEL
Enable channel(s):
lttng [GENERAL OPTIONS] enable-channel (--userspace | --kernel)
[--session=SESSION] CHANNEL[,CHANNEL]...
The lttng enable-channel command does one of:
See lttng-concepts(7) to learn more about channels.
The channel(s) to create or enable belong to:
With the --session=SESSION option
Without the --session option
Note
The lttng-enable-event(1) command can automatically create a default channel when no channel exists for the provided tracing domain.
See the “EXAMPLES” section below for usage examples.
List the channels of a given recording session with the lttng-list(1) and lttng-status(1) commands.
Disable an enabled channel with the lttng-disable-channel(1) command.
Important
As of LTTng 2.13.9, you may NOT perform the following operations with the enable-channel command:
See lttng(1) for GENERAL OPTIONS.
One of:
-k, --kernel
-u, --userspace
-s SESSION, --session=SESSION
One of:
--buffers-global
Only available with the --kernel option.
As of LTTng 2.13.9, this is the default buffering scheme for the Linux kernel tracing domain, but this may change in the future.
--buffers-pid
If you connect to the root session daemon
See the “Session daemon connection” section of lttng(1) to learn how a user application connects to a session daemon.
Otherwise
Only available with the --userspace option.
--buffers-uid
If you connect to the root session daemon
See the “Session daemon connection” section of lttng(1) to learn how a user application connects to a session daemon.
Otherwise
Only available with the --userspace option.
As of LTTng 2.13.9, this is the default buffering scheme for the user space tracing domain, but this may change in the future.
--blocking-timeout=TIMEOUTUS
TIMEOUTUS is one of:
0 (default)
inf
N, a positive value
This option is only available with both the --userspace and --discard options.
One of:
--discard
As of LTTng 2.13.9, this is the default event record loss mode, but this may change in the future.
--overwrite
--num-subbuf=COUNT
The effective value is COUNT rounded up to the next power of two.
Default values:
--userspace and --buffers-uid options
--userspace and --buffers-pid options
--kernel and --buffers-global options
metadata channel
--output=TYPE
TYPE is one of:
mmap
splice
Only available with the --kernel option.
Default values:
--userspace and --buffers-uid options
--userspace and --buffers-pid options
--kernel and --buffers-global options
metadata channel
--subbuf-size=SIZE
The effective value is SIZE rounded up to the next power of two.
The k (KiB), M (MiB), and G (GiB) suffixes are supported.
The minimum sub-buffer size, for each tracer, is the maximum value between the default below and the system page size (see getconf(1) with the PAGE_SIZE variable).
Default values:
--userspace and --buffers-uid options
--userspace and --buffers-pid options
--kernel and --buffers-global options
metadata channel
--tracefile-count=COUNT
COUNT set to 0 means “unlimited”.
Default: 0.
You must also use the --tracefile-size option with this option.
--tracefile-size=SIZE
SIZE set to 0 means “unlimited”.
Default: 0.
Note
--monitor-timer=PERIODUS
Set PERIODUS to 0 to disable the monitor timer.
Default values:
--userspace and --buffers-uid options
--userspace and --buffers-pid options
--kernel and --buffers-global options
--read-timer=PERIODUS
Set PERIODUS to 0 to disable the read timer.
Default values:
--userspace and --buffers-uid options
--userspace and --buffers-pid options
--kernel and --buffers-global options
metadata channel
--switch-timer=PERIODUS
Set PERIODUS to 0 to disable the switch timer.
Default values:
--userspace and --buffers-uid options
--userspace and --buffers-pid options
--kernel and --buffers-global options
metadata channel
-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
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.
Example 1. Create a Linux kernel channel with default attributes in the current recording session.
The following command line only creates a new channel if my-channel doesn’t name an existing Linux kernel channel in the current recording session.
$ lttng enable-channel --kernel my-channel
Example 2. Create a user space channel with a per-process buffering scheme in a specific recording session.
See the --session and --buffers-pid options.
$ lttng enable-channel --session=my-session --userspace \
--buffers-pid my-channel
Example 3. Create a Linux kernel channel in the current recording session with four 32-MiB sub-buffers per ring buffer.
See the --num-subbuf and --subbuf-size options.
$ lttng enable-channel --kernel my-channel \
--num-subbuf=4 --subbuf-size=32M
Example 4. Create a user space channel in the current recording session with trace file rotation.
See the --tracefile-count and --tracefile-size options.
$ lttng enable-channel --userspace my-channel \
--tracefile-count=16 --tracefile-size=8M
Example 5. Enable two user space channels of a specific recording session.
$ lttng enable-channel --session=my-session --userspace \
canal-d,rds
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.
lttng(1), lttng-disable-channel(1), lttng-list(1), lttng-concepts(7)
14 June 2021 | LTTng 2.13.9 |