7 lttng-create - Create an LTTng tracing session
15 *lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *create* [option:--shm-path='PATH']
16 [option:--no-output | option:--output='PATH' | option:--set-url=file://'PATH'] ['SESSION']
18 Network streaming mode:
21 *lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *create* [option:--shm-path='PATH']
22 (option:--set-url='URL' | option:--ctrl-url='URL' option:--data-url='URL') ['SESSION']
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']
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']
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']
44 The `lttng create` command creates a new tracing session.
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
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.
58 If 'SESSION' is omitted, a session name is automatically created having
59 this form: `auto-YYYYmmdd-HHMMSS`. 'SESSION' *must not* contain the
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.
69 Tracing sessions are destroyed using the man:lttng-destroy(1)
75 There are four tracing session modes:
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.
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`).
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).
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.
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>>
116 The option:--set-url, option:--ctrl-url, and option:--data-url options'
119 The format of those URLs is one of:
123 'NETPROTO'://('HOST' | 'IPADDR')[:__CTRLPORT__[:__DATAPORT__]][/'TRACEPATH']
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.
130 Absolute path to trace files on the local file system.
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.
137 Network protocol, amongst:
141 TCP over IPv4; the default values of 'CTRLPORT' and 'DATAPORT'
142 are respectively {default_network_control_port} and
143 {default_network_data_port}.
146 TCP over IPv6: same default ports as the `net` protocol.
149 Same as the `net` protocol; can only be used with the
150 option:--ctrl-url and option:--data-url options together.
153 Same as the `net6` protocol; can only be used with the
154 option:--ctrl-url and option:--data-url options together.
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]).
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).
173 include::common-cmd-options-head.txt[]
178 option:--live[='DELAYUS']::
179 Create the session in <<live-mode,live mode>>.
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)).
187 By default, 'DELAYUS' is {default_lttng_live_timer} and the network URL
188 is set to `net://127.0.0.1`.
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.
200 In <<local-mode,local mode>>, do not output any trace data.
202 option:-o, option:--output='PATH'::
203 In <<local-mode,local mode>>, set trace output path to 'PATH'.
205 option:--shm-path='PATH'::
206 Create shared memory holding buffers at 'PATH'.
211 See the <<url-format,URL format>> section above for more information
212 about the syntax of the following options' 'URL' argument.
214 option:-C, option:--ctrl-url='URL'::
215 Set control path URL to 'URL' (must use option:--data-url option
218 option:-D, option:--data-url='URL'::
219 Set data path URL to 'URL' (must use option:--ctrl-url option
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.
228 In <<local-mode,local>> mode, 'URL' must start with `file://` followed
229 by the destination path on the local file system.
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.
240 include::common-cmd-help-options.txt[]
243 include::common-cmd-footer.txt[]
248 man:lttng-destroy(1),
249 man:lttng-set-session(1),