LTTNG-ENABLE-CHANN(1)
π« LTTNG-ENABLE-CHANN(1) β lttng-enable-channel π«
okay bestie, this one lives in section 1 of the LTTng Manual, and it's literally the whole vibe of "make a channel happen." she's long, she's detailed, she's iconic. no cap, read every word, because the details are the moment. π
β¨ NAME β¨
lttng-enable-channel β Create or enable LTTng channels
β¨ SYNOPSIS β¨
okay so there are three whole ways to run this, and they are NOT interchangeable, so pick your fighter π
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]
[--buffer-ownership=system] [--buffer-allocation=per-cpu]
[--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]
[--auto-reclaim-memory=(off | consumed | older-than:AGEUS)]]
[--output=mmap] [--buffer-ownership=(user | process)]
[--buffer-allocation=(per-cpu | per-channel)]
[--buffer-preallocation=(preallocate | on-demand)]
[--subbuf-size=SIZE] [--num-subbuf=COUNT]
[--switch-timer=PERIODUS] [--read-timer=PERIODUS]
[--monitor-timer=PERIODUS] [--watchdog-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]...
β¨ DESCRIPTION β¨
so lttng enable-channel does exactly one of these two things, and honestly both are a serve:
- Create a channel named CHANNEL.
- Enable one or more disabled channels named CHANNEL (that's the non-option argument, comma-separated, bestie β commas are doing the heavy lifting).
go read lttng-concepts(7) if you wanna know more about channels, it's giving foundation.
the channel(s) you're creating or enabling belong to:
- With the
--session=SESSIONoption β the recording session named SESSION. - Without the
--sessionoption β the current recording session (and yes,lttng-concepts(7)also explains what "current recording session" means π).
Note π the lttng-enable-event(1) command can just casually auto-create a default channel when no channel exists for the tracing domain you gave it. main character energy honestly.
peep the βEXAMPLESβ section down below for usage examples, they're cute.
wanna list the channels of a given recording session? that's lttng-list(1) and lttng-status(1), go off π.
wanna disable an enabled channel? lttng-disable-channel(1) has you covered.
Important β οΈ (no literally, important) as of LTTng 2.15.1, you may NOT do any of the following with theenable-channelcommand: - Change an attribute of an existing channel. - Enable a disabled channel once its recording session has been active (started; seelttng-start(1)) at least once. - Create a channel once its recording session has been active at least once. - Create a user space channel with a given buffer ownership model (--buffer-ownershipset touserorprocess) and then create a second user space channel with a different buffer ownership model in the same recording session.
β¨ OPTIONS β¨
the GENERAL OPTIONS live over in lttng(1), so go say hi to them there π«Ά
π Tracing domain
pick one, you can't have both:
-k,--kernelβ Create or enable channels in the Linux kernel domain.-u,--userspaceβ Create or enable channels in the user space domain.
πΈ Recording target
-s SESSION,--session=SESSIONβ Create or enable channels in the recording session named SESSION instead of the current recording session.
π¦ Buffer ownership model
one of these, bestie:
--buffers-globalβ Equivalent to--buffer-ownership=system.
Deprecated. π (she's old, she's out, but she's still in the docs, periodt.)
--buffer-ownership=MODELβ Depends on MODEL, and it's literally:processβ Allocate one set of ring buffers (one per CPU or one for the whole channel, depending on--buffer-allocation) for each instrumented process of:- If you connect to the root session daemon β All Unix users. (see the βSession daemon connectionβ section of
lttng(1)to learn how a user application connects to a session daemon.) - Otherwise β Your Unix user. Only available with the
--userspaceoption.
- If you connect to the root session daemon β All Unix users. (see the βSession daemon connectionβ section of
systemβ Allocate a single set of ring buffers (one per CPU) for the whole system. Only available with the--kerneloption. as of LTTng 2.15.1, this is the default buffer ownership model for the Linux kernel tracing domain, but lowkey this may change in the future. πuserβ Allocate one set of ring buffers (one per CPU or one for the whole channel, depending on--buffer-allocation) shared by all the instrumented processes of:- If you connect to the root session daemon β Each Unix user. (see the βSession daemon connectionβ section of
lttng(1)to learn how a user application connects to a session daemon.) - Otherwise β Your Unix user. Only available with the
--userspaceoption. as of LTTng 2.15.1, this is the default buffer ownership model for the user space tracing domain, but again, this may change in the future. β¨
- If you connect to the root session daemon β Each Unix user. (see the βSession daemon connectionβ section of
--buffers-pidβ Equivalent to--buffer-ownership=process.
Deprecated. π
--buffers-uidβ Equivalent to--buffer-ownership=user.
Deprecated. π
π Buffer allocation policy
--buffer-allocation=POLICYβ Depending on POLICY, allocate one ring buffer for:per-channelβ The whole channel. setting--buffer-ownershiptouserorprocessdetermines what entity gets a channel-wise ring buffer. Only available with the--userspaceoption.per-cpuβ Each CPU. setting--buffer-ownershiptouser,process, orsystemdetermines what entity gets a set of per-CPU ring buffers. using this buffer allocation policy implies adding thecpu_idcontext field, without any way to remove it, for the created channel β similar to running:
$ lttng add-context --session=SESSION --channel=CHANNEL \
--type=cpu_id
as of LTTng 2.15.1, this is the default buffer allocation policy, but yeah, this may change in the future. π
π Buffer preallocation policy
--buffer-preallocation=POLICYβ Depending on POLICY, allocate:preallocateβ The full backing memory for all ring buffers when you create the channel. this policy provides consistent performance but uses more memory upfront. Use this policy to optimize instrumented application startup time. as of LTTng 2.15.1, this is the default buffer preallocation policy, but this may change in the future. πon-demandβ Backing memory for ring buffers incrementally, as needed during tracing. this policy uses less initial memory but may introduce slight performance overhead when allocating new memory during tracing. Only available with the--userspaceoption.
π Automatic memory reclaim
--auto-reclaim-memory=STRATEGYβ Set the automatic memory reclaim strategy to STRATEGY for the created channel. STRATEGY is one of:off(default) β No automatic memory reclaim. she's chill, she does nothing.consumedβ LTTng automatically reclaims the memory of sub-buffers as soon as they're consumed (read). this strategy is not available for channels of recording sessions in snapshot mode or without an output.older-than:AGEUSβ LTTng automatically reclaims the memory of sub-buffers of which the closing time exceeds AGEUS Β΅s. thems(milliseconds),s(seconds),m(minutes), andh(hours) suffixes are supported. this is more or less equivalent to automatically running thelttng-reclaim-memory(1)command. LTTng automatically evaluates the eligibility of sub-buffers for a memory reclaim operation at regular intervals (every half AGEUS Β΅s, but also at least a period defined at build time) and reclaims sub-buffers of which the age of the closing time have exceeded AGEUS Β΅s. more specifically:- If AGEUS > last stream activity age β Only sub-buffers of which the age, at the moment of closing them, is greater than AGEUS are eligible for a memory reclaim.
- If AGEUS < last stream activity age β All sub-buffers are eligible and LTTng flushes the targeted channel so that any open sub-buffer gets closed to become eligible. Only available with the
--userspaceand--discardoptions.
π₯ Event record loss mode
--blocking-timeout=TIMEOUTUSβ Set the blocking timeout value of the channel to TIMEOUTUS Β΅s for instrumented applications executed with a setLTTNG_UST_ALLOW_BLOCKINGenvironment variable. TIMEOUTUS is one of:0(default) β Do not block (non-blocking mode).infβ Block forever until a sub-buffer is available to write the event record.N, a positive value β Wait for at most N Β΅s when trying to write to a sub-buffer. After N Β΅s, discard the event record. this option is only available with both the--userspaceand--discardoptions.
one of:
--discardβ Discard event records when there's no available sub-buffer. as of LTTng 2.15.1, this is the default event record loss mode, but this may change in the future. π--overwriteβ Overwrite the whole sub-buffer containing the oldest event records when there's no available sub-buffer (flight recorder mode π©οΈ).
π Sub-buffers
--num-subbuf=COUNTβ Use COUNT sub-buffers per ring buffer. the effective value is COUNT rounded up to the next power of two. (math girlies rise π§) default values:--userspaceand--buffer-ownership=useroptions β4--userspaceand--buffer-ownership=processoptions β4--kerneland--buffer-ownership=systemoptions β4- metadata channel β
2
--output=TYPEβ Set the output type of the channel to TYPE. TYPE is one of:mmapβ Share ring buffers between the tracer and the consumer daemon with themmap(2)system call.spliceβ Share ring buffers between the tracer and the consumer daemon with thesplice(2)system call. Only available with the--kerneloption. default values:--userspaceand--buffer-ownership=useroptions βmmap--userspaceand--buffer-ownership=processoptions βmmap--kerneland--buffer-ownership=systemoptions βsplice
- metadata channel β
mmap
--subbuf-size=SIZEβ sets the size of each sub-buffer to SIZE bytes π
The effective value is SIZE rounded up to the next power of two (yes, it rounds up, no cap).
The k (KiB), M (MiB), and G (GiB) suffixes are supported.
The minimum sub-buffer size, for each tracer, is the max value between the default listed right below and the system page size (peep getconf(1) with the PAGE_SIZE variable, bestie).
Default values:
--userspaceand--buffer-ownership=useroptions β524288--userspaceand--buffer-ownership=processoptions β16384--kerneland--buffer-ownership=systemoptions β1048576- metadata channel β
4096
π Trace files
--tracefile-count=COUNTβ caps the number of trace files LTTng writes for this channel at COUNT β¨
COUNT set to 0 means "unlimited".
Default: 0.
You must also use the --tracefile-size option with this option. Like, they're a package deal, fr fr.
--tracefile-size=SIZEβ sets the max size of each trace file LTTng writes for this channel to SIZE bytes π
SIZE set to 0 means "unlimited".
Default: 0.
β οΈ Note β Data streams which LTTng writes for a channel configured with this option may inaccurately report discarded event records as of CTF 1.8 and CTF 2. Not me making it weird, that's just the tea. π΅
β± Timers
--monitor-timer=PERIODUSβ sets the period of the channel's monitor timer to PERIODUS Β΅s π¦
Set PERIODUS to 0 to disable the monitor timer.
Default values:
--userspaceand--buffer-ownership=useroptions β1000000--userspaceand--buffer-ownership=processoptions β1000000--kerneland--buffer-ownership=systemoptions β1000000
--read-timer=PERIODUSβ sets the period of the channel's read timer to PERIODUS Β΅s πΈ
Set PERIODUS to 0 to disable the read timer.
Default values:
--userspaceand--buffer-ownership=useroptions β0--userspaceand--buffer-ownership=processoptions β0--kerneland--buffer-ownership=systemoptions β200000- metadata channel β
0
--switch-timer=PERIODUSβ sets the period of the channel's switch timer to PERIODUS Β΅s π«
Set PERIODUS to 0 to disable the switch timer.
Default values:
--userspaceand--buffer-ownership=useroptions β0--userspaceand--buffer-ownership=processoptions β0--kerneland--buffer-ownership=systemoptions β0- metadata channel β
0
--watchdog-timer=PERIODUSβ sets the period of the channel's watchdog timer to PERIODUS Β΅s π
Set PERIODUS to 0 to disable the watchdog timer.
You may only use this option with the --userspace and --buffer-ownership=user options. Ik, it's picky, but that's the rule.
Default value: 2000000.
βΉοΈ Program information
-h,--helpβ shows 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β lists the available command options and quits π
πͺ EXIT STATUS
0β success β¨1β command error2β undefined command3β fatal error π4β command warning (something went wrong during the command)
π± ENVIRONMENT
LTTNG_ABORT_ON_ERRORβ set to1to 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 (been there π« ).
LTTNG_LIST_LEGACYβ set to1to use the legacy output format (LTTng 2.14 and earlier) for thelttng-list(1)command instead of the modern output format.
Note that the legacy output doesn't show anything related to features introduced after LTTng 2.14. So it's giving throwback, but like, actually.
LTTNG_MAN_BIN_PATHβ absolute path to the manual pager to use to read the LTTng command-line help (withlttng-help(1)or with the--helpoption) instead of/usr/bin/man.LTTNG_NO_UTF_8β set to1to NOT emit multi-byte UTF-8 sequences, even if the locale claims to support it.LTTNG_SESSION_CONFIG_XSD_PATHβ path to the directory containing thesession.xsdrecording session configuration XML schema.LTTNG_SESSIOND_PATHβ absolute path to the LTTng session daemon binary (seelttng-sessiond(8)) to spawn from thelttng-create(1)command.
The --sessiond-path general option overrides this environment variable.
LTTNG_TERM_COLORβ controls when to emit terminal SGR codes in the output.
The NO_COLOR environment variable overrides this.
One of:
auto(default) β only emit SGR codes when the standard output is connected to a color-capable terminal.alwaysβ always emit SGR codes. πneverβ never emit SGR codes.
NO_COLORβ if set and not empty, then it's equivalent to settingLTTNG_TERM_COLORtonever.
See NO_COLOR https://no-color.org/ to learn more.
π 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-create(1) and lttng-set-session(1) 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) 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 (seelttng-save(1)andlttng-load(1))./etc/lttng/sessionsβ directory containing the system-wide saved recording session configurations (seelttng-save(1)andlttng-load(1)).
π Note β$LTTNG_HOMEdefaults to the value of theHOMEenvironment variable.
β¨ EXAMPLES
π§ 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 buffer ownership model in a specific recording session.
See the --session and --buffer-ownership options.
$ lttng enable-channel --session=my-session --userspace \
--buffer-ownership=process my-channel
π Example 3. Create a user space channel with a per-user buffer ownership model (default) and a per-channel buffer allocation policy.
See the --buffer-allocation option.
$ lttng enable-channel --userspace \
--buffer-allocation=per-channel my-channel
π Example 4. Create a user space channel with an "on-demand" preallocation policy and an automatic memory reclaim.
See the --buffer-preallocation and --auto-reclaim-memory options.
$ lttng enable-channel --userspace my-channel \
--buffer-preallocation=on-demand \
--auto-reclaim-memory=older-than:30s
π Example 5. 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 6. 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 7. Enable two user space channels of a specific recording session.
$ lttng enable-channel --session=my-session --userspace \
canal-d,rds
π§ 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:#lttngonirc.oftc.net - Mastodon
https://mastodon.social/@lttng
Β©οΈ 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. Iconic behaviour, honestly. π
π SEE ALSO
And that's the whole page, bestie β this was LTTng 2.15.1, dated 18 December 2025. Go enable some channels, you absolute legend π β¨π¦
π¦ where this page comes from
- ubuntu stonking: lttng-tools 2.15.1-1 Β· LGPL-2.1-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms