lttng(1)/lttng-create(1): document `--relayd-path`
[lttng-tools.git] / doc / man / lttng-create.1.txt
CommitLineData
ba50d967
PP
1lttng-create(1)
2===============
efacf910 3:revdate: 12 May 2021
ba50d967
PP
4
5
6NAME
7----
8lttng-create - Create an LTTng tracing session
9
10
11SYNOPSIS
12--------
484b2a0c 13Create a local mode tracing 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
484b2a0c 19Create a network streaming mode tracing 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
484b2a0c 25Create a snapshot mode tracing 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
484b2a0c 32Create a live mode tracing 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-----------
484b2a0c 40The `lttng create` command creates a new tracing 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
26f0c779 45See man:lttng-concepts(7) to learn more about tracing sessions.
484b2a0c
PP
46
47Without the 'SESSION' argument, LTTng automatically generates a tracing
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.
57
efacf910
PP
58By default, the `create` command automatically spawns:
59
60* A session daemon for your Unix user if none is currently running.
61+
62Override the path of the session daemon binary to spawn with the
63general genoption:--sessiond-path option.
64+
65Avoid automatically spawning a session daemon with the general
66genoption:--no-sessiond option.
67
68* A relay daemon (see man:lttng-relayd(8)) if all the following
69 statements are true:
70+
71--
72* You specify the option:--live option.
73
74* You don't specify any of the option:--set-url, option:--ctrl-url, or
75 option:--data-url options.
76
77* No relay daemon is currently listening for TCP connections on
78 +127.0.0.1:{default_network_viewer_port}+ (default LTTng live reader
79 connection address and port).
80--
81+
82In this case, the `create` command spawns a relay daemon as such:
83+
84[verse]
85*lttng-relayd* nloption:--live-port=**tcp://localhost:{default_network_viewer_port}**
86{nbsp}
87+
88Override the path of the relay daemon binary to spawn with the general
89genoption:--relayd-path option.
484b2a0c 90
26f0c779
PP
91On success, the `create` command sets the current tracing session (see
92man:lttng-concepts(7) to learn more) to the created tracing session.
93
94Show the status of the current tracing session with the
95man:lttng-status(1) command.
96
97List the tracing sessions of your Unix user, or of all users if
98your Unix user is `root`, within the connected session daemon with the
99man:lttng-list(1) command.
ba50d967 100
484b2a0c
PP
101Start and stop a tracing session with the man:lttng-start(1) and
102man:lttng-stop(1) commands.
ba50d967 103
484b2a0c
PP
104Save and load a tracing session with the man:lttng-save(1) and
105man:lttng-load(1) commands.
106
26f0c779
PP
107Allow and disallow specific processes to record events with the
108man:lttng-track(1) and man:lttng-untrack(1) commands.
109
110Archive the current trace chunk of (rotate) a tracing session with the
484b2a0c
PP
111man:lttng-rotate(1) command.
112
113Destroy a tracing session with the man:lttng-destroy(1) command.
114
115
484b2a0c
PP
116[[modes]]
117Tracing session modes
118~~~~~~~~~~~~~~~~~~~~~
26f0c779
PP
119As documented in man:lttng-concepts(7), LTTng offers four tracing
120session modes:
ba50d967 121
948f0a2e 122[[local-mode]]Local mode::
484b2a0c
PP
123 Write the trace data to the local file system.
124+
26f0c779 125The trace data output directory is:
484b2a0c 126+
26f0c779
PP
127With the option:--no-output option:::
128 None: the file system output is disabled.
129
130With the option:--output='DIR' or option:--set-url=++file://++__DIR__ option:::
131 The directory 'DIR'.
132
133Otherwise:::
134 A subdirectory, under the `$LTTNG_HOME/lttng-traces` (`$LTTNG_HOME`
135 defaults to `$HOME`) directory, of which the name contains the
136 tracing session name and the date/time.
f87c4756 137
948f0a2e 138[[network-streaming-mode]]Network streaming mode::
484b2a0c
PP
139 Send the trace data over the network to a listening relay daemon
140 (see man:lttng-relayd(8)).
141+
142Set the trace output destination with the option:--set-url option, or
143with the option:--ctrl-url and option:--data-url options (see the
144<<url-format,URL format>> section below).
145
146[[snapshot-mode]]Snapshot mode (option:--snapshot option)::
26f0c779
PP
147 Only write the trace data to the local file system or send it to a
148 listening relay daemon (man:lttng-relayd(8)) when LTTng takes a
149 snapshot (see the man:lttng-snapshot(1) command).
484b2a0c 150+
26f0c779 151With this mode, LTTng:
484b2a0c 152+
26f0c779
PP
153With the option:--no-output option:::
154 Does :not: add any snapshot output to the created tracing
155 session.
156
157With the option:--output option, the option:--set-url option, or the option:--ctrl-url and option:--data-url options:::
158 Adds a snapshot output named `snapshot-1` using the provided
159 path or URL(s) to the created tracing session.
160
161Otherwise:::
162 Adds an automatic snapshot output named `snapshot-1` to the created
163 tracing session.
484b2a0c 164+
26f0c779
PP
165The automatic snapshot output is a subdirectory, under the
166`$LTTNG_HOME/lttng-traces` (`$LTTNG_HOME` defaults to `$HOME`)
167directory, of which the name contains the tracing session name and the
168date/time.
484b2a0c
PP
169
170[[live-mode]]Live mode (option:--live option)::
171 Send the trace data over the network to a listening relay daemon
172 (see man:lttng-relayd(8)) for live reading.
173+
174Set the trace output destination with the option:--set-url='URL' option,
175or with the option:--ctrl-url='URL' and option:--data-url='URL' options
176(see the <<url-format,URL format>> section below). 'URL' may :not: start
177with `file://`.
ba50d967
PP
178
179
180[[url-format]]
181URL format
182~~~~~~~~~~
26f0c779
PP
183The argument of the option:--set-url='URL', option:--ctrl-url='URL', and
184option:--data-url='URL' options is an URL.
ba50d967 185
26f0c779 186There are two available 'URL' formats.
ba50d967 187
484b2a0c
PP
188Local format::
189+
ba50d967 190[verse]
484b2a0c
PP
191file://'TRACEDIR'
192{nbsp}
193+
194The `file://` protocol targets the *local file system*: you may only use
195such an URL with the option:--set-url option when you create the tracing
196session in local or snapshot mode (see the <<modes,Tracing session
197modes>> section above).
198+
199'TRACEDIR':::
200 Absolute path to the directory containing the trace data on the
201 local file system.
ba50d967 202
484b2a0c
PP
203Network format::
204+
205[verse]
206'NETPROTO'://('HOST' | 'IPADDR')[:__CTRLPORT__[:__DATAPORT__]][/'TRACEDIR']
207{nbsp}
208+
209This format is only available when you create the tracing session in
26f0c779
PP
210network streaming, snapshot (option:--snapshot), or live (option:--live)
211mode (see the <<modes,Tracing session modes>> section above).
484b2a0c
PP
212+
213'NETPROTO':::
ba50d967
PP
214 Network protocol, amongst:
215+
36574617
PP
216--
217`net`::
484b2a0c
PP
218 TCP over IPv4.
219+
220The default values of 'CTRLPORT' and 'DATAPORT'
221are respectively {default_network_control_port} and
222{default_network_data_port}.
36574617
PP
223
224`net6`::
484b2a0c
PP
225 TCP over IPv6.
226+
227The default values of 'CTRLPORT' and 'DATAPORT'
228are respectively {default_network_control_port} and
229{default_network_data_port}.
36574617
PP
230
231`tcp`::
484b2a0c
PP
232 Same as the `net` protocol.
233+
234You may only use this with the option:--ctrl-url and option:--data-url
235options together.
36574617
PP
236
237`tcp6`::
484b2a0c
PP
238 Same as the `net6` protocol.
239+
240You can only be use this with the option:--ctrl-url and
241option:--data-url options together.
36574617 242--
484b2a0c
PP
243+
244('HOST' | 'IPADDR'):::
26f0c779
PP
245 Hostname or IP address.
246+
247IPv6 address must be enclosed in square brackets (`[` and{nbsp}`]`);
248see https://www.ietf.org/rfc/rfc2732.txt[RFC{nbsp}2732].
ba50d967 249
484b2a0c
PP
250'CTRLPORT':::
251 Control TCP port.
ba50d967 252
484b2a0c
PP
253'DATAPORT':::
254 Data TCP port.
ba50d967 255
484b2a0c
PP
256'TRACEDIR':::
257 Path of the directory containing the trace data on the remote file
258 system.
259+
260This path is relative to the base output directory of the LTTng relay
261daemon (see the nloption:--output option of man:lttng-relayd(8)).
ba50d967
PP
262
263
f5511eea 264include::common-lttng-cmd-options-head.txt[]
ba50d967
PP
265
266
f87c4756
PP
267Mode selection
268~~~~~~~~~~~~~~
484b2a0c
PP
269See the <<modes,Tracing session modes>> section above.
270
271At most one of:
272
ba50d967 273option:--live[='DELAYUS']::
484b2a0c 274 Create the tracing session in live mode.
948f0a2e 275+
484b2a0c
PP
276The optional 'DELAYUS' argument is the maximum time (in µs) you can wait
277for the data to be flushed (sent to the connected LTTng relay daemon).
278The default value of 'DELAYUS' is {default_lttng_live_timer}.
ba50d967 279+
484b2a0c
PP
280Set the URL of the relay daemon to connect to with the option:--set-url
281option, or with the option:--ctrl-url and option:--data-url options,
282instead of using `net://127.0.0.1`.
283+
284The session daemon must be able to connect to a listening relay daemon
285(see man:lttng-relayd(8)).
ba50d967
PP
286
287option:--snapshot::
484b2a0c
PP
288 Create the tracing session in snapshot mode.
289+
26f0c779
PP
290This is equivalent to:
291+
292* One of:
293+
294--
295With the option:--no-output option::
296 Not adding any snapshot output after LTTng creates the tracing
297 session.
298
299With the option:--output option, the option:--set-url option, or the option:--ctrl-url and option:--data-url options::
300 Adding a snapshot output named `snapshot-1` using the provided path
301 or URL(s) immediately after LTTng creates the tracing session.
302
303Otherwise::
304 Adding an automatic snapshot output named `snapshot-1` immediately
305 after LTTng creates the tracing session.
306+
307The automatic snapshot output is a subdirectory, under the
308`$LTTNG_HOME/lttng-traces` (`$LTTNG_HOME` defaults to `$HOME`)
309directory, of which the name contains the tracing session name and the
310date/time.
311--
312
313* Forcing all the channels to be created for the tracing session to be
314 configured with the nloption:--override and nloption:--output=++mmap++
315 options (see man:lttng-enable-channel(1)).
ba50d967
PP
316
317
318Output
319~~~~~~
320option:--no-output::
26f0c779
PP
321 Depending on the tracing session mode (see the <<modes,Tracing
322 session modes>> section above):
484b2a0c 323+
26f0c779
PP
324Local mode:::
325 Disable the file system output.
326
327Snapshot mode (option:--snapshot option):::
328 Do :not: add a snapshot output after creating the tracing session.
ba50d967 329
484b2a0c 330option:-o 'DIR', option:--output='DIR'::
26f0c779 331 Equivalent to option:--set-url=++file://++__DIR__.
ba50d967 332
484b2a0c
PP
333option:--shm-path='DIR'::
334 Set the path of the directory containing the shared memory files
335 holding the channel ring buffers to 'DIR' on the local file sytem.
ba50d967
PP
336
337
338URL
339~~~
484b2a0c
PP
340See the <<url-format,URL format>> section above to learn more about the
341syntax of the 'URL' argument of the following options.
ba50d967 342
59b19c3c 343option:-C 'URL', option:--ctrl-url='URL'::
484b2a0c
PP
344 Set the control path URL to 'URL'.
345+
346You must also use the option:--data-url option.
26f0c779
PP
347+
348Not available in local mode (see the <<modes,Tracing session modes>>
349section above).
350+
351In snapshot mode, this is equivalent to using the nloption:--ctrl-url
352option of the `add-output` action of the man:lttng-snapshot(1) command
353immediately after creating the tracing session.
ba50d967 354
59b19c3c 355option:-D 'URL', option:--data-url='URL'::
484b2a0c
PP
356 Set the trace data path URL to 'URL'.
357+
358You must also use the option:--ctrl-url option.
26f0c779
PP
359+
360Not available in local mode (see the <<modes,Tracing session modes>>
361section above).
362+
363In snapshot mode, this is equivalent to using the nloption:--data-url
364option of the `add-output` action of the man:lttng-snapshot(1) command
365immediately after creating the tracing session.
ba50d967 366
59b19c3c 367option:-U 'URL', option:--set-url='URL'::
484b2a0c
PP
368 Set the destination URL of the control path and trace data to 'URL'.
369+
26f0c779
PP
370This URL remains unchanged as long as the tracing session exists.
371+
372Depending on the tracing session mode (see the <<modes,Tracing session
373modes>> section above):
948f0a2e 374+
26f0c779
PP
375Local mode:::
376 'URL' must start with `file://`, followed with the destination
377 directory path on the local file system.
378
379Network streaming and live modes:::
380 Equivalent to using both the option:--ctrl-url and option:--data-url
381 options.
382
383Snapshot mode (option:--snapshot option):::
384 Equivalent to using the 'URL' non-option argument of the
385 `add-output` action of the man:lttng-snapshot(1) command immediately
386 after creating the tracing session.
ba50d967
PP
387
388
f5511eea 389include::common-lttng-cmd-help-options.txt[]
ba50d967
PP
390
391
f5511eea
PP
392include::common-lttng-cmd-after-options.txt[]
393
394
395include::common-footer.txt[]
ba50d967
PP
396
397
398SEE ALSO
399--------
484b2a0c 400man:lttng(1),
7c1a4458 401man:lttng-destroy(1),
484b2a0c 402man:lttng-enable-channel(1),
af1c4164 403man:lttng-list(1),
484b2a0c 404man:lttng-rotate(1),
26f0c779 405man:lttng-save(1),
7c1a4458 406man:lttng-set-session(1),
484b2a0c 407man:lttng-start(1),
af1c4164
PP
408man:lttng-status(1),
409man:lttng-track(1),
410man:lttng-concepts(7),
411man:lttng-relayd(8),
412man:lttng-sessiond(8)
This page took 0.049755 seconds and 4 git commands to generate.