c42a26ca1a3b467066254e05ca40fa51f0b00e1f
[lttng-tools.git] / doc / man / lttng-create.1.txt
1 lttng-create(1)
2 ===============
3
4
5 NAME
6 ----
7 lttng-create - Create an LTTng tracing session
8
9
10 SYNOPSIS
11 --------
12 Local mode:
13
14 [verse]
15 *lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *create* [option:--shm-path='PATH']
16 [option:--no-output | option:--output='PATH' | option:--set-url=file://'PATH'] ['SESSION']
17
18 Network 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']
23
24 Snapshot mode:
25
26 [verse]
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']
29
30 Live mode:
31
32 [verse]
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']
35
36 Template:
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
41
42 DESCRIPTION
43 -----------
44 The `lttng create` command creates a new tracing session.
45
46 A tracing session is a named container of channels, which in turn
47 contain event rules. It is domain-agnostic, in that channels and event
48 rules can be enabled for the user space tracer and/or the Linux
49 kernel tracer.
50
51 On execution, an `.lttngrc` file is created, if it does not exist, in the
52 user's home directory. This file contains the name of the current tracing
53 session. When creating a new tracing session with `lttng create`, the
54 current tracing session is set to this new tracing session. The
55 man:lttng-set-session(1) command can be used to set the current
56 tracing session without manually editing the `.lttngrc` file.
57
58 If 'SESSION' is omitted, a session name is automatically created having
59 this form: `auto-YYYYmmdd-HHMMSS`. 'SESSION' *must not* contain the
60 character `/`.
61
62 The option:--shm-path option can be used to specify the path to the
63 shared memory holding the ring buffers. Specifying a location on an
64 NVRAM file system makes it possible to retrieve the latest recorded
65 trace data when the system reboots after a crash. To view the events
66 of ring buffer files after a system crash, use the
67 man:lttng-crash(1) utility.
68
69 Tracing sessions are destroyed using the man:lttng-destroy(1)
70 command.
71
72
73 Creation modes
74 ~~~~~~~~~~~~~~
75 There are four tracing session modes:
76
77 [[local-mode]]Local mode::
78 Traces the local system and writes the trace to the local
79 file system. The option:--output option specifies the trace path.
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 +
84 If none of the options mentioned above are used, then the trace is
85 written locally in the `$LTTNG_HOME/lttng-traces` directory
86 (`$LTTNG_HOME` defaults to `$HOME`).
87
88 [[network-streaming-mode]]Network streaming mode::
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).
94
95 [[snapshot-mode]]Snapshot mode::
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
99 man:lttng-enable-channel(1)). The man:lttng-snapshot(1)
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
104 [[live-mode]]Live mode::
105 Traces the local system, sending trace data to an LTTng relay daemon
106 over the network (see man:lttng-relayd(8)). The
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
109 the `file://` protocol (see the <<url-format,URL format>>
110 section below).
111
112
113 [[url-format]]
114 URL format
115 ~~~~~~~~~~
116 The option:--set-url, option:--ctrl-url, and option:--data-url options'
117 arguments are URLs.
118
119 The format of those URLs is one of:
120
121 [verse]
122 file://'TRACEPATH'
123 'NETPROTO'://('HOST' | 'IPADDR')[:__CTRLPORT__[:__DATAPORT__]][/'TRACEPATH']
124
125 The `file://` protocol targets the *local file system* and can only
126 be used as the option:--set-url option's argument when the session is
127 created in <<local-mode,local>> or <<snapshot-mode,snapshot>> mode.
128
129 'TRACEPATH'::
130 Absolute path to trace files on the local file system.
131
132 The 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.
135
136 'NETPROTO'::
137 Network protocol, amongst:
138 +
139 --
140 `net`::
141 TCP over IPv4; the default values of 'CTRLPORT' and 'DATAPORT'
142 are respectively {default_network_control_port} and
143 {default_network_data_port}.
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 --
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;
170 see man:lttng-relayd(8).
171
172
173 include::common-cmd-options-head.txt[]
174
175
176 Mode selection
177 ~~~~~~~~~~~~~~
178 option:--live[='DELAYUS']::
179 Create the session in <<live-mode,live mode>>.
180 +
181 The optional 'DELAYUS' parameter, given in microseconds, is the
182 maximum time the user can wait for the data to be flushed. This mode
183 can be set with a network URL (options option:--set-url, or
184 option:--ctrl-url and option:--data-url) and must have a relay
185 daemon listening (see man:lttng-relayd(8)).
186 +
187 By default, 'DELAYUS' is {default_lttng_live_timer} and the network URL
188 is set to `net://127.0.0.1`.
189
190 option:--snapshot::
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.
195
196
197 Output
198 ~~~~~~
199 option:--no-output::
200 In <<local-mode,local mode>>, do not output any trace data.
201
202 option:-o, option:--output='PATH'::
203 In <<local-mode,local mode>>, set trace output path to 'PATH'.
204
205 option:--shm-path='PATH'::
206 Create shared memory holding buffers at 'PATH'.
207
208
209 URL
210 ~~~
211 See the <<url-format,URL format>> section above for more information
212 about the syntax of the following options' 'URL' argument.
213
214 option:-C, option:--ctrl-url='URL'::
215 Set control path URL to 'URL' (must use option:--data-url option
216 also).
217
218 option:-D, option:--data-url='URL'::
219 Set data path URL to 'URL' (must use option:--ctrl-url option
220 also).
221
222 option:-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.
227 +
228 In <<local-mode,local>> mode, 'URL' must start with `file://` followed
229 by the destination path on the local file system.
230
231 TEMPLATE
232 ~~~
233 option:--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
239
240 Name
241 ~~~~
242 option:--default-name::
243 Generate a session name of the form `auto-YYYYmmdd-HHMMSS`.
244
245 include::common-cmd-help-options.txt[]
246
247
248 include::common-cmd-footer.txt[]
249
250
251 SEE ALSO
252 --------
253 man:lttng-destroy(1),
254 man:lttng-set-session(1),
255 man:lttng(1)
This page took 0.034748 seconds and 4 git commands to generate.