1LTTNG-SNAPSHOT(1) LTTng Manual LTTNG-SNAPSHOT(1)
2
3
4
6 lttng-snapshot - Take a snapshot of an LTTng recording session
7
9 Take a recording session snapshot:
10
11 lttng [GENERAL OPTIONS] snapshot record [--max-size=SIZE]
12 [--name=NAME] [--session=SESSION]
13 [--ctrl-url=URL --data-url=URL | URL]
14
15 Add a snapshot output to a recording session:
16
17 lttng [GENERAL OPTIONS] snapshot add-output [--max-size=SIZE]
18 [--name=NAME] [--session=SESSION]
19 (--ctrl-url=URL --data-url=URL | URL)
20
21 Show the snapshot output of a recording session:
22
23 lttng [GENERAL OPTIONS] snapshot list-output [--session=SESSION]
24
25 Remove the snapshot output from a recording session:
26
27 lttng [GENERAL OPTIONS] snapshot del-output [--session=SESSION] 1
28
30 The lttng snapshot command can take a snapshot of, add or remove a
31 snapshot output, and show the snapshot output of:
32
33 With the --session=SESSION option
34 The recording session named SESSION.
35
36 Without the --session option
37 The current recording session (see lttng-concepts(7) to learn more
38 about the current recording session).
39
40 See lttng-concepts(7) to learn more about recording sessions.
41
42 A snapshot is a dump of the current sub-buffers of all the channels of
43 the selected recording session.
44
45 When LTTng takes a snapshot, it sends the sub-buffer dump of the
46 selected recording session to the local file system or over the network
47 to a listening relay daemon (lttng-relayd(8)). See the “Snapshot
48 output” section below to learn more.
49
50 When LTTng takes a snapshot, it does NOT clear the sub-buffers of the
51 selected recording session. In other words, different snapshots of the
52 selected recording session can contain the same event records.
53
54 You must have created the selected recording session in snapshot mode
55 (see the --snapshot option of the lttng-create(1) command as well as
56 lttng-concepts(7) to learn more about recording session modes) to use
57 the snapshot command.
58
59 A snapshot-session trigger action can also take a recording session
60 snapshot (see lttng-add-trigger(1)).
61
62 See the “EXAMPLES” section below for usage examples.
63
64 If you want, instead, to keep all the trace data, but divide it into
65 archived chunks which are then, like snapshots, ready to be processed,
66 see the recording session rotation feature in lttng-concepts(7). Trace
67 chunk archives do NOT overlap like snapshots can.
68
69 Note
70 Before you take a snapshot on a system with a high event
71 throughput, the LTTng project recommends that you first run the
72 lttng-stop(1) command. Otherwise, the snapshot could contain
73 “holes”, the result of the tracers overwriting unconsumed trace
74 packets during the snapshot operation.
75
76 After LTTng writes the snapshot trace data, you can restart the
77 recording session with the lttng-start(1) command.
78
79 Snapshot output
80 When you take a recording session snapshot with the record action,
81 LTTng writes the snapshot trace files to:
82
83 If you specify the URL non-option argument or the --ctrl-url and
84 --data-url options
85 The output defined by the URL non-option argument or by the
86 arguments of the options.
87
88 See lttng-create(1) for the format of URL.
89
90 Otherwise
91 The snapshot output of the selected recording session.
92
93 Add a snapshot output to a recording session with the add-output
94 action. As of LTTng 2.13.7, you may only add one snapshot output to
95 a given recording session.
96
97 When you create a snapshot mode recording session with the
98 --snapshot option of the lttng-create(1) command, and without its
99 --no-output option, the create command automatically adds a
100 snapshot output named snapshot-1 to the created recording session:
101
102 With its --output, --set-url, --ctrl-url, or --data-url options
103 Equivalent to using the add-output action with the provided or
104 equivalent URL(s) immediately after creating the recording
105 session.
106
107 Otherwise
108 A subdirectory, under the $LTTNG_HOME/lttng-traces ($LTTNG_HOME
109 defaults to $HOME) directory, of which the name contains the
110 recording session name and the date/time.
111
112 Show the current snapshot output of a recording session with the
113 list-output action.
114
115 Remove the snapshot output of a recording session with the del-
116 output action.
117
118 For both the record and add-output actions:
119
120 • Assign a name to a snapshot output with the --name=NAME option.
121
122 NAME becomes part of the snapshot trace file names which LTTng
123 sends to this output.
124
125 • By default, the snapshot files can be as big as the sum of the
126 sizes of all the sub-buffers of all the channels of the selected
127 recording session.
128
129 Set the maximum total size of all the snapshot trace files LTTng
130 writes with the --max-size option.
131
133 See lttng(1) for GENERAL OPTIONS.
134
135 Recording target
136 -s SESSION, --session=SESSION
137 Take a snapshot of the sub-buffers of the recording session named
138 SESSION instead of the current recording session.
139
140 Output
141 See the “Snapshot output” section above.
142
143 -C URL, --ctrl-url=URL
144 Set the control path URL to URL.
145
146 You must also use the --data-url option.
147
148 See lttng-create(1) for the format of URL.
149
150 -D URL, --data-url=URL
151 Set the trace data path URL to URL.
152
153 You must also use the --ctrl-url option.
154
155 See lttng-create(1) for the format of URL.
156
157 -m SIZE, --max-size=SIZE
158 Set the maximum total size of all the snapshot trace files LTTng
159 writes when taking a snapshot to SIZE bytes.
160
161 The k (KiB), M (MiB), and G (GiB) suffixes are supported.
162
163 -n NAME, --name=NAME
164 Assign the name NAME to the snapshot output.
165
166 Program information
167 -h, --help
168 Show help.
169
170 This option attempts to launch /usr/bin/man to view this manual
171 page. Override the manual pager path with the LTTNG_MAN_BIN_PATH
172 environment variable.
173
174 --list-options
175 List available command options and quit.
176
178 0
179 Success
180
181 1
182 Command error
183
184 2
185 Undefined command
186
187 3
188 Fatal error
189
190 4
191 Command warning (something went wrong during the command)
192
194 LTTNG_ABORT_ON_ERROR
195 Set to 1 to abort the process after the first error is encountered.
196
197 LTTNG_HOME
198 Path to the LTTng home directory.
199
200 Defaults to $HOME.
201
202 Useful when the Unix user running the commands has a non-writable
203 home directory.
204
205 LTTNG_MAN_BIN_PATH
206 Absolute path to the manual pager to use to read the LTTng
207 command-line help (with lttng-help(1) or with the --help option)
208 instead of /usr/bin/man.
209
210 LTTNG_SESSION_CONFIG_XSD_PATH
211 Path to the directory containing the session.xsd recording session
212 configuration XML schema.
213
214 LTTNG_SESSIOND_PATH
215 Absolute path to the LTTng session daemon binary (see lttng-
216 sessiond(8)) to spawn from the lttng-create(1) command.
217
218 The --sessiond-path general option overrides this environment
219 variable.
220
222 $LTTNG_HOME/.lttngrc
223 Unix user’s LTTng runtime configuration.
224
225 This is where LTTng stores the name of the Unix user’s current
226 recording session between executions of lttng(1). lttng-create(1)
227 and lttng-set-session(1) set the current recording session.
228
229 $LTTNG_HOME/lttng-traces
230 Default output directory of LTTng traces in local and snapshot
231 modes.
232
233 Override this path with the --output option of the lttng-create(1)
234 command.
235
236 $LTTNG_HOME/.lttng
237 Unix user’s LTTng runtime and configuration directory.
238
239 $LTTNG_HOME/.lttng/sessions
240 Default directory containing the Unix user’s saved recording
241 session configurations (see lttng-save(1) and lttng-load(1)).
242
243 /usr/local/etc/lttng/sessions
244 Directory containing the system-wide saved recording session
245 configurations (see lttng-save(1) and lttng-load(1)).
246
247 Note
248 $LTTNG_HOME defaults to the value of the HOME environment variable.
249
251 Example 1. Take a snapshot of the current recording session, sending
252 the trace files to its snapshot output.
253
254 $ lttng snapshot record
255
256 Example 2. Take a snapshot of a specific recording session, giving it a
257 custom name.
258
259 See the --session and --name options.
260
261 $ lttng snapshot record --session=my-session --name=SNAP
262
263 Example 3. Take a snapshot of the current recording session, sending
264 the trace files to a custom location.
265
266 See the “Output directory” section of lttng-relayd(8) to understand
267 where the relay daemon to connect to (3.96.87.215) writes the
268 received traces.
269
270 $ lttng snapshot record net://3.96.87.215
271
272 Example 4. Replace the snapshot output of a specific recording session
273 with a local file system path.
274
275 See the --session option.
276
277 $ lttng snapshot del-output --session=monk 1
278 $ lttng snapshot add-output --session=monk \
279 file:///path/to/snapshots
280
281 Example 5. Take a snapshot of the current recording session, making
282 sure its size is not over 4 MiB.
283
284 See the --max-size option.
285
286 $ lttng snapshot record --max-size=4M
287
289 • LTTng project website <https://lttng.org>
290
291 • LTTng documentation <https://lttng.org/docs>
292
293 • LTTng bug tracker <https://bugs.lttng.org>
294
295 • Git repositories <https://git.lttng.org>
296
297 • GitHub organization <https://github.com/lttng>
298
299 • Continuous integration <https://ci.lttng.org/>
300
301 • Mailing list <https://lists.lttng.org/> for support and
302 development: lttng-dev@lists.lttng.org
303
304 • IRC channel <irc://irc.oftc.net/lttng>: #lttng on irc.oftc.net
305
307 This program is part of the LTTng-tools project.
308
309 LTTng-tools is distributed under the GNU General Public License
310 version 2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html>.
311 See the LICENSE <https://github.com/lttng/lttng-
312 tools/blob/master/LICENSE> file for details.
313
315 Special thanks to Michel Dagenais and the DORSAL laboratory
316 <http://www.dorsal.polymtl.ca/> at École Polytechnique de Montréal for
317 the LTTng journey.
318
319 Also thanks to the Ericsson teams working on tracing which helped us
320 greatly with detailed bug reports and unusual test cases.
321
323 lttng(1), lttng-create(1), lttng-concepts(7)
324
325
326
327LTTng 2.13.7 14 June 2021 LTTNG-SNAPSHOT(1)