Commit | Line | Data |
---|---|---|
ba50d967 PP |
1 | lttng-create(1) |
2 | =============== | |
3 | ||
4 | ||
5 | NAME | |
6 | ---- | |
7 | lttng-create - Create an LTTng tracing session | |
8 | ||
9 | ||
10 | SYNOPSIS | |
11 | -------- | |
f87c4756 | 12 | Local 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 | ||
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'] | |
ba50d967 PP |
23 | |
24 | Snapshot 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 | |
30 | Live 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 |
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 | ||
ba50d967 PP |
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 | |
7c1a4458 | 55 | man:lttng-set-session(1) command can be used to set the current |
ba50d967 PP |
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 | |
7c1a4458 | 67 | man:lttng-crash(1) utility. |
ba50d967 | 68 | |
7c1a4458 | 69 | Tracing sessions are destroyed using the man:lttng-destroy(1) |
ba50d967 PP |
70 | command. |
71 | ||
72 | ||
73 | Creation modes | |
74 | ~~~~~~~~~~~~~~ | |
f87c4756 | 75 | There 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 | + | |
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 | ||
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]] | |
114 | URL format | |
115 | ~~~~~~~~~~ | |
f87c4756 PP |
116 | The option:--set-url, option:--ctrl-url, and option:--data-url options' |
117 | arguments are URLs. | |
ba50d967 PP |
118 | |
119 | The format of those URLs is one of: | |
120 | ||
121 | [verse] | |
122 | file://'TRACEPATH' | |
123 | 'NETPROTO'://('HOST' | 'IPADDR')[:__CTRLPORT__[:__DATAPORT__]][/'TRACEPATH'] | |
124 | ||
f87c4756 | 125 | The `file://` protocol targets the *local file system* and can only |
948f0a2e PP |
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. | |
ba50d967 PP |
128 | |
129 | 'TRACEPATH':: | |
130 | Absolute path to trace files on the local file system. | |
131 | ||
948f0a2e PP |
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. | |
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 | ||
173 | include::common-cmd-options-head.txt[] | |
174 | ||
175 | ||
f87c4756 PP |
176 | Mode selection |
177 | ~~~~~~~~~~~~~~ | |
ba50d967 | 178 | option:--live[='DELAYUS']:: |
948f0a2e PP |
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)). | |
ba50d967 | 186 | + |
c93eadad PP |
187 | By default, 'DELAYUS' is {default_lttng_live_timer} and the network URL |
188 | is set to `net://127.0.0.1`. | |
ba50d967 PP |
189 | |
190 | option:--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 | ||
197 | Output | |
198 | ~~~~~~ | |
199 | option:--no-output:: | |
948f0a2e | 200 | In <<local-mode,local mode>>, do not output any trace data. |
ba50d967 PP |
201 | |
202 | option:-o, option:--output='PATH':: | |
948f0a2e | 203 | In <<local-mode,local mode>>, set trace output path to 'PATH'. |
ba50d967 PP |
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. | |
948f0a2e PP |
227 | + |
228 | In <<local-mode,local>> mode, 'URL' must start with `file://` followed | |
229 | by the destination path on the local file system. | |
ba50d967 | 230 | |
926a792a JR |
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 | ||
ba50d967 PP |
239 | |
240 | include::common-cmd-help-options.txt[] | |
241 | ||
242 | ||
243 | include::common-cmd-footer.txt[] | |
244 | ||
245 | ||
246 | SEE ALSO | |
247 | -------- | |
7c1a4458 PP |
248 | man:lttng-destroy(1), |
249 | man:lttng-set-session(1), | |
250 | man:lttng(1) |