doc: Add reference to USDT probes
[lttng-tools.git] / doc / man / lttng-create.1.txt
CommitLineData
ba50d967
PP
1lttng-create(1)
2===============
3
4
5NAME
6----
7lttng-create - Create an LTTng tracing session
8
9
10SYNOPSIS
11--------
f87c4756 12Local mode:
ba50d967
PP
13
14[verse]
1f3c3a24
JR
15*lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *create* ['SESSION'] [option:--shm-path='PATH']
16 [option:--no-output | option:--output='PATH' | option:--set-url=file://'PATH']
f87c4756
PP
17
18Network streaming mode:
19
20[verse]
1f3c3a24
JR
21*lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *create* ['SESSION'] [option:--shm-path='PATH']
22 (option:--set-url='URL' | option:--ctrl-url='URL' option:--data-url='URL')
980bb5fd 23
ba50d967
PP
24Snapshot mode:
25
26[verse]
1f3c3a24
JR
27*lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *create* ['SESSION'] option:--snapshot
28 [option:--shm-path='PATH'] [option:--set-url='URL' | option:--ctrl-url='URL' option:--data-url='URL']
ba50d967
PP
29
30Live mode:
31
32[verse]
1f3c3a24
JR
33*lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *create* ['SESSION'] option:--live[='DELAYUS']
34 [option:--shm-path='PATH'] [option:--set-url='URL' | option:--ctrl-url='URL' option:--data-url='URL']
ba50d967
PP
35
36DESCRIPTION
37-----------
38The `lttng create` command creates a new tracing session.
39
40A tracing session is a named container of channels, which in turn
41contain event rules. It is domain-agnostic, in that channels and event
42rules can be enabled for the user space tracer and/or the Linux
43kernel tracer.
44
45On execution, an `.lttngrc` file is created, if it does not exist, in the
46user's home directory. This file contains the name of the current tracing
47session. When creating a new tracing session with `lttng create`, the
48current tracing session is set to this new tracing session. The
7c1a4458 49man:lttng-set-session(1) command can be used to set the current
ba50d967
PP
50tracing session without manually editing the `.lttngrc` file.
51
52If 'SESSION' is omitted, a session name is automatically created having
53this form: `auto-YYYYmmdd-HHMMSS`. 'SESSION' *must not* contain the
54character `/`.
55
56The option:--shm-path option can be used to specify the path to the
57shared memory holding the ring buffers. Specifying a location on an
58NVRAM file system makes it possible to retrieve the latest recorded
59trace data when the system reboots after a crash. To view the events
60of ring buffer files after a system crash, use the
7c1a4458 61man:lttng-crash(1) utility.
ba50d967 62
7c1a4458 63Tracing sessions are destroyed using the man:lttng-destroy(1)
ba50d967
PP
64command.
65
66
67Creation modes
68~~~~~~~~~~~~~~
f87c4756 69There are four tracing session modes:
ba50d967 70
948f0a2e 71[[local-mode]]Local mode::
ba50d967
PP
72 Traces the local system and writes the trace to the local
73 file system. The option:--output option specifies the trace path.
f87c4756
PP
74 Using option:--set-url=file://'PATH' is the equivalent of using
75 option:--output='PATH'. The file system output can be disabled using
76 the option:--no-output option.
77+
78If none of the options mentioned above are used, then the trace is
79written locally in the `$LTTNG_HOME/lttng-traces` directory
80(`$LTTNG_HOME` defaults to `$HOME`).
81
948f0a2e 82[[network-streaming-mode]]Network streaming mode::
f87c4756
PP
83 Traces the local system and sends the trace over the network to
84 a listening relay daemon (see man:lttng-relayd(8)).
85 The option:--set-url, or option:--ctrl-url and option:--data-url
86 options set the trace output destination (see the
87 <<url-format,URL format>> section below).
ba50d967 88
948f0a2e 89[[snapshot-mode]]Snapshot mode::
ba50d967
PP
90 Traces the local system without writing the trace to the local file
91 system (implicit option:--no-output option). Channels are automatically
92 configured to be snapshot-ready on creation (see
7c1a4458 93 man:lttng-enable-channel(1)). The man:lttng-snapshot(1)
ba50d967
PP
94 command is used to take snapshots of the current ring buffers.
95 The option:--set-url, or option:--ctrl-url and option:--data-url
96 options set the default snapshot output destination.
97
948f0a2e 98[[live-mode]]Live mode::
ba50d967 99 Traces the local system, sending trace data to an LTTng relay daemon
7c1a4458 100 over the network (see man:lttng-relayd(8)). The
ba50d967
PP
101 option:--set-url, or option:--ctrl-url and option:--data-url options
102 set the trace output destination. The live output URLs cannot use
f87c4756
PP
103 the `file://` protocol (see the <<url-format,URL format>>
104 section below).
ba50d967
PP
105
106
107[[url-format]]
108URL format
109~~~~~~~~~~
f87c4756
PP
110The option:--set-url, option:--ctrl-url, and option:--data-url options'
111arguments are URLs.
ba50d967
PP
112
113The format of those URLs is one of:
114
115[verse]
116file://'TRACEPATH'
117'NETPROTO'://('HOST' | 'IPADDR')[:__CTRLPORT__[:__DATAPORT__]][/'TRACEPATH']
118
f87c4756 119The `file://` protocol targets the *local file system* and can only
948f0a2e
PP
120be used as the option:--set-url option's argument when the session is
121created in <<local-mode,local>> or <<snapshot-mode,snapshot>> mode.
ba50d967
PP
122
123'TRACEPATH'::
124 Absolute path to trace files on the local file system.
125
948f0a2e
PP
126The other version is available when the session is created in
127<<network-streaming-mode,network streaming>>,
128<<snapshot-mode,snapshot>>, or <<live-mode,live>> mode.
ba50d967
PP
129
130'NETPROTO'::
131 Network protocol, amongst:
132+
36574617
PP
133--
134`net`::
1f5cd9d5 135 TCP over IPv4; the default values of 'CTRLPORT' and 'DATAPORT'
84f7f408
PP
136 are respectively {default_network_control_port} and
137 {default_network_data_port}.
36574617
PP
138
139`net6`::
140 TCP over IPv6: same default ports as the `net` protocol.
141
142`tcp`::
143 Same as the `net` protocol; can only be used with the
144 option:--ctrl-url and option:--data-url options together.
145
146`tcp6`::
147 Same as the `net6` protocol; can only be used with the
148 option:--ctrl-url and option:--data-url options together.
149--
ba50d967
PP
150
151('HOST' | 'IPADDR')::
152 Hostname or IP address (IPv6 address *must* be enclosed in brackets
153 (`[` and `]`); see https://www.ietf.org/rfc/rfc2732.txt[RFC 2732]).
154
155'CTRLPORT'::
156 Control port.
157
158'DATAPORT'::
159 Data port.
160
161'TRACEPATH'::
162 Path of trace files on the remote file system. This path is relative
163 to the base output directory set on the relay daemon side;
7c1a4458 164 see man:lttng-relayd(8).
ba50d967
PP
165
166
167include::common-cmd-options-head.txt[]
168
169
f87c4756
PP
170Mode selection
171~~~~~~~~~~~~~~
ba50d967 172option:--live[='DELAYUS']::
948f0a2e
PP
173 Create the session in <<live-mode,live mode>>.
174+
175The optional 'DELAYUS' parameter, given in microseconds, is the
176maximum time the user can wait for the data to be flushed. This mode
177can be set with a network URL (options option:--set-url, or
178option:--ctrl-url and option:--data-url) and must have a relay
179daemon listening (see man:lttng-relayd(8)).
ba50d967 180+
c93eadad
PP
181By default, 'DELAYUS' is {default_lttng_live_timer} and the network URL
182is set to `net://127.0.0.1`.
ba50d967
PP
183
184option:--snapshot::
948f0a2e
PP
185 Create the session in <<snapshot-mode,snapshot mode>>.
186 This is the equivalent of using the option:--no-output option and
187 creating all the channels of this new tracing session in overwrite
188 mode with an `mmap` output type.
ba50d967
PP
189
190
191Output
192~~~~~~
193option:--no-output::
948f0a2e 194 In <<local-mode,local mode>>, do not output any trace data.
ba50d967 195
59b19c3c 196option:-o 'PATH', option:--output='PATH'::
948f0a2e 197 In <<local-mode,local mode>>, set trace output path to 'PATH'.
ba50d967
PP
198
199option:--shm-path='PATH'::
200 Create shared memory holding buffers at 'PATH'.
201
202
203URL
204~~~
205See the <<url-format,URL format>> section above for more information
206about the syntax of the following options' 'URL' argument.
207
59b19c3c 208option:-C 'URL', option:--ctrl-url='URL'::
ba50d967
PP
209 Set control path URL to 'URL' (must use option:--data-url option
210 also).
211
59b19c3c 212option:-D 'URL', option:--data-url='URL'::
ba50d967
PP
213 Set data path URL to 'URL' (must use option:--ctrl-url option
214 also).
215
59b19c3c 216option:-U 'URL', option:--set-url='URL'::
ba50d967
PP
217 Set URL destination of the trace data to 'URL'. It is persistent for
218 the session lifetime. This option sets both data
219 (option:--data-url option) and control (option:--ctrl-url option)
220 URLs at the same time.
948f0a2e
PP
221+
222In <<local-mode,local>> mode, 'URL' must start with `file://` followed
223by the destination path on the local file system.
ba50d967
PP
224
225
226include::common-cmd-help-options.txt[]
227
228
229include::common-cmd-footer.txt[]
230
231
232SEE ALSO
233--------
7c1a4458
PP
234man:lttng-destroy(1),
235man:lttng-set-session(1),
236man:lttng(1)
This page took 0.036767 seconds and 4 git commands to generate.