LTTNG-SNAPSHOT(1)
π lttng-snapshot π
okay so bestie, welcome to the LTTng Manual β¨ this is section 1 of the manual, and it's all about lttng-snapshot β the command that lets you take a snapshot of an LTTng recording session πΈ
πΈ NAME πΈ
lttng-snapshot β take a snapshot of an LTTng recording session π«Ά
β¨ SYNOPSIS β¨
Take a recording session snapshot:
lttng [GENERAL OPTIONS] snapshot record [--max-size=SIZE]
[--name=NAME] [--session=SESSION]
[--ctrl-url=URL --data-url=URL | URL]
Add a snapshot output to a recording session:
lttng [GENERAL OPTIONS] snapshot add-output [--max-size=SIZE]
[--name=NAME] [--session=SESSION]
(--ctrl-url=URL --data-url=URL | URL)
Show the snapshot output of a recording session:
lttng [GENERAL OPTIONS] snapshot list-output [--session=SESSION]
Remove the snapshot output from a recording session:
lttng [GENERAL OPTIONS] snapshot del-output [--session=SESSION] 1
π¦ DESCRIPTION π¦
The lttng snapshot command can take a snapshot of a recording session, add a snapshot output, remove a snapshot output, and show the snapshot output of a recording session. Which session tho? Depends:
- With the
--session=SESSIONoption β it's the recording session named SESSION π - Without the
--sessionoption β it's the current recording session (peeplttng-concepts(7)to learn more about the current recording session) π«
See lttng-concepts(7) to learn more about recording sessions.
A snapshot is literally just a dump of the current sub-buffers of all the channels of the selected recording session. That's it. That's the whole thing. π
When LTTng takes a snapshot, it sends the sub-buffer dump of the selected recording session either to the local file system, or over the network to a listening relay daemon (lttng-relayd(8)). Want the deets? See the βSnapshot outputβ section below π
NOT me reminding you again: when LTTng takes a snapshot, it does NOT clear the sub-buffers of the selected recording session. In other words, different snapshots of the selected recording session can contain the same event records. no cap. π
You must have created the selected recording session in snapshot mode to use the snapshot command β see the --snapshot option of the lttng-create(1) command, plus lttng-concepts(7) if you wanna learn more about recording session modes. β¨
A snapshot-session trigger action can also take a recording session snapshot (see lttng-add-trigger(1)).
See the βEXAMPLESβ section below for usage examples. π
If you want, instead, to keep all the trace data, but divide it into archived chunks which are then, like snapshots, ready to be processed β see the recording session rotation feature in lttng-concepts(7). Trace chunk archives do NOT overlap like snapshots can. π₯
Note π’ Before you take a snapshot on a system with a high event throughput, the LTTng project recommends that you first run thelttng-stop(1)command. Otherwise, the snapshot could contain βholesβ, the result of the tracers overwriting unconsumed trace packets during the snapshot operation. π After LTTng writes the snapshot trace data, you can restart the recording session with thelttng-start(1)command. π«Ά
π Snapshot output π
When you take a recording session snapshot with the record action, LTTng writes the snapshot trace files to... okay so, it depends:
- If you specify the
URLnon-option argument, or the--ctrl-urland--data-urloptions β the output defined by theURLnon-option argument or by the arguments of the options. Seelttng-create(1)for the format ofURL. - Otherwise β the snapshot output of the selected recording session. Add a snapshot output to a recording session with the
add-outputaction. As of LTTng 2.15.1, you may only add one snapshot output to a given recording session. (yes, one. one singular output. iconic but limited β) When you create a snapshot mode recording session with the--snapshotoption of thelttng-create(1)command, and without its--no-outputoption, thecreatecommand automatically adds a snapshot output namedsnapshot-1to the created recording session:- With its
--output,--set-url,--ctrl-url, or--data-urloptions β equivalent to using theadd-outputaction with the provided or equivalent URL(s) immediately after creating the recording session. - Otherwise β a subdirectory, under the
$LTTNG_HOME/lttng-traces($LTTNG_HOMEdefaults to$HOME) directory, of which the name contains the recording session name and the date/time.
- With its
Show the current snapshot output of a recording session with the list-output action. π
Remove the snapshot output of a recording session with the del-output action. ποΈ
For both the record and add-output actions:
- Assign a name to a snapshot output with the
--name=NAMEoption. NAME becomes part of the snapshot trace file names which LTTng sends to this output. π - By default, the snapshot files can be as big as the sum of the sizes of all the sub-buffers of all the channels of the selected recording session. Set the maximum total size of all the snapshot trace files LTTng writes with the
--max-sizeoption. π
π OPTIONS π
See lttng(1) for GENERAL OPTIONS.
π Recording target π
-s SESSION,--session=SESSIONβ Take a snapshot of the sub-buffers of the recording session named SESSION instead of the current recording session.
π Output π
See the βSnapshot outputβ section above. β¬οΈ
-C URL,--ctrl-url=URLβ Set the control path URL to URL. You must also use the--data-urloption. (they're a package deal bestie, no splitting them up π) Seelttng-create(1)for the format ofURL.-D URL,--data-url=URLβ Set the trace data path URL to URL. You must also use the--ctrl-urloption. Seelttng-create(1)for the format ofURL.-m SIZE,--max-size=SIZEβ Set the maximum total size of all the snapshot trace files LTTng writes when taking a snapshot to SIZE bytes. Thek(KiB),M(MiB), andG(GiB) suffixes are supported. β¨-n NAME,--name=NAMEβ Assign the name NAME to the snapshot output.
π§ Program information π§
-h,--helpβ Show help. This option attempts to launch/usr/bin/manto view this manual page. Override the manual pager path with theLTTNG_MAN_BIN_PATHenvironment variable.--list-optionsβ List available command options and quit.
π« 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 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. π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. (it's giving old-school fr fr πΌ)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-pathgeneral option overrides this environment variable.LTTNG_TERM_COLORβ Controls when to emit terminal SGR codes in the output. TheNO_COLORenvironment 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 athttps://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 oflttng(1).lttng-create(1)andlttng-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--outputoption of thelttng-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. Take a snapshot of the current recording session, sending the trace files to its snapshot output. πΈ
$ lttng snapshot record
Example 2. Take a snapshot of a specific recording session, giving it a custom name.
See the --session and --name options.
$ lttng snapshot record --session=my-session --name=SNAP
Example 3. Take a snapshot of the current recording session, sending the trace files to a custom location.
See the βOutput directoryβ section of lttng-relayd(8) to understand where the relay daemon to connect to (3.96.87.215) writes the received traces. π
$ lttng snapshot record net://3.96.87.215
Example 4. Replace the snapshot output of a specific recording session with a local file system path.
See the --session option.
$ lttng snapshot del-output --session=monk 1
$ lttng snapshot add-output --session=monk \
file:///path/to/snapshots
Example 5. Take a snapshot of the current recording session, making sure its size is not over 4 MiB.
See the --max-size option. π
$ lttng snapshot record --max-size=4M
π 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 for support and development β
https://lists.lttng.org/βlttng-dev@lists.lttng.orgπ - IRC channel β
irc://irc.oftc.net/lttngβ#lttngonirc.oftc.net - Mastodon β
https://mastodon.social/@lttngπ
π COPYRIGHT π
So like, legally speaking? This program is part of the LTTng-tools project, bestie. Periodt.
LTTng-tools is distributed under the GNU General Public License version 2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html>. No cap. And if you want the deets-deets, go read the LICENSE file <https://github.com/lttng/lttng-tools/blob/master/LICENSE> β that's where all the actual details live. β¨
π«Ά THANKS π«Ά
Okay this part is genuinely so sweet, I'm not crying you're crying π
Special thanks to Michel Dagenais and the DORSAL laboratory <http://www.dorsal.polymtl.ca/> at Γcole Polytechnique de MontrΓ©al for the whole LTTng journey. Like, iconic behavior fr fr π
Also thanks to the Ericsson teams working on tracing β they helped out so much with detailed bug reports and unusual test cases. Lowkey heroes ngl π§
π SEE ALSO π
and that's a wrap on the whole page, bestie!! π this is LTTng 2.15.1, dated 14 June 2021 β go forth and snapshot responsibly, mwah ππ¦β¨
π¦ 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