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