'\" t .\" Title: lttng-snapshot .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 14 June 2021 .\" Manual: LTTng Manual .\" Source: LTTng 2.13.11 .\" Language: English .\" .TH "LTTNG\-SNAPSHOT" "1" "14 June 2021" "LTTng 2\&.13\&.11" "LTTng Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" lttng-snapshot \- Take a snapshot of an LTTng recording session .SH "SYNOPSIS" .sp Take a recording session snapshot: .sp .nf \fBlttng\fR [\fIGENERAL OPTIONS\fR] \fBsnapshot\fR \fBrecord\fR [\fB--max-size\fR=\fISIZE\fR] [\fB--name\fR=\fINAME\fR] [\fB--session\fR=\fISESSION\fR] [\fB--ctrl-url\fR=\fIURL\fR \fB--data-url\fR=\fIURL\fR | \fIURL\fR] .fi .sp Add a snapshot output to a recording session: .sp .nf \fBlttng\fR [\fIGENERAL OPTIONS\fR] \fBsnapshot\fR \fBadd\-output\fR [\fB--max-size\fR=\fISIZE\fR] [\fB--name\fR=\fINAME\fR] [\fB--session\fR=\fISESSION\fR] (\fB--ctrl-url\fR=\fIURL\fR \fB--data-url\fR=\fIURL\fR | \fIURL\fR) .fi .sp Show the snapshot output of a recording session: .sp .nf \fBlttng\fR [\fIGENERAL OPTIONS\fR] \fBsnapshot\fR \fBlist\-output\fR [\fB--session\fR=\fISESSION\fR] .fi .sp Remove the snapshot output from a recording session: .sp .nf \fBlttng\fR [\fIGENERAL OPTIONS\fR] \fBsnapshot\fR \fBdel\-output\fR [\fB--session\fR=\fISESSION\fR] \fB1\fR .fi .SH "DESCRIPTION" .sp The \fBlttng snapshot\fR command can take a snapshot of, add or remove a snapshot output, and show the snapshot output of: .PP With the \fB--session\fR=\fISESSION\fR option .RS 4 The recording session named \fISESSION\fR\&. .RE .PP Without the \fB--session\fR option .RS 4 The current recording session (see \fBlttng-concepts\fR(7) to learn more about the current recording session)\&. .RE .sp See \fBlttng-concepts\fR(7) to learn more about recording sessions\&. .sp A \fIsnapshot\fR is a dump of the current sub\-buffers of all the channels of the selected recording session\&. .sp When LTTng takes a snapshot, it sends the sub\-buffer dump of the selected recording session to the local file system or over the network to a listening relay daemon (\fBlttng-relayd\fR(8))\&. See the \(lqSnapshot output\(rq section below to learn more\&. .sp 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\&. .sp You must have created the selected recording session in snapshot mode (see the \fB--snapshot\fR option of the \fBlttng-create\fR(1) command as well as \fBlttng-concepts\fR(7) to learn more about recording session modes) to use the \fBsnapshot\fR command\&. .sp A \fBsnapshot-session\fR trigger action can also take a recording session snapshot (see \fBlttng-add-trigger\fR(1))\&. .sp See the \(lqEXAMPLES\(rq section below for usage examples\&. .sp 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 \fBlttng-concepts\fR(7)\&. Trace chunk archives do NOT overlap like snapshots can\&. .if n \{\ .sp .\} .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .RS 4 .sp Before you take a snapshot on a system with a high event throughput, the LTTng project recommends that you first run the \fBlttng-stop\fR(1) command\&. Otherwise, the snapshot could contain \(lqholes\(rq, the result of the tracers overwriting unconsumed trace packets during the snapshot operation\&. .sp After LTTng writes the snapshot trace data, you can restart the recording session with the \fBlttng-start\fR(1) command\&. .sp .5v .RE .SS "Snapshot output" .sp When you take a recording session snapshot with the \fBrecord\fR action, LTTng writes the snapshot trace files to: .PP If you specify the \fIURL\fR non\-option argument or the \fB--ctrl-url\fR and \fB--data-url\fR options .RS 4 The output defined by the \fIURL\fR non\-option argument or by the arguments of the options\&. .sp See \fBlttng-create\fR(1) for the format of \fIURL\fR\&. .RE .PP Otherwise .RS 4 The snapshot output of the selected recording session\&. .sp Add a snapshot output to a recording session with the \fBadd-output\fR action\&. As of LTTng\ \&2\&.13\&.11, you may only add one snapshot output to a given recording session\&. .sp When you create a snapshot mode recording session with the \fB--snapshot\fR option of the \fBlttng-create\fR(1) command, and without its \fB--no-output\fR option, the \fBcreate\fR command automatically adds a snapshot output named \fBsnapshot-1\fR to the created recording session: .PP With its \fB--output\fR, \fB--set-url\fR, \fB--ctrl-url\fR, or \fB--data-url\fR options .RS 4 Equivalent to using the \fBadd-output\fR action with the provided or equivalent URL(s) immediately after creating the recording session\&. .RE .PP Otherwise .RS 4 A subdirectory, under the \fB$LTTNG_HOME/lttng-traces\fR (\fB$LTTNG_HOME\fR defaults to \fB$HOME\fR) directory, of which the name contains the recording session name and the date/time\&. .RE .sp Show the current snapshot output of a recording session with the \fBlist-output\fR action\&. .sp Remove the snapshot output of a recording session with the \fBdel-output\fR action\&. .RE .sp For both the \fBrecord\fR and \fBadd-output\fR actions: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Assign a name to a snapshot output with the \fB--name\fR=\fINAME\fR option\&. .sp \fINAME\fR becomes part of the snapshot trace file names which LTTng sends to this output\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} 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\&. .sp Set the maximum total size of all the snapshot trace files LTTng writes with the \fB--max-size\fR option\&. .RE .SH "OPTIONS" .sp See \fBlttng\fR(1) for \fIGENERAL OPTIONS\fR\&. .SS "Recording target" .PP \fB-s\fR \fISESSION\fR, \fB--session\fR=\fISESSION\fR .RS 4 Take a snapshot of the sub\-buffers of the recording session named \fISESSION\fR instead of the current recording session\&. .RE .SS "Output" .sp See the \(lqSnapshot output\(rq section above\&. .PP \fB-C\fR \fIURL\fR, \fB--ctrl-url\fR=\fIURL\fR .RS 4 Set the control path URL to \fIURL\fR\&. .sp You must also use the \fB--data-url\fR option\&. .sp See \fBlttng-create\fR(1) for the format of \fIURL\fR\&. .RE .PP \fB-D\fR \fIURL\fR, \fB--data-url\fR=\fIURL\fR .RS 4 Set the trace data path URL to \fIURL\fR\&. .sp You must also use the \fB--ctrl-url\fR option\&. .sp See \fBlttng-create\fR(1) for the format of \fIURL\fR\&. .RE .PP \fB-m\fR \fISIZE\fR, \fB--max-size\fR=\fISIZE\fR .RS 4 Set the maximum total size of all the snapshot trace files LTTng writes when taking a snapshot to \fISIZE\fR bytes\&. .sp The \fBk\fR\ \&(KiB), \fBM\fR\ \&(MiB), and \fBG\fR\ \&(GiB) suffixes are supported\&. .RE .PP \fB-n\fR \fINAME\fR, \fB--name\fR=\fINAME\fR .RS 4 Assign the name \fINAME\fR to the snapshot output\&. .RE .SS "Program information" .PP \fB-h\fR, \fB--help\fR .RS 4 Show help\&. .sp This option attempts to launch \fB/usr/bin/man\fR to view this manual page\&. Override the manual pager path with the \fBLTTNG_MAN_BIN_PATH\fR environment variable\&. .RE .PP \fB--list-options\fR .RS 4 List available command options and quit\&. .RE .SH "EXIT STATUS" .PP \fB0\fR .RS 4 Success .RE .PP \fB1\fR .RS 4 Command error .RE .PP \fB2\fR .RS 4 Undefined command .RE .PP \fB3\fR .RS 4 Fatal error .RE .PP \fB4\fR .RS 4 Command warning (something went wrong during the command) .RE .SH "ENVIRONMENT" .PP \fBLTTNG_ABORT_ON_ERROR\fR .RS 4 Set to \fB1\fR to abort the process after the first error is encountered\&. .RE .PP \fBLTTNG_HOME\fR .RS 4 Path to the LTTng home directory\&. .sp Defaults to \fB$HOME\fR\&. .sp Useful when the Unix user running the commands has a non\-writable home directory\&. .RE .PP \fBLTTNG_MAN_BIN_PATH\fR .RS 4 Absolute path to the manual pager to use to read the LTTng command\-line help (with \fBlttng-help\fR(1) or with the \fB--help\fR option) instead of \fB/usr/bin/man\fR\&. .RE .PP \fBLTTNG_SESSION_CONFIG_XSD_PATH\fR .RS 4 Path to the directory containing the \fBsession.xsd\fR recording session configuration XML schema\&. .RE .PP \fBLTTNG_SESSIOND_PATH\fR .RS 4 Absolute path to the LTTng session daemon binary (see \fBlttng-sessiond\fR(8)) to spawn from the \fBlttng-create\fR(1) command\&. .sp The \fB--sessiond-path\fR general option overrides this environment variable\&. .RE .SH "FILES" .PP \fB$LTTNG_HOME/.lttngrc\fR .RS 4 Unix user\(cqs LTTng runtime configuration\&. .sp This is where LTTng stores the name of the Unix user\(cqs current recording session between executions of \fBlttng\fR(1)\&. \fBlttng-create\fR(1) and \fBlttng-set-session\fR(1) set the current recording session\&. .RE .PP \fB$LTTNG_HOME/lttng-traces\fR .RS 4 Default output directory of LTTng traces in local and snapshot modes\&. .sp Override this path with the \fB--output\fR option of the \fBlttng-create\fR(1) command\&. .RE .PP \fB$LTTNG_HOME/.lttng\fR .RS 4 Unix user\(cqs LTTng runtime and configuration directory\&. .RE .PP \fB$LTTNG_HOME/.lttng/sessions\fR .RS 4 Default directory containing the Unix user\(cqs saved recording session configurations (see \fBlttng-save\fR(1) and \fBlttng-load\fR(1))\&. .RE .PP \fB/etc/lttng/sessions\fR .RS 4 Directory containing the system\-wide saved recording session configurations (see \fBlttng-save\fR(1) and \fBlttng-load\fR(1))\&. .RE .if n \{\ .sp .\} .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .RS 4 .sp \fB$LTTNG_HOME\fR defaults to the value of the \fBHOME\fR environment variable\&. .sp .5v .RE .SH "EXAMPLES" .PP \fBExample\ \&1.\ \&Take a snapshot of the current recording session, sending the trace files to its snapshot output\&.\fR .RS 4 .sp .if n \{\ .RS 4 .\} .nf $ lttng snapshot record .fi .if n \{\ .RE .\} .RE .PP \fBExample\ \&2.\ \&Take a snapshot of a specific recording session, giving it a custom name\&.\fR .RS 4 .sp See the \fB--session\fR and \fB--name\fR options\&. .sp .if n \{\ .RS 4 .\} .nf $ lttng snapshot record \-\-session=my\-session \-\-name=SNAP .fi .if n \{\ .RE .\} .RE .PP \fBExample\ \&3.\ \&Take a snapshot of the current recording session, sending the trace files to a custom location\&.\fR .RS 4 .sp See the \(lqOutput directory\(rq section of \fBlttng-relayd\fR(8) to understand where the relay daemon to connect to (\fB3.96.87.215\fR) writes the received traces\&. .sp .if n \{\ .RS 4 .\} .nf $ lttng snapshot record net://3\&.96\&.87\&.215 .fi .if n \{\ .RE .\} .RE .PP \fBExample\ \&4.\ \&Replace the snapshot output of a specific recording session with a local file system path\&.\fR .RS 4 .sp See the \fB--session\fR option\&. .sp .if n \{\ .RS 4 .\} .nf $ lttng snapshot del\-output \-\-session=monk 1 $ lttng snapshot add\-output \-\-session=monk \e file:///path/to/snapshots .fi .if n \{\ .RE .\} .RE .PP \fBExample\ \&5.\ \&Take a snapshot of the current recording session, making sure its size is not over 4\ \&MiB\&.\fR .RS 4 .sp See the \fB--max-size\fR option\&. .sp .if n \{\ .RS 4 .\} .nf $ lttng snapshot record \-\-max\-size=4M .fi .if n \{\ .RE .\} .RE .SH "RESOURCES" .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} LTTng project website .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} LTTng documentation .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} LTTng bug tracker .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Git repositories .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} GitHub organization .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Continuous integration .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Mailing list for support and development: \fBlttng-dev@lists.lttng.org\fR .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} IRC channel : \fB#lttng\fR on \fBirc.oftc.net\fR .RE .SH "COPYRIGHT" .sp This program is part of the LTTng\-tools project\&. .sp LTTng\-tools is distributed under the GNU General Public License version\ \&2 \&. See the \fBLICENSE\fR file for details\&. .SH "THANKS" .sp Special thanks to Michel Dagenais and the DORSAL laboratory at \('Ecole Polytechnique de Montr\('eal for the LTTng journey\&. .sp Also thanks to the Ericsson teams working on tracing which helped us greatly with detailed bug reports and unusual test cases\&. .SH "SEE ALSO" .sp \fBlttng\fR(1), \fBlttng-create\fR(1), \fBlttng-concepts\fR(7)