3 :revdate: 7 December 2021
8 lttng-create - Create an LTTng recording session
13 Create a local mode recording session:
16 *lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *create* ['SESSION'] [option:--shm-path='DIR']
17 [option:--no-output | option:--output='DIR' | option:--set-url=**file://**__DIR__]
19 Create a network streaming mode recording session:
22 *lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *create* ['SESSION'] [option:--shm-path='DIR']
23 (option:--set-url='URL' | option:--ctrl-url='URL' option:--data-url='URL')
25 Create a snapshot mode recording session:
28 *lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *create* ['SESSION'] option:--snapshot [option:--shm-path='DIR']
29 [option:--no-output | option:--output='DIR' | option:--set-url='URL' |
30 option:--ctrl-url='URL' option:--data-url='URL']
32 Create a live mode recording session:
35 *lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *create* ['SESSION'] option:--live[='DELAYUS']
36 [option:--shm-path='DIR'] [option:--set-url='URL' | option:--ctrl-url='URL' option:--data-url='URL']
40 The `lttng create` command creates a new recording session for your Unix
41 user within the connected session daemon (see the ``Session daemon
42 connection'' section of man:lttng(1) to learn how a user application
43 connects to a session daemon).
45 See man:lttng-concepts(7) to learn more about recording sessions.
47 Without the 'SESSION' argument, LTTng automatically generates a recording
48 session name having the ++auto-++__YYYYmmdd__++-++__HHMMSS__ form, where
49 'YYYYmmdd' and 'HHMMSS' are the creation date and time. 'SESSION' may
50 :not: contain the character `/`.
52 Specify the path of the directory containing the shared memory files
53 holding the channel ring buffers with the option:--shm-path option.
54 Specifying a location on an NVRAM file system makes it possible to
55 recover the latest recorded trace data when the system reboots after a
56 crash with the man:lttng-crash(1) utility. Note that, as of
57 LTTng{nbsp}{lttng_version}, this feature is only available for user
60 By default, the `create` command automatically spawns:
62 * A session daemon for your Unix user if none is currently running.
64 Override the path of the session daemon binary to spawn with the
65 general genoption:--sessiond-path option.
67 Avoid automatically spawning a session daemon with the general
68 genoption:--no-sessiond option.
70 * A relay daemon (see man:lttng-relayd(8)) if all the following
74 * You specify the option:--live option.
76 * You don't specify any of the option:--set-url, option:--ctrl-url, or
77 option:--data-url options.
79 * No relay daemon is currently listening for TCP connections on
80 +127.0.0.1:{default_network_viewer_port}+ (default LTTng live reader
81 connection address and port).
84 In this case, the `create` command spawns a relay daemon as such:
87 *lttng-relayd* nloption:--live-port=**tcp://localhost:{default_network_viewer_port}**
90 Override the path of the relay daemon binary to spawn with the general
91 genoption:--relayd-path option.
93 On success, the `create` command sets the current recording session (see
94 man:lttng-concepts(7) to learn more) to the created recording session.
96 See the ``<<examples,EXAMPLES>>'' section below for usage examples.
98 Show the status of the current recording session with the
99 man:lttng-status(1) command.
101 List the recording sessions of your Unix user, or of all users if
102 your Unix user is `root`, within the connected session daemon with the
103 man:lttng-list(1) command.
105 Start and stop a recording session with the man:lttng-start(1) and
106 man:lttng-stop(1) commands.
108 Save and load a recording session with the man:lttng-save(1) and
109 man:lttng-load(1) commands.
111 Allow and disallow specific processes to record events with the
112 man:lttng-track(1) and man:lttng-untrack(1) commands.
114 Archive the current trace chunk of (rotate) a recording session with the
115 man:lttng-rotate(1) command.
117 Destroy a recording session with the man:lttng-destroy(1) command.
121 Recording session modes
122 ~~~~~~~~~~~~~~~~~~~~~~~
123 As documented in man:lttng-concepts(7), LTTng offers four recording
126 [[local-mode]]Local mode::
127 Write the trace data to the local file system.
129 The trace data output directory is:
131 With the option:--no-output option:::
132 None: the file system output is disabled.
134 With the option:--output='DIR' or option:--set-url=++file://++__DIR__ option:::
138 A subdirectory, under the `$LTTNG_HOME/lttng-traces` (`$LTTNG_HOME`
139 defaults to `$HOME`) directory, of which the name contains the
140 recording session name and the date/time.
142 [[network-streaming-mode]]Network streaming mode::
143 Send the trace data over the network to a listening relay daemon
144 (see man:lttng-relayd(8)).
146 Set the trace output destination with the option:--set-url option, or
147 with the option:--ctrl-url and option:--data-url options (see the
148 ``<<url-format,URL format>>'' section below).
150 [[snapshot-mode]]Snapshot mode (option:--snapshot option)::
151 Only write the trace data to the local file system or send it to a
152 listening relay daemon (man:lttng-relayd(8)) when LTTng takes a
153 snapshot (see the man:lttng-snapshot(1) command).
155 With this mode, LTTng:
157 With the option:--no-output option:::
158 Does :not: add any snapshot output to the created recording
161 With the option:--output option, the option:--set-url option, or the option:--ctrl-url and option:--data-url options:::
162 Adds a snapshot output named `snapshot-1` using the provided
163 path or URL(s) to the created recording session.
166 Adds an automatic snapshot output named `snapshot-1` to the created
169 The automatic snapshot output is a subdirectory, under the
170 `$LTTNG_HOME/lttng-traces` (`$LTTNG_HOME` defaults to `$HOME`)
171 directory, of which the name contains the recording session name and the
174 [[live-mode]]Live mode (option:--live option)::
175 Send the trace data over the network to a listening relay daemon
176 (see man:lttng-relayd(8)) for live reading.
178 Set the trace output destination with the option:--set-url='URL' option,
179 or with the option:--ctrl-url='URL' and option:--data-url='URL' options
180 (see the ``<<url-format,URL format>>'' section below). 'URL' may :not:
181 start with `file://`.
187 The argument of the option:--set-url='URL', option:--ctrl-url='URL', and
188 option:--data-url='URL' options is an URL.
190 There are two available 'URL' formats.
198 The `file://` protocol targets the *local file system*: you may only use
199 such an URL with the option:--set-url option when you create the
200 recording session in local or snapshot mode (see the ``<<modes,Recording
201 session modes>>'' section above).
204 Absolute path to the directory containing the trace data on the
210 'NETPROTO'://('HOST' | 'IPADDR')[:__CTRLPORT__[:__DATAPORT__]][/'TRACEDIR']
213 This format is only available when you create the recording session in
214 network streaming, snapshot (option:--snapshot), or live (option:--live)
215 mode (see the ``<<modes,Recording session modes>>'' section above).
218 Network protocol, amongst:
224 The default values of 'CTRLPORT' and 'DATAPORT'
225 are respectively {default_network_control_port} and
226 {default_network_data_port}.
231 The default values of 'CTRLPORT' and 'DATAPORT'
232 are respectively {default_network_control_port} and
233 {default_network_data_port}.
236 Same as the `net` protocol.
238 You may only use this with the option:--ctrl-url and option:--data-url
242 Same as the `net6` protocol.
244 You can only be use this with the option:--ctrl-url and
245 option:--data-url options together.
248 ('HOST' | 'IPADDR'):::
249 Hostname or IP address.
251 IPv6 address must be enclosed in square brackets (`[` and{nbsp}`]`);
252 see https://www.ietf.org/rfc/rfc2732.txt[RFC{nbsp}2732].
261 Path of the directory containing the trace data on the remote file
264 This path is relative to the base output directory of the LTTng relay
265 daemon (see the nloption:--output option of man:lttng-relayd(8)).
268 include::common-lttng-cmd-options-head.txt[]
273 See the ``<<modes,Recording session modes>>'' section above.
277 option:--live[='DELAYUS']::
278 Create the recording session in live mode.
280 The optional 'DELAYUS' argument is the maximum time (in µs) you can wait
281 for the data to be flushed (sent to the connected LTTng relay daemon).
282 The default value of 'DELAYUS' is {default_lttng_live_timer}.
284 Set the URL of the relay daemon to connect to with the option:--set-url
285 option, or with the option:--ctrl-url and option:--data-url options,
286 instead of using `net://127.0.0.1`.
288 The session daemon must be able to connect to a listening relay daemon
289 (see man:lttng-relayd(8)).
292 Create the recording session in snapshot mode.
294 This is equivalent to:
299 With the option:--no-output option::
300 Not adding any snapshot output after LTTng creates the recording
303 With the option:--output option, the option:--set-url option, or the option:--ctrl-url and option:--data-url options::
304 Adding a snapshot output named `snapshot-1` using the provided path
305 or URL(s) immediately after LTTng creates the recording session.
308 Adding an automatic snapshot output named `snapshot-1` immediately
309 after LTTng creates the recording session.
311 The automatic snapshot output is a subdirectory, under the
312 `$LTTNG_HOME/lttng-traces` (`$LTTNG_HOME` defaults to `$HOME`)
313 directory, of which the name contains the recording session name and the
317 * Forcing all the channels to be created for the recording session to be
318 configured with the nloption:--override and nloption:--output=++mmap++
319 options (see man:lttng-enable-channel(1)).
325 Depending on the recording session mode (see the ``<<modes,Recording
326 session modes>>'' section above):
329 Disable the file system output.
331 Snapshot mode (option:--snapshot option):::
332 Do :not: add a snapshot output after creating the recording session.
334 option:-o 'DIR', option:--output='DIR'::
335 Equivalent to option:--set-url=++file://++__DIR__.
337 option:--shm-path='DIR'::
338 Set the path of the directory containing the shared memory files
339 holding the channel ring buffers to 'DIR' on the local file sytem.
341 NOTE: As of LTTng{nbsp}{lttng_version}, LTTng only considers this option
342 for user space (including Java and Python) channels, but this may change
348 See the ``<<url-format,URL format>>'' section above to learn more about
349 the syntax of the 'URL' argument of the following options.
351 option:-C 'URL', option:--ctrl-url='URL'::
352 Set the control path URL to 'URL'.
354 You must also use the option:--data-url option.
356 Not available in local mode (see the ``<<modes,Recording session
357 modes>>'' section above).
359 In snapshot mode, this is equivalent to using the nloption:--ctrl-url
360 option of the `add-output` action of the man:lttng-snapshot(1) command
361 immediately after creating the recording session.
363 option:-D 'URL', option:--data-url='URL'::
364 Set the trace data path URL to 'URL'.
366 You must also use the option:--ctrl-url option.
368 Not available in local mode (see the ``<<modes,Recording session
369 modes>>'' section above).
371 In snapshot mode, this is equivalent to using the nloption:--data-url
372 option of the `add-output` action of the man:lttng-snapshot(1) command
373 immediately after creating the recording session.
375 option:-U 'URL', option:--set-url='URL'::
376 Set the destination URL of the control path and trace data to 'URL'.
378 This URL remains unchanged as long as the recording session exists.
380 Depending on the recording session mode (see the ``<<modes,Recording
381 session modes>>'' section above):
384 'URL' must start with `file://`, followed with the destination
385 directory path on the local file system.
387 Network streaming and live modes:::
388 Equivalent to using both the option:--ctrl-url and option:--data-url
391 Snapshot mode (option:--snapshot option):::
392 Equivalent to using the 'URL' non-option argument of the
393 `add-output` action of the man:lttng-snapshot(1) command immediately
394 after creating the recording session.
397 include::common-lttng-cmd-help-options.txt[]
400 include::common-lttng-cmd-after-options.txt[]
406 .Create a normal mode recording session with a generated name.
414 .Create a normal mode recording session with a custom name.
418 $ lttng create my-session
422 .Create a normal mode recording session with a specific output directory.
424 See the option:--output option.
428 $ lttng create --output=/path/to/traces
432 .Create a network streaming mode recording session.
434 See the ``Output directory'' section of man:lttng-relayd(8) to
435 understand where the relay daemon to connect to (`10.0.0.242`) writes
438 See the option:--set-url option.
442 $ lttng create --set-url=net://10.0.0.242/inv4
446 .Create a snapshot mode recording session with a default snapshot output.
448 See the option:--snapshot option.
452 $ lttng create --snapshot
456 .Create a snapshot mode recording session with a custom snapshot output.
458 See the option:--snapshot and option:--set-url options.
462 $ lttng create --snapshot \
463 --set-url=tcp://192.168.1.102:1234:5678/my-snapshots
467 .Create a snapshot mode recording session with no snapshot output.
469 See the option:--snapshot and option:--no-output options.
473 $ lttng create --snapshot --no-output
477 .Create an LTTng live mode recording session with a default relay daemon URL.
479 See the option:--live option.
483 $ lttng create --live
487 .Create an LTTng live mode recording session with a custom live timer period and relay daemon URL.
489 See the option:--live and option:--set-url options.
493 $ lttng create --live=250000 \
494 --set-url=tcp://relayd34:4885:4886
498 .Create a normal mode recording session with a custom directory containing the ring buffer shared memory files.
500 See the option:--shm-path option.
504 $ lttng create my-session --shm-path=/mnt/nvram2/lttng
509 include::common-footer.txt[]
515 man:lttng-destroy(1),
516 man:lttng-enable-channel(1),
520 man:lttng-set-session(1),
524 man:lttng-concepts(7),
526 man:lttng-sessiond(8)