Fix: syscall event rule: emission sites not compared in is_equal
[lttng-tools.git] / doc / man / lttng-create.1.txt
... / ...
CommitLineData
1lttng-create(1)
2===============
3:revdate: 7 December 2021
4
5
6NAME
7----
8lttng-create - Create an LTTng recording session
9
10
11SYNOPSIS
12--------
13Create a local mode recording session:
14
15[verse]
16*lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *create* ['SESSION'] [option:--shm-path='DIR']
17 [option:--no-output | option:--output='DIR' | option:--set-url=**file://**__DIR__]
18
19Create a network streaming mode recording session:
20
21[verse]
22*lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *create* ['SESSION'] [option:--shm-path='DIR']
23 (option:--set-url='URL' | option:--ctrl-url='URL' option:--data-url='URL')
24
25Create a snapshot mode recording session:
26
27[verse]
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']
31
32Create a live mode recording session:
33
34[verse]
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']
37
38DESCRIPTION
39-----------
40The `lttng create` command creates a new recording session for your Unix
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).
44
45See man:lttng-concepts(7) to learn more about recording sessions.
46
47Without the 'SESSION' argument, LTTng automatically generates a recording
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
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.
59
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.
92
93On success, the `create` command sets the current recording session (see
94man:lttng-concepts(7) to learn more) to the created recording session.
95
96See the ``<<examples,EXAMPLES>>'' section below for usage examples.
97
98Show the status of the current recording session with the
99man:lttng-status(1) command.
100
101List the recording sessions of your Unix user, or of all users if
102your Unix user is `root`, within the connected session daemon with the
103man:lttng-list(1) command.
104
105Start and stop a recording session with the man:lttng-start(1) and
106man:lttng-stop(1) commands.
107
108Save and load a recording session with the man:lttng-save(1) and
109man:lttng-load(1) commands.
110
111Allow and disallow specific processes to record events with the
112man:lttng-track(1) and man:lttng-untrack(1) commands.
113
114Archive the current trace chunk of (rotate) a recording session with the
115man:lttng-rotate(1) command.
116
117Destroy a recording session with the man:lttng-destroy(1) command.
118
119
120[[modes]]
121Recording session modes
122~~~~~~~~~~~~~~~~~~~~~~~
123As documented in man:lttng-concepts(7), LTTng offers four recording
124session modes:
125
126[[local-mode]]Local mode::
127 Write the trace data to the local file system.
128+
129The trace data output directory is:
130+
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
140 recording session name and the date/time.
141
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)).
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
148``<<url-format,URL format>>'' section below).
149
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).
154+
155With this mode, LTTng:
156+
157With the option:--no-output option:::
158 Does :not: add any snapshot output to the created recording
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
163 path or URL(s) to the created recording session.
164
165Otherwise:::
166 Adds an automatic snapshot output named `snapshot-1` to the created
167 recording session.
168+
169The automatic snapshot output is a subdirectory, under the
170`$LTTNG_HOME/lttng-traces` (`$LTTNG_HOME` defaults to `$HOME`)
171directory, of which the name contains the recording session name and the
172date/time.
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
180(see the ``<<url-format,URL format>>'' section below). 'URL' may :not:
181start with `file://`.
182
183
184[[url-format]]
185URL format
186~~~~~~~~~~
187The argument of the option:--set-url='URL', option:--ctrl-url='URL', and
188option:--data-url='URL' options is an URL.
189
190There are two available 'URL' formats.
191
192Local format::
193+
194[verse]
195file://'TRACEDIR'
196{nbsp}
197+
198The `file://` protocol targets the *local file system*: you may only use
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).
202+
203'TRACEDIR':::
204 Absolute path to the directory containing the trace data on the
205 local file system.
206
207Network format::
208+
209[verse]
210'NETPROTO'://('HOST' | 'IPADDR')[:__CTRLPORT__[:__DATAPORT__]][/'TRACEDIR']
211{nbsp}
212+
213This format is only available when you create the recording session in
214network streaming, snapshot (option:--snapshot), or live (option:--live)
215mode (see the ``<<modes,Recording session modes>>'' section above).
216+
217'NETPROTO':::
218 Network protocol, amongst:
219+
220--
221`net`::
222 TCP over IPv4.
223+
224The default values of 'CTRLPORT' and 'DATAPORT'
225are respectively {default_network_control_port} and
226{default_network_data_port}.
227
228`net6`::
229 TCP over IPv6.
230+
231The default values of 'CTRLPORT' and 'DATAPORT'
232are respectively {default_network_control_port} and
233{default_network_data_port}.
234
235`tcp`::
236 Same as the `net` protocol.
237+
238You may only use this with the option:--ctrl-url and option:--data-url
239options together.
240
241`tcp6`::
242 Same as the `net6` protocol.
243+
244You can only be use this with the option:--ctrl-url and
245option:--data-url options together.
246--
247+
248('HOST' | 'IPADDR'):::
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].
253
254'CTRLPORT':::
255 Control TCP port.
256
257'DATAPORT':::
258 Data TCP port.
259
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)).
266
267
268include::common-lttng-cmd-options-head.txt[]
269
270
271Mode selection
272~~~~~~~~~~~~~~
273See the ``<<modes,Recording session modes>>'' section above.
274
275At most one of:
276
277option:--live[='DELAYUS']::
278 Create the recording session in live mode.
279+
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}.
283+
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)).
290
291option:--snapshot::
292 Create the recording session in snapshot mode.
293+
294This is equivalent to:
295+
296* One of:
297+
298--
299With the option:--no-output option::
300 Not adding any snapshot output after LTTng creates the recording
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
305 or URL(s) immediately after LTTng creates the recording session.
306
307Otherwise::
308 Adding an automatic snapshot output named `snapshot-1` immediately
309 after LTTng creates the recording session.
310+
311The automatic snapshot output is a subdirectory, under the
312`$LTTNG_HOME/lttng-traces` (`$LTTNG_HOME` defaults to `$HOME`)
313directory, of which the name contains the recording session name and the
314date/time.
315--
316
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)).
320
321
322Output
323~~~~~~
324option:--no-output::
325 Depending on the recording session mode (see the ``<<modes,Recording
326 session modes>>'' section above):
327+
328Local mode:::
329 Disable the file system output.
330
331Snapshot mode (option:--snapshot option):::
332 Do :not: add a snapshot output after creating the recording session.
333
334option:-o 'DIR', option:--output='DIR'::
335 Equivalent to option:--set-url=++file://++__DIR__.
336
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.
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.
344
345
346URL
347~~~
348See the ``<<url-format,URL format>>'' section above to learn more about
349the syntax of the 'URL' argument of the following options.
350
351option:-C 'URL', option:--ctrl-url='URL'::
352 Set the control path URL to 'URL'.
353+
354You must also use the option:--data-url option.
355+
356Not available in local mode (see the ``<<modes,Recording session
357modes>>'' section above).
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
361immediately after creating the recording session.
362
363option:-D 'URL', option:--data-url='URL'::
364 Set the trace data path URL to 'URL'.
365+
366You must also use the option:--ctrl-url option.
367+
368Not available in local mode (see the ``<<modes,Recording session
369modes>>'' section above).
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
373immediately after creating the recording session.
374
375option:-U 'URL', option:--set-url='URL'::
376 Set the destination URL of the control path and trace data to 'URL'.
377+
378This URL remains unchanged as long as the recording session exists.
379+
380Depending on the recording session mode (see the ``<<modes,Recording
381session modes>>'' section above):
382+
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
394 after creating the recording session.
395
396
397include::common-lttng-cmd-help-options.txt[]
398
399
400include::common-lttng-cmd-after-options.txt[]
401
402
403[[examples]]
404EXAMPLES
405--------
406.Create a normal mode recording session with a generated name.
407====
408[role="term"]
409----
410$ lttng create
411----
412====
413
414.Create a normal mode recording session with a custom name.
415====
416[role="term"]
417----
418$ lttng create my-session
419----
420====
421
422.Create a normal mode recording session with a specific output directory.
423====
424See the option:--output option.
425
426[role="term"]
427----
428$ lttng create --output=/path/to/traces
429----
430====
431
432.Create a network streaming mode recording session.
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
446.Create a snapshot mode recording session with a default snapshot output.
447====
448See the option:--snapshot option.
449
450[role="term"]
451----
452$ lttng create --snapshot
453----
454====
455
456.Create a snapshot mode recording session with a custom snapshot output.
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
467.Create a snapshot mode recording session with no snapshot output.
468====
469See the option:--snapshot and option:--no-output options.
470
471[role="term"]
472----
473$ lttng create --snapshot --no-output
474----
475====
476
477.Create an LTTng live mode recording session with a default relay daemon URL.
478====
479See the option:--live option.
480
481[role="term"]
482----
483$ lttng create --live
484----
485====
486
487.Create an LTTng live mode recording session with a custom live timer period and relay daemon URL.
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
498.Create a normal mode recording session with a custom directory containing the ring buffer shared memory files.
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
509include::common-footer.txt[]
510
511
512SEE ALSO
513--------
514man:lttng(1),
515man:lttng-destroy(1),
516man:lttng-enable-channel(1),
517man:lttng-list(1),
518man:lttng-rotate(1),
519man:lttng-save(1),
520man:lttng-set-session(1),
521man:lttng-start(1),
522man:lttng-status(1),
523man:lttng-track(1),
524man:lttng-concepts(7),
525man:lttng-relayd(8),
526man:lttng-sessiond(8)
This page took 0.024433 seconds and 5 git commands to generate.