lttng-save(1): add usage examples
[lttng-tools.git] / doc / man / lttng-snapshot.1.txt
CommitLineData
12397c59
PP
1lttng-snapshot(1)
2=================
188419c4 3:revdate: 3 May 2021
12397c59
PP
4
5
6NAME
7----
188419c4 8lttng-snapshot - Take a snapshot of an LTTng tracing session
12397c59
PP
9
10
11SYNOPSIS
12--------
188419c4 13Take a tracing session snapshot:
12397c59
PP
14
15[verse]
188419c4 16*lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *snapshot* *record* [option:--max-size='SIZE']
12397c59 17 [option:--name='NAME'] [option:--session='SESSION']
188419c4 18 [option:--ctrl-url='URL' option:--data-url='URL' | 'URL']
12397c59 19
188419c4 20Add a snapshot output to a tracing session:
12397c59
PP
21
22[verse]
188419c4
PP
23*lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *snapshot* *add-output* [option:--max-size='SIZE']
24 [option:--name='NAME'] [option:--session='SESSION']
25 (option:--ctrl-url='URL' option:--data-url='URL' | 'URL')
12397c59 26
188419c4 27Show the snapshot output of a tracing session:
12397c59
PP
28
29[verse]
188419c4 30*lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *snapshot* *list-output* [option:--session='SESSION']
12397c59 31
188419c4 32Remove the snapshot output from a tracing session:
12397c59
PP
33
34[verse]
188419c4 35*lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *snapshot* *del-output* [option:--session='SESSION'] *1*
12397c59
PP
36
37
38DESCRIPTION
39-----------
188419c4
PP
40The `lttng snapshot` command can take a snapshot of, add or remove a
41snapshot output, and show the snapshot output of:
12397c59 42
188419c4
PP
43With the option:--session='SESSION' option::
44 The tracing session named 'SESSION'.
12397c59 45
188419c4
PP
46Without the option:--session option::
47 The current tracing session (see man:lttng-concepts(7) to learn more
48 about the current tracing session).
12397c59 49
188419c4 50See man:lttng-concepts(7) to learn more about tracing sessions.
12397c59 51
188419c4
PP
52A _snapshot_ is a dump of the current sub-buffers of all the channels of
53the selected tracing session.
12397c59 54
188419c4
PP
55When LTTng takes a snapshot, it sends the sub-buffer dump of the
56selected tracing session to the local file system or over the network to
57a listening relay daemon (man:lttng-relayd(8)). See the
58<<output,Snapshot output>> section below to learn more.
12397c59 59
188419c4
PP
60When LTTng takes a snapshot, it does :not: clear the sub-buffers of the
61selected tracing session. In other words, different snapshots of the
62selected tracing session can contain the same event records.
12397c59 63
188419c4
PP
64You must have created the selected tracing session in snapshot mode (see
65the nloption:--snapshot option of the man:lttng-create(1) command as
66well as man:lttng-concepts(7) to learn more about tracing session modes)
67to use the `snapshot` command.
12397c59 68
188419c4
PP
69A `snapshot-session` trigger action can also take a tracing session
70snapshot (see man:lttng-add-trigger(1)).
12397c59 71
188419c4
PP
72If you want, instead, to keep all the trace data, but divide it into
73archived chunks which are then, like snapshots, ready to be processed,
74see the tracing session rotation feature in man:lttng-concepts(7). Trace
75chunk archives do :not: overlap like snapshots can.
12397c59 76
188419c4
PP
77[NOTE]
78====
79Before you take a snapshot on a system with a high event throughput, the
80LTTng project recommends that you first run the man:lttng-stop(1)
81command. Otherwise, the snapshot could contain ``holes'', the result of
82the tracers overwriting unconsumed trace packets during the snapshot
83operation.
12397c59 84
188419c4
PP
85After LTTng writes the snapshot trace data, you can restart the tracing
86session with the man:lttng-start(1) command.
87====
12397c59 88
12397c59 89
188419c4
PP
90[[output]]
91Snapshot output
92~~~~~~~~~~~~~~~
93When you take a tracing session snapshot with the `record` action, LTTng
94writes the snapshot trace files to:
95
96If you specify the 'URL' non-option argument or the option:--ctrl-url and option:--data-url options::
97 The output defined by the 'URL' non-option argument or by the
98 arguments of the options.
99+
100See man:lttng-create(1) for the format of 'URL'.
101
102Otherwise::
103 The snapshot output of the selected tracing session.
104+
105Add a snapshot output to a tracing session with the `add-output` action.
106As of LTTng{nbsp}{lttng_version}, you may only add one snapshot output
107to a given tracing session.
108+
109When you create a snapshot mode tracing session with the
110nloption:--snapshot option of the man:lttng-create(1) command, and
111without its nloption:--no-output option, the `create` command
112automatically adds a snapshot output named `snapshot-1` to the created
113tracing session:
114+
115--
116With its nloption:--output, nloption:--set-url, nloption:--ctrl-url, or nloption:--data-url options::
117 Equivalent to using the `add-output` action with the provided or
118 equivalent URL(s) immediately after creating the tracing session.
119
120Otherwise::
121 A subdirectory, under the `$LTTNG_HOME/lttng-traces` (`$LTTNG_HOME`
122 defaults to `$HOME`) directory, of which the name contains the
123 tracing session name and the date/time.
124--
125+
126Show the current snapshot output of a tracing session with the
127`list-output` action.
128+
129Remove the snapshot output of a tracing session with the
130`del-output` action.
131
132For both the `record` and `add-output` actions:
133
134* Assign a name to a snapshot output with the option:--name='NAME'
135 option.
136+
137'NAME' becomes part of the snapshot trace file names which LTTng sends
138to this output.
139
140* By default, the snapshot files can be as big as the sum of the sizes
141 of all the sub-buffers of all the channels of the selected tracing
142 session.
143+
144Set the maximum total size of all the snapshot trace files LTTng writes
145with the option:--max-size option.
12397c59
PP
146
147
55e06994 148include::common-lttng-cmd-options-head.txt[]
12397c59
PP
149
150
188419c4
PP
151Recording target
152~~~~~~~~~~~~~~~~
59b19c3c 153option:-s 'SESSION', option:--session='SESSION'::
188419c4
PP
154 Take a snapshot of the sub-buffers of the tracing session named
155 'SESSION' instead of the current tracing session.
12397c59
PP
156
157
188419c4
PP
158Output
159~~~~~~
160See the <<output,Snapshot output>> section above.
161
59b19c3c 162option:-C 'URL', option:--ctrl-url='URL'::
188419c4
PP
163 Set the control path URL to 'URL'.
164+
165You must also use the option:--data-url option.
166+
167See man:lttng-create(1) for the format of 'URL'.
12397c59 168
59b19c3c 169option:-D 'URL', option:--data-url='URL'::
188419c4
PP
170 Set the trace data path URL to 'URL'.
171+
172You must also use the option:--ctrl-url option.
173+
174See man:lttng-create(1) for the format of 'URL'.
12397c59 175
59b19c3c 176option:-m 'SIZE', option:--max-size='SIZE'::
188419c4
PP
177 Set the maximum total size of all the snapshot trace files LTTng
178 writes when taking a snapshot to 'SIZE' bytes.
179+
180The `k`{nbsp}(KiB), `M`{nbsp}(MiB), and `G`{nbsp}(GiB) suffixes are
181supported.
12397c59 182
59b19c3c 183option:-n 'NAME', option:--name='NAME'::
12397c59
PP
184 Assign the name 'NAME' to the snapshot output.
185
186
55e06994 187include::common-lttng-cmd-help-options.txt[]
12397c59
PP
188
189
55e06994
PP
190include::common-lttng-cmd-after-options.txt[]
191
192
193include::common-footer.txt[]
12397c59
PP
194
195
196SEE ALSO
197--------
188419c4 198man:lttng(1),
21b35b3a
PP
199man:lttng-create(1),
200man:lttng-concepts(7)
This page took 0.04151 seconds and 4 git commands to generate.