docs: Add supported versions and fix-backport policy
[lttng-tools.git] / doc / man / lttng-create.1.txt
CommitLineData
ba50d967
PP
1lttng-create(1)
2===============
d22ba1ec 3:revdate: 7 December 2021
ba50d967
PP
4
5
6NAME
7----
e9711845 8lttng-create - Create an LTTng recording session
ba50d967
PP
9
10
11SYNOPSIS
12--------
e9711845 13Create a local mode recording session:
ba50d967
PP
14
15[verse]
484b2a0c 16*lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *create* ['SESSION'] [option:--shm-path='DIR']
26f0c779 17 [option:--no-output | option:--output='DIR' | option:--set-url=**file://**__DIR__]
f87c4756 18
e9711845 19Create a network streaming mode recording session:
f87c4756
PP
20
21[verse]
484b2a0c 22*lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *create* ['SESSION'] [option:--shm-path='DIR']
1f3c3a24 23 (option:--set-url='URL' | option:--ctrl-url='URL' option:--data-url='URL')
980bb5fd 24
e9711845 25Create a snapshot mode recording session:
ba50d967
PP
26
27[verse]
26f0c779
PP
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']
ba50d967 31
e9711845 32Create a live mode recording session:
ba50d967
PP
33
34[verse]
1f3c3a24 35*lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *create* ['SESSION'] option:--live[='DELAYUS']
484b2a0c 36 [option:--shm-path='DIR'] [option:--set-url='URL' | option:--ctrl-url='URL' option:--data-url='URL']
ba50d967
PP
37
38DESCRIPTION
39-----------
e9711845 40The `lttng create` command creates a new recording session for your Unix
26f0c779
PP
41user within the connected session daemon (see the ``Session daemon
42connection'' section of man:lttng(1) to learn how a user application
43connects to a session daemon).
484b2a0c 44
e9711845 45See man:lttng-concepts(7) to learn more about recording sessions.
484b2a0c 46
e9711845 47Without the 'SESSION' argument, LTTng automatically generates a recording
484b2a0c
PP
48session 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 `/`.
51
52Specify the path of the directory containing the shared memory files
53holding the channel ring buffers with the option:--shm-path option.
54Specifying a location on an NVRAM file system makes it possible to
55recover the latest recorded trace data when the system reboots after a
d22ba1ec
PP
56crash with the man:lttng-crash(1) utility. Note that, as of
57LTTng{nbsp}{lttng_version}, this feature is only available for user
58space channels.
484b2a0c 59
efacf910
PP
60By default, the `create` command automatically spawns:
61
62* A session daemon for your Unix user if none is currently running.
63+
64Override the path of the session daemon binary to spawn with the
65general genoption:--sessiond-path option.
66+
67Avoid automatically spawning a session daemon with the general
68genoption:--no-sessiond option.
69
70* A relay daemon (see man:lttng-relayd(8)) if all the following
71 statements are true:
72+
73--
74* You specify the option:--live option.
75
76* You don't specify any of the option:--set-url, option:--ctrl-url, or
77 option:--data-url options.
78
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).
82--
83+
84In this case, the `create` command spawns a relay daemon as such:
85+
86[verse]
87*lttng-relayd* nloption:--live-port=**tcp://localhost:{default_network_viewer_port}**
88{nbsp}
89+
90Override the path of the relay daemon binary to spawn with the general
91genoption:--relayd-path option.
484b2a0c 92
e9711845
PP
93On success, the `create` command sets the current recording session (see
94man:lttng-concepts(7) to learn more) to the created recording session.
26f0c779 95
da39b67c 96See the ``<<examples,EXAMPLES>>'' section below for usage examples.
ebbd679f 97
e9711845 98Show the status of the current recording session with the
26f0c779
PP
99man:lttng-status(1) command.
100
e9711845 101List the recording sessions of your Unix user, or of all users if
26f0c779
PP
102your Unix user is `root`, within the connected session daemon with the
103man:lttng-list(1) command.
ba50d967 104
e9711845 105Start and stop a recording session with the man:lttng-start(1) and
484b2a0c 106man:lttng-stop(1) commands.
ba50d967 107
e9711845 108Save and load a recording session with the man:lttng-save(1) and
484b2a0c
PP
109man:lttng-load(1) commands.
110
26f0c779
PP
111Allow and disallow specific processes to record events with the
112man:lttng-track(1) and man:lttng-untrack(1) commands.
113
e9711845 114Archive the current trace chunk of (rotate) a recording session with the
484b2a0c
PP
115man:lttng-rotate(1) command.
116
e9711845 117Destroy a recording session with the man:lttng-destroy(1) command.
484b2a0c
PP
118
119
484b2a0c 120[[modes]]
e9711845
PP
121Recording session modes
122~~~~~~~~~~~~~~~~~~~~~~~
123As documented in man:lttng-concepts(7), LTTng offers four recording
26f0c779 124session modes:
ba50d967 125
948f0a2e 126[[local-mode]]Local mode::
484b2a0c
PP
127 Write the trace data to the local file system.
128+
26f0c779 129The trace data output directory is:
484b2a0c 130+
26f0c779
PP
131With the option:--no-output option:::
132 None: the file system output is disabled.
133
134With the option:--output='DIR' or option:--set-url=++file://++__DIR__ option:::
135 The directory 'DIR'.
136
137Otherwise:::
138 A subdirectory, under the `$LTTNG_HOME/lttng-traces` (`$LTTNG_HOME`
139 defaults to `$HOME`) directory, of which the name contains the
e9711845 140 recording session name and the date/time.
f87c4756 141
948f0a2e 142[[network-streaming-mode]]Network streaming mode::
484b2a0c
PP
143 Send the trace data over the network to a listening relay daemon
144 (see man:lttng-relayd(8)).
145+
146Set the trace output destination with the option:--set-url option, or
147with the option:--ctrl-url and option:--data-url options (see the
da39b67c 148``<<url-format,URL format>>'' section below).
484b2a0c
PP
149
150[[snapshot-mode]]Snapshot mode (option:--snapshot option)::
26f0c779
PP
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).
484b2a0c 154+
26f0c779 155With this mode, LTTng:
484b2a0c 156+
26f0c779 157With the option:--no-output option:::
e9711845 158 Does :not: add any snapshot output to the created recording
26f0c779
PP
159 session.
160
161With 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
e9711845 163 path or URL(s) to the created recording session.
26f0c779
PP
164
165Otherwise:::
166 Adds an automatic snapshot output named `snapshot-1` to the created
e9711845 167 recording session.
484b2a0c 168+
26f0c779
PP
169The automatic snapshot output is a subdirectory, under the
170`$LTTNG_HOME/lttng-traces` (`$LTTNG_HOME` defaults to `$HOME`)
e9711845 171directory, of which the name contains the recording session name and the
26f0c779 172date/time.
484b2a0c
PP
173
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.
177+
178Set the trace output destination with the option:--set-url='URL' option,
179or with the option:--ctrl-url='URL' and option:--data-url='URL' options
da39b67c
PP
180(see the ``<<url-format,URL format>>'' section below). 'URL' may :not:
181start with `file://`.
ba50d967
PP
182
183
184[[url-format]]
185URL format
186~~~~~~~~~~
26f0c779
PP
187The argument of the option:--set-url='URL', option:--ctrl-url='URL', and
188option:--data-url='URL' options is an URL.
ba50d967 189
26f0c779 190There are two available 'URL' formats.
ba50d967 191
484b2a0c
PP
192Local format::
193+
ba50d967 194[verse]
484b2a0c
PP
195file://'TRACEDIR'
196{nbsp}
197+
198The `file://` protocol targets the *local file system*: you may only use
e9711845
PP
199such an URL with the option:--set-url option when you create the
200recording session in local or snapshot mode (see the ``<<modes,Recording
201session modes>>'' section above).
484b2a0c
PP
202+
203'TRACEDIR':::
204 Absolute path to the directory containing the trace data on the
205 local file system.
ba50d967 206
484b2a0c
PP
207Network format::
208+
209[verse]
210'NETPROTO'://('HOST' | 'IPADDR')[:__CTRLPORT__[:__DATAPORT__]][/'TRACEDIR']
211{nbsp}
212+
e9711845 213This format is only available when you create the recording session in
26f0c779 214network streaming, snapshot (option:--snapshot), or live (option:--live)
e9711845 215mode (see the ``<<modes,Recording session modes>>'' section above).
484b2a0c
PP
216+
217'NETPROTO':::
ba50d967
PP
218 Network protocol, amongst:
219+
36574617
PP
220--
221`net`::
484b2a0c
PP
222 TCP over IPv4.
223+
224The default values of 'CTRLPORT' and 'DATAPORT'
225are respectively {default_network_control_port} and
226{default_network_data_port}.
36574617
PP
227
228`net6`::
484b2a0c
PP
229 TCP over IPv6.
230+
231The default values of 'CTRLPORT' and 'DATAPORT'
232are respectively {default_network_control_port} and
233{default_network_data_port}.
36574617
PP
234
235`tcp`::
484b2a0c
PP
236 Same as the `net` protocol.
237+
238You may only use this with the option:--ctrl-url and option:--data-url
239options together.
36574617
PP
240
241`tcp6`::
484b2a0c
PP
242 Same as the `net6` protocol.
243+
244You can only be use this with the option:--ctrl-url and
245option:--data-url options together.
36574617 246--
484b2a0c
PP
247+
248('HOST' | 'IPADDR'):::
26f0c779
PP
249 Hostname or IP address.
250+
251IPv6 address must be enclosed in square brackets (`[` and{nbsp}`]`);
252see https://www.ietf.org/rfc/rfc2732.txt[RFC{nbsp}2732].
ba50d967 253
484b2a0c
PP
254'CTRLPORT':::
255 Control TCP port.
ba50d967 256
484b2a0c
PP
257'DATAPORT':::
258 Data TCP port.
ba50d967 259
484b2a0c
PP
260'TRACEDIR':::
261 Path of the directory containing the trace data on the remote file
262 system.
263+
264This path is relative to the base output directory of the LTTng relay
265daemon (see the nloption:--output option of man:lttng-relayd(8)).
ba50d967
PP
266
267
f5511eea 268include::common-lttng-cmd-options-head.txt[]
ba50d967
PP
269
270
f87c4756
PP
271Mode selection
272~~~~~~~~~~~~~~
e9711845 273See the ``<<modes,Recording session modes>>'' section above.
484b2a0c
PP
274
275At most one of:
276
ba50d967 277option:--live[='DELAYUS']::
e9711845 278 Create the recording session in live mode.
948f0a2e 279+
484b2a0c
PP
280The optional 'DELAYUS' argument is the maximum time (in µs) you can wait
281for the data to be flushed (sent to the connected LTTng relay daemon).
282The default value of 'DELAYUS' is {default_lttng_live_timer}.
ba50d967 283+
484b2a0c
PP
284Set the URL of the relay daemon to connect to with the option:--set-url
285option, or with the option:--ctrl-url and option:--data-url options,
286instead of using `net://127.0.0.1`.
287+
288The session daemon must be able to connect to a listening relay daemon
289(see man:lttng-relayd(8)).
ba50d967
PP
290
291option:--snapshot::
e9711845 292 Create the recording session in snapshot mode.
484b2a0c 293+
26f0c779
PP
294This is equivalent to:
295+
296* One of:
297+
298--
299With the option:--no-output option::
e9711845 300 Not adding any snapshot output after LTTng creates the recording
26f0c779
PP
301 session.
302
303With 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
e9711845 305 or URL(s) immediately after LTTng creates the recording session.
26f0c779
PP
306
307Otherwise::
308 Adding an automatic snapshot output named `snapshot-1` immediately
e9711845 309 after LTTng creates the recording session.
26f0c779
PP
310+
311The automatic snapshot output is a subdirectory, under the
312`$LTTNG_HOME/lttng-traces` (`$LTTNG_HOME` defaults to `$HOME`)
e9711845 313directory, of which the name contains the recording session name and the
26f0c779
PP
314date/time.
315--
316
e9711845 317* Forcing all the channels to be created for the recording session to be
26f0c779
PP
318 configured with the nloption:--override and nloption:--output=++mmap++
319 options (see man:lttng-enable-channel(1)).
ba50d967
PP
320
321
322Output
323~~~~~~
324option:--no-output::
e9711845 325 Depending on the recording session mode (see the ``<<modes,Recording
da39b67c 326 session modes>>'' section above):
484b2a0c 327+
26f0c779
PP
328Local mode:::
329 Disable the file system output.
330
331Snapshot mode (option:--snapshot option):::
e9711845 332 Do :not: add a snapshot output after creating the recording session.
ba50d967 333
484b2a0c 334option:-o 'DIR', option:--output='DIR'::
26f0c779 335 Equivalent to option:--set-url=++file://++__DIR__.
ba50d967 336
484b2a0c
PP
337option:--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.
d22ba1ec
PP
340+
341NOTE: As of LTTng{nbsp}{lttng_version}, LTTng only considers this option
342for user space (including Java and Python) channels, but this may change
343in the future.
ba50d967
PP
344
345
346URL
347~~~
da39b67c
PP
348See the ``<<url-format,URL format>>'' section above to learn more about
349the syntax of the 'URL' argument of the following options.
ba50d967 350
59b19c3c 351option:-C 'URL', option:--ctrl-url='URL'::
484b2a0c
PP
352 Set the control path URL to 'URL'.
353+
354You must also use the option:--data-url option.
26f0c779 355+
e9711845
PP
356Not available in local mode (see the ``<<modes,Recording session
357modes>>'' section above).
26f0c779
PP
358+
359In snapshot mode, this is equivalent to using the nloption:--ctrl-url
360option of the `add-output` action of the man:lttng-snapshot(1) command
e9711845 361immediately after creating the recording session.
ba50d967 362
59b19c3c 363option:-D 'URL', option:--data-url='URL'::
484b2a0c
PP
364 Set the trace data path URL to 'URL'.
365+
366You must also use the option:--ctrl-url option.
26f0c779 367+
e9711845
PP
368Not available in local mode (see the ``<<modes,Recording session
369modes>>'' section above).
26f0c779
PP
370+
371In snapshot mode, this is equivalent to using the nloption:--data-url
372option of the `add-output` action of the man:lttng-snapshot(1) command
e9711845 373immediately after creating the recording session.
ba50d967 374
59b19c3c 375option:-U 'URL', option:--set-url='URL'::
484b2a0c
PP
376 Set the destination URL of the control path and trace data to 'URL'.
377+
e9711845 378This URL remains unchanged as long as the recording session exists.
26f0c779 379+
e9711845
PP
380Depending on the recording session mode (see the ``<<modes,Recording
381session modes>>'' section above):
948f0a2e 382+
26f0c779
PP
383Local mode:::
384 'URL' must start with `file://`, followed with the destination
385 directory path on the local file system.
386
387Network streaming and live modes:::
388 Equivalent to using both the option:--ctrl-url and option:--data-url
389 options.
390
391Snapshot 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
e9711845 394 after creating the recording session.
ba50d967
PP
395
396
f5511eea 397include::common-lttng-cmd-help-options.txt[]
ba50d967
PP
398
399
f5511eea
PP
400include::common-lttng-cmd-after-options.txt[]
401
402
ebbd679f
PP
403[[examples]]
404EXAMPLES
405--------
e9711845 406.Create a normal mode recording session with a generated name.
ebbd679f
PP
407====
408[role="term"]
409----
410$ lttng create
411----
412====
413
e9711845 414.Create a normal mode recording session with a custom name.
ebbd679f
PP
415====
416[role="term"]
417----
418$ lttng create my-session
419----
420====
421
e9711845 422.Create a normal mode recording session with a specific output directory.
ebbd679f
PP
423====
424See the option:--output option.
425
426[role="term"]
427----
428$ lttng create --output=/path/to/traces
429----
430====
431
e9711845 432.Create a network streaming mode recording session.
ebbd679f
PP
433====
434See the ``Output directory'' section of man:lttng-relayd(8) to
435understand where the relay daemon to connect to (`10.0.0.242`) writes
436the received traces.
437
438See the option:--set-url option.
439
440[role="term"]
441----
442$ lttng create --set-url=net://10.0.0.242/inv4
443----
444====
445
e9711845 446.Create a snapshot mode recording session with a default snapshot output.
ebbd679f
PP
447====
448See the option:--snapshot option.
449
450[role="term"]
451----
452$ lttng create --snapshot
453----
454====
455
e9711845 456.Create a snapshot mode recording session with a custom snapshot output.
ebbd679f
PP
457====
458See the option:--snapshot and option:--set-url options.
459
460[role="term"]
461----
462$ lttng create --snapshot \
463 --set-url=tcp://192.168.1.102:1234:5678/my-snapshots
464----
465====
466
e9711845 467.Create a snapshot mode recording session with no snapshot output.
ebbd679f
PP
468====
469See the option:--snapshot and option:--no-output options.
470
471[role="term"]
472----
473$ lttng create --snapshot --no-output
474----
475====
476
e9711845 477.Create an LTTng live mode recording session with a default relay daemon URL.
ebbd679f
PP
478====
479See the option:--live option.
480
481[role="term"]
482----
483$ lttng create --live
484----
485====
486
e9711845 487.Create an LTTng live mode recording session with a custom live timer period and relay daemon URL.
ebbd679f
PP
488====
489See the option:--live and option:--set-url options.
490
491[role="term"]
492----
493$ lttng create --live=250000 \
494 --set-url=tcp://relayd34:4885:4886
495----
496====
497
e9711845 498.Create a normal mode recording session with a custom directory containing the ring buffer shared memory files.
ebbd679f
PP
499====
500See the option:--shm-path option.
501
502[role="term"]
503----
504$ lttng create my-session --shm-path=/mnt/nvram2/lttng
505----
506====
507
508
f5511eea 509include::common-footer.txt[]
ba50d967
PP
510
511
512SEE ALSO
513--------
484b2a0c 514man:lttng(1),
7c1a4458 515man:lttng-destroy(1),
484b2a0c 516man:lttng-enable-channel(1),
af1c4164 517man:lttng-list(1),
484b2a0c 518man:lttng-rotate(1),
26f0c779 519man:lttng-save(1),
7c1a4458 520man:lttng-set-session(1),
484b2a0c 521man:lttng-start(1),
af1c4164
PP
522man:lttng-status(1),
523man:lttng-track(1),
524man:lttng-concepts(7),
525man:lttng-relayd(8),
526man:lttng-sessiond(8)
This page took 0.071261 seconds and 5 git commands to generate.