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