Commit | Line | Data |
---|---|---|
391b9c72 | 1 | .TH "LTTNG" "1" "December 3rd, 2012" "" "" |
6991b181 DG |
2 | |
3 | .SH "NAME" | |
c5db699c | 4 | lttng \(em LTTng 2.x tracer control command line tool |
6991b181 DG |
5 | |
6 | .SH "SYNOPSIS" | |
7 | ||
8 | .PP | |
9 | .nf | |
10 | lttng [OPTIONS] <COMMAND> | |
11 | .fi | |
12 | .SH "DESCRIPTION" | |
13 | ||
14 | .PP | |
15 | The LTTng project aims at providing highly efficient tracing tools for Linux. | |
16 | It's tracers help tracking down performance issues and debugging problems | |
17 | involving multiple concurrent processes and threads. Tracing across multiple | |
18 | systems is also possible. | |
19 | ||
fa072eae | 20 | The \fBlttng\fP command line tool from the lttng-tools package is used to control |
6991b181 DG |
21 | both kernel and user-space tracing. Every interactions with the tracer should |
22 | be done by this tool or by the liblttng-ctl provided with the lttng-tools | |
23 | package. | |
24 | ||
25 | LTTng uses a session daemon (lttng-sessiond(8)), acting as a tracing registry, | |
50a3b92a | 26 | which allows you to interact with multiple tracers (kernel and user-space) |
6991b181 DG |
27 | inside the same container, a tracing session. Traces can be gathered from the |
28 | kernel and/or instrumented applications (lttng-ust(3)). Aggregating and reading | |
29 | those traces is done using the babeltrace(1) text viewer. | |
30 | ||
50a3b92a DG |
31 | We introduce the notion of \fBtracing domains\fP which is essentially a type of |
32 | tracer (kernel or user space for now). In the future, we could see a third | |
33 | tracer being for instance an hypervisor. For some commands, you'll need to | |
34 | specify on which domain the command applies (-u or -k). For instance, enabling | |
35 | a kernel event, you must specify the kernel domain to the command so we know | |
36 | for which tracer this event is for. | |
37 | ||
6991b181 DG |
38 | In order to trace the kernel, the session daemon needs to be running as root. |
39 | LTTng provides the use of a \fBtracing group\fP (default: tracing). Whomever is | |
40 | in that group can interact with the root session daemon and thus trace the | |
41 | kernel. Session daemons can co-exist meaning that you can have a session daemon | |
fa072eae YB |
42 | running as Alice that can be used to trace her applications along side with a |
43 | root daemon or even a Bob daemon. We highly recommend to start the session | |
6991b181 DG |
44 | daemon at boot time for stable and long term tracing. |
45 | ||
46 | Every user-space applications instrumented with lttng-ust(3), will | |
47 | automatically register to the session daemon. This feature gives you the | |
48 | ability to list available traceable applications and tracepoints on a per user | |
49 | basis. (See \fBlist\fP command). | |
50 | .SH "OPTIONS" | |
51 | ||
52 | .PP | |
53 | This program follow the usual GNU command line syntax with long options starting with | |
54 | two dashes. Below is a summary of the available options. | |
55 | .PP | |
56 | ||
57 | .TP | |
c9e32613 | 58 | .BR "\-h, \-\-help" |
6991b181 DG |
59 | Show summary of possible options and commands. |
60 | .TP | |
c9e32613 | 61 | .BR "\-v, \-\-verbose" |
6991b181 | 62 | Increase verbosity. |
d829b38c | 63 | Three levels of verbosity are available which are triggered by putting additional v to |
fa072eae | 64 | the option (\-vv or \-vvv) |
6991b181 | 65 | .TP |
c9e32613 | 66 | .BR "\-q, \-\-quiet" |
6991b181 DG |
67 | Suppress all messages (even errors). |
68 | .TP | |
c9e32613 | 69 | .BR "\-g, \-\-group NAME" |
6991b181 DG |
70 | Set unix tracing group name. (default: tracing) |
71 | .TP | |
c9e32613 | 72 | .BR "\-n, \-\-no-sessiond" |
6991b181 DG |
73 | Don't automatically spawn a session daemon. |
74 | .TP | |
391b9c72 | 75 | .BR "\-\-sessiond\-path PATH" |
6991b181 DG |
76 | Set session daemon full binary path. |
77 | .TP | |
c9e32613 | 78 | .BR "\-\-list\-options" |
6991b181 DG |
79 | Simple listing of lttng options. |
80 | .TP | |
c9e32613 | 81 | .BR "\-\-list\-commands" |
6991b181 DG |
82 | Simple listing of lttng commands. |
83 | .SH "COMMANDS" | |
84 | ||
85 | .TP | |
86 | \fBadd-context\fP | |
87 | .nf | |
88 | Add context to event(s) and/or channel(s). | |
89 | ||
391b9c72 DG |
90 | A context is basically extra information appended to a channel. For instance, |
91 | you could ask the tracer to add the PID information for all events in a | |
92 | channel. You can also add performance monitoring unit counters (perf PMU) using | |
93 | the perf kernel API). | |
6991b181 DG |
94 | |
95 | For example, this command will add the context information 'prio' and two perf | |
96 | counters (hardware branch misses and cache misses), to all events in the trace | |
97 | data output: | |
98 | ||
c9e32613 | 99 | # lttng add-context \-k \-t prio \-t perf:branch-misses \-t perf:cache-misses |
6991b181 | 100 | |
c9e32613 | 101 | Please take a look at the help (\-h/\-\-help) for a detailed list of available |
6991b181 DG |
102 | contexts. |
103 | ||
bd337b98 DG |
104 | If no channel is given (\-c), the context is added to all channels that were |
105 | already enabled. If the session has no channel, a default channel is created. | |
106 | Otherwise the context will be added only to the given channel (\-c). | |
6991b181 | 107 | |
c9e32613 | 108 | If \fB\-s, \-\-session\fP is omitted, the session name is taken from the .lttngrc |
6991b181 DG |
109 | file. |
110 | .fi | |
111 | ||
112 | .B OPTIONS: | |
113 | ||
114 | .nf | |
c9e32613 | 115 | \-h, \-\-help |
6991b181 | 116 | Show summary of possible options and commands. |
c9e32613 | 117 | \-s, \-\-session NAME |
6991b181 | 118 | Apply on session name. |
c9e32613 | 119 | \-c, \-\-channel NAME |
6991b181 | 120 | Apply on channel name. |
c9e32613 | 121 | \-k, \-\-kernel |
6991b181 | 122 | Apply for the kernel tracer |
c9e32613 | 123 | \-u, \-\-userspace |
6991b181 | 124 | Apply for the user-space tracer |
c9e32613 | 125 | \-t, \-\-type TYPE |
6991b181 | 126 | Context type. You can repeat this option on the command line. Please |
c9e32613 | 127 | use "lttng add-context \-h" to list all available types. |
6991b181 DG |
128 | .fi |
129 | ||
130 | .IP | |
131 | ||
132 | .IP "\fBcalibrate\fP" | |
133 | .nf | |
134 | Quantify LTTng overhead | |
135 | ||
136 | The LTTng calibrate command can be used to find out the combined average | |
137 | overhead of the LTTng tracer and the instrumentation mechanisms used. This | |
138 | overhead can be calibrated in terms of time or using any of the PMU performance | |
139 | counter available on the system. | |
140 | ||
141 | For now, the only calibration implemented is that of the kernel function | |
142 | instrumentation (kretprobes). | |
143 | ||
144 | * Calibrate kernel function instrumentation | |
145 | ||
146 | Let's use an example to show this calibration. We use an i7 processor with 4 | |
147 | general-purpose PMU registers. This information is available by issuing dmesg, | |
148 | looking for "generic registers". | |
149 | ||
150 | This sequence of commands will gather a trace executing a kretprobe hooked on | |
151 | an empty function, gathering PMU counters LLC (Last Level Cache) misses | |
c9e32613 | 152 | information (see lttng add-context \-\-help to see the list of available PMU |
6991b181 DG |
153 | counters). |
154 | ||
155 | # lttng create calibrate-function | |
c9e32613 DG |
156 | # lttng enable-event calibrate \-\-kernel \-\-function lttng_calibrate_kretprobe |
157 | # lttng add-context \-\-kernel \-t perf:LLC-load-misses \-t perf:LLC-store-misses \\ | |
158 | \-t perf:LLC-prefetch-misses | |
6991b181 DG |
159 | # lttng start |
160 | # for a in $(seq 1 10); do \\ | |
c9e32613 | 161 | lttng calibrate \-\-kernel \-\-function; |
6991b181 DG |
162 | done |
163 | # lttng destroy | |
c9e32613 | 164 | # babeltrace $(ls \-1drt ~/lttng-traces/calibrate-function-* | tail \-n 1) |
6991b181 DG |
165 | |
166 | The output from babeltrace can be saved to a text file and opened in a | |
167 | spreadsheet (e.g. oocalc) to focus on the per-PMU counter delta between | |
168 | consecutive "calibrate_entry" and "calibrate_return" events. Note that these | |
169 | counters are per-CPU, so scheduling events would need to be present to account | |
170 | for migration between CPU. Therefore, for calibration purposes, only events | |
171 | staying on the same CPU must be considered. | |
172 | ||
173 | The average result, for the i7, on 10 samples: | |
174 | ||
175 | Average Std.Dev. | |
176 | perf_LLC_load_misses: 5.0 0.577 | |
177 | perf_LLC_store_misses: 1.6 0.516 | |
178 | perf_LLC_prefetch_misses: 9.0 14.742 | |
179 | ||
180 | As we can notice, the load and store misses are relatively stable across runs | |
181 | (their standard deviation is relatively low) compared to the prefetch misses. | |
182 | We can conclude from this information that LLC load and store misses can be | |
183 | accounted for quite precisely, but prefetches within a function seems to behave | |
184 | too erratically (not much causality link between the code executed and the CPU | |
185 | prefetch activity) to be accounted for. | |
186 | .fi | |
187 | ||
188 | .B OPTIONS: | |
189 | ||
190 | .nf | |
c9e32613 | 191 | \-h, \-\-help |
6991b181 | 192 | Show summary of possible options and commands. |
c9e32613 | 193 | \-k, \-\-kernel |
6991b181 | 194 | Apply for the kernel tracer |
c9e32613 | 195 | \-u, \-\-userspace |
6991b181 | 196 | Apply for the user-space tracer |
c9e32613 | 197 | \-\-function |
6991b181 DG |
198 | Dynamic function entry/return probe (default) |
199 | .fi | |
200 | ||
201 | .IP | |
202 | ||
6b8f2e64 | 203 | .IP "\fBcreate\fP [NAME] [OPTIONS] |
6991b181 DG |
204 | .nf |
205 | Create tracing session. | |
206 | ||
207 | A tracing session contains channel(s) which contains event(s). It is domain | |
208 | agnostic meaning that you can enable channels and events for either the | |
209 | user-space tracer and/or the kernel tracer. It acts like a container | |
210 | aggregating multiple tracing sources. | |
211 | ||
212 | On creation, a \fB.lttngrc\fP file is created in your $HOME directory | |
213 | containing the current session name. If NAME is omitted, a session name is | |
fa072eae | 214 | automatically created having this form: 'auto-yyyymmdd-hhmmss'. |
6991b181 | 215 | |
c9e32613 | 216 | If no \fB\-o, \-\-output\fP is specified, the traces will be written in |
6991b181 | 217 | $HOME/lttng-traces. |
feb0f3e5 AM |
218 | |
219 | The $HOME environment variable can be overridden by defining the environment | |
220 | variable LTTNG_HOME. This is useful when the user running the commands has | |
221 | a non-writeable home directory. | |
6991b181 DG |
222 | .fi |
223 | ||
224 | .B OPTIONS: | |
225 | ||
226 | .nf | |
c9e32613 | 227 | \-h, \-\-help |
6991b181 | 228 | Show summary of possible options and commands. |
c9e32613 | 229 | \-\-list-options |
6991b181 | 230 | Simple listing of options |
c9e32613 | 231 | \-o, \-\-output PATH |
6991b181 | 232 | Specify output path for traces |
6b8f2e64 DG |
233 | |
234 | Using these options, each API call can be controlled individually. For | |
235 | instance, \-C does not enable the consumer automatically. You'll need the \-e | |
236 | option for that. | |
237 | ||
23d14dff | 238 | \-U, \-\-set-url=URL |
785d2d0d | 239 | Set URL for the consumer output destination. It is persistent for the |
6b8f2e64 DG |
240 | session lifetime. Redo the command to change it. This will set both |
241 | data and control URL for network. | |
242 | \-C, \-\-ctrl-url=URL | |
243 | Set control path URL. (Must use -D also) | |
244 | \-D, \-\-data-url=URL | |
245 | Set data path URL. (Must use -C also) | |
6b8f2e64 | 246 | |
785d2d0d DG |
247 | .B URL FORMAT: |
248 | ||
249 | proto://[HOST|IP][:PORT1[:PORT2]][/TRACE_PATH] | |
250 | ||
251 | Supported protocols are (proto): | |
252 | > file://... | |
253 | Local filesystem full path. | |
254 | ||
255 | > net://... | |
256 | This will use the default network transport layer which is TCP for both | |
257 | control (PORT1) and data port (PORT2). The default ports are | |
258 | respectively 5342 and 5343. Note that net[6]:// is not yet supported. | |
259 | ||
260 | > tcp[6]://... | |
261 | Can only be used with -C and -D together | |
262 | ||
263 | NOTE: IPv6 address MUST be enclosed in brackets '[]' (rfc2732) | |
6b8f2e64 DG |
264 | |
265 | .B EXAMPLES: | |
266 | ||
267 | # lttng create -U net://192.168.1.42 | |
268 | Uses TCP and default ports for the given destination. | |
269 | ||
270 | # lttng create -U net6://[fe80::f66d:4ff:fe53:d220] | |
271 | Uses TCP, default ports and IPv6. | |
272 | ||
273 | # lttng create s1 -U net://myhost.com:3229 | |
274 | Create session s1 and set its consumer to myhost.com on port 3229 for control. | |
6991b181 DG |
275 | .fi |
276 | ||
277 | .IP | |
278 | ||
279 | .IP "\fBdestroy\fP [OPTIONS] [NAME]" | |
280 | .nf | |
281 | Teardown tracing session | |
282 | ||
283 | Free memory on the session daemon and tracer side. It's gone! | |
284 | ||
285 | If NAME is omitted, the session name is taken from the .lttngrc file. | |
286 | .fi | |
287 | ||
288 | .B OPTIONS: | |
289 | ||
290 | .nf | |
c9e32613 | 291 | \-h, \-\-help |
6991b181 | 292 | Show summary of possible options and commands. |
a3c5b534 FG |
293 | \-a, \-\-all |
294 | Destroy all sessions | |
c9e32613 | 295 | \-\-list-options |
6991b181 DG |
296 | Simple listing of options |
297 | .fi | |
298 | ||
299 | .IP | |
300 | ||
301 | .IP "\fBenable-channel\fP NAME[,NAME2,...] [-k|-u] [OPTIONS]" | |
302 | .nf | |
303 | Enable tracing channel | |
304 | ||
004f3466 DG |
305 | To enable an event, you must enable both the event and the channel that |
306 | contains it. | |
b883c01b | 307 | |
c9e32613 | 308 | If \fB\-s, \-\-session\fP is omitted, the session name is taken from the .lttngrc |
6991b181 | 309 | file. |
7972aab2 DG |
310 | |
311 | It is important to note that if a certain type of buffers is used, the session | |
bd337b98 | 312 | will be set with that type and all other subsequent channel needs to have the |
7972aab2 | 313 | same type. |
bd337b98 | 314 | |
d2f11c4a DG |
315 | Note that once the session has been started and enabled on the tracer side, |
316 | it's not possible anymore to enable a new channel for that session. | |
6991b181 DG |
317 | .fi |
318 | ||
319 | .B OPTIONS: | |
320 | ||
321 | .nf | |
c9e32613 | 322 | \-h, \-\-help |
6991b181 | 323 | Show this help |
c9e32613 | 324 | \-\-list-options |
6991b181 | 325 | Simple listing of options |
391b9c72 | 326 | \-s, \-\-session NAME |
6991b181 | 327 | Apply on session name |
c9e32613 | 328 | \-k, \-\-kernel |
6991b181 | 329 | Apply to the kernel tracer |
c9e32613 | 330 | \-u, \-\-userspace |
6991b181 DG |
331 | Apply to the user-space tracer |
332 | ||
c9e32613 | 333 | \-\-discard |
6991b181 | 334 | Discard event when subbuffers are full (default) |
c9e32613 | 335 | \-\-overwrite |
6991b181 | 336 | Flight recorder mode : overwrites events when subbuffers are full |
391b9c72 | 337 | \-\-subbuf-size SIZE |
0a9c6494 DG |
338 | Subbuffer size in bytes {+k,+M,+G} |
339 | (default UST uid: 131072, UST pid: 4096, kernel: 262144, metadata: 4096) | |
1cb514ce | 340 | Rounded up to the next power of 2. |
bd337b98 DG |
341 | |
342 | The minimum subbuffer size, for each tracer, is the max value between | |
343 | the default above and the system page size. You can issue this command | |
344 | to get the current page size on your system: \fB$ getconf PAGE_SIZE\fP | |
391b9c72 | 345 | \-\-num-subbuf NUM |
0a9c6494 | 346 | Number of subbuffers. (default UST uid: 4, UST pid: 4, kernel: 4, metadata: 2) |
1cb514ce | 347 | Rounded up to the next power of 2. |
391b9c72 | 348 | \-\-switch-timer USEC |
0a9c6494 DG |
349 | Switch subbuffer timer interval in µsec. |
350 | (default UST uid: 0, UST pid: 0, kernel: 0, metadata: 0) | |
391b9c72 | 351 | \-\-read-timer USEC |
0a9c6494 DG |
352 | Read timer interval in µsec. |
353 | (default UST uid: 0, UST pid: 0, kernel: 200000, metadata: 0) | |
391b9c72 DG |
354 | \-\-output TYPE |
355 | Channel output type. Possible values: mmap, splice | |
0a9c6494 | 356 | (default UST uid: mmap, UST pid: mmap, kernel: splice, metadata: mmap) |
7972aab2 DG |
357 | \-\-buffers-uid |
358 | Use per UID buffer (\-u only). Buffers are shared between applications | |
359 | that have the same UID. | |
360 | \-\-buffers-pid | |
361 | Use per PID buffer (\-u only). Each application has its own buffers. | |
362 | \-\-buffers-global | |
363 | Use shared buffer for the whole system (\-k only) | |
1624d5b7 | 364 | \-C, \-\-tracefile-size SIZE |
e132a0d4 | 365 | Maximum size of each tracefile within a stream (in bytes). |
0a9c6494 | 366 | 0 means unlimited. (default: 0) |
1624d5b7 JD |
367 | \-W, \-\-tracefile-count COUNT |
368 | Used in conjunction with \-C option, this will limit the number | |
0a9c6494 | 369 | of files created to the specified count. 0 means unlimited. (default: 0) |
1624d5b7 JD |
370 | |
371 | .B EXAMPLES: | |
372 | ||
373 | $ lttng enable-channel -C 4096 -W 32 chan1 | |
cea28771 DG |
374 | For each stream, the maximum size of each trace file will be 4096 bytes, and |
375 | there will be a maximum of 32 different files. The file count is appended after | |
1624d5b7 JD |
376 | the stream number as seen in the following example. The last trace file is |
377 | smaller than 4096 since it was not completely filled. | |
378 | ||
379 | ~/lttng-traces/[...]/chan1_0_0 (4096) | |
380 | ~/lttng-traces/[...]/chan1_0_1 (4096) | |
381 | ~/lttng-traces/[...]/chan1_0_2 (3245) | |
382 | ~/lttng-traces/[...]/chan1_1_0 (4096) | |
383 | ... | |
384 | ||
385 | $ lttng enable-channel -C 4096 | |
386 | This will create trace files of 4096 bytes and will create new ones as long as | |
387 | there is data available. | |
6991b181 DG |
388 | .fi |
389 | ||
390 | .IP | |
391 | ||
392 | .IP "\fBenable-event\fP NAME[,NAME2,...] [-k|-u] [OPTIONS]" | |
393 | .nf | |
394 | Enable tracing event | |
395 | ||
c9e32613 | 396 | A tracing event is always assigned to a channel. If \fB\-c, \-\-channel\fP is |
6991b181 | 397 | omitted, a default channel named '\fBchannel0\fP' is created and the event is |
c9e32613 | 398 | added to it. For the user-space tracer, using \fB\-a, \-\-all\fP is the same as |
6991b181 DG |
399 | using the wildcard "*". |
400 | ||
c9e32613 | 401 | If \fB\-s, \-\-session\fP is omitted, the session name is taken from the .lttngrc |
6991b181 DG |
402 | file. |
403 | .fi | |
404 | ||
405 | .B OPTIONS: | |
406 | ||
407 | .nf | |
c9e32613 | 408 | \-h, \-\-help |
6991b181 | 409 | Show summary of possible options and commands. |
c9e32613 | 410 | \-\-list-options |
6991b181 | 411 | Simple listing of options |
391b9c72 | 412 | \-s, \-\-session NAME |
6991b181 | 413 | Apply on session name |
391b9c72 | 414 | \-c, \-\-channel NAME |
6991b181 | 415 | Apply on channel name |
c9e32613 | 416 | \-a, \-\-all |
c5650942 DG |
417 | Enable all tracepoints and syscalls. This actually enable a single |
418 | wildcard event "*". | |
c9e32613 | 419 | \-k, \-\-kernel |
6991b181 | 420 | Apply for the kernel tracer |
c9e32613 | 421 | \-u, \-\-userspace |
6991b181 DG |
422 | Apply for the user-space tracer |
423 | ||
c9e32613 | 424 | \-\-tracepoint |
6991b181 DG |
425 | Tracepoint event (default) |
426 | - userspace tracer supports wildcards at end of string. Don't forget to | |
427 | quote to deal with bash expansion. | |
428 | e.g.: | |
429 | "*" | |
430 | "app_component:na*" | |
391b9c72 DG |
431 | \-\-loglevel NAME |
432 | Tracepoint loglevel range from 0 to loglevel. Listed in the help (\-h). | |
433 | \-\-loglevel-only NAME | |
434 | Tracepoint loglevel (only this loglevel). | |
435 | ||
436 | The loglevel or loglevel-only options should be combined with a | |
437 | tracepoint name or tracepoint wildcard. | |
c9e32613 | 438 | \-\-probe [addr | symbol | symbol+offset] |
6991b181 DG |
439 | Dynamic probe. Addr and offset can be octal (0NNN...), decimal (NNN...) |
440 | or hexadecimal (0xNNN...) | |
c9e32613 | 441 | \-\-function [addr | symbol | symbol+offset] |
6991b181 DG |
442 | Dynamic function entry/return probe. Addr and offset can be octal |
443 | (0NNN...), decimal (NNN...) or hexadecimal (0xNNN...) | |
c9e32613 | 444 | \-\-syscall |
6b8f2e64 DG |
445 | System call event. Enabling syscalls tracing (kernel tracer), you will |
446 | not be able to disable them with disable-event. This is a known | |
447 | limitation. You can disable the entire channel to do the trick. | |
9bd578f5 | 448 | |
919e300c | 449 | \-\-filter 'expression' |
6b8f2e64 | 450 | Set a filter on a newly enabled event. Filter expression on event |
ee8ccafa MD |
451 | fields and context. Event recording depends on evaluation. Only |
452 | specify on first activation of a given event within a session. | |
453 | Filter only allowed when enabling events within a session before | |
454 | tracing is started. If the filter fails to link with the event | |
455 | within the traced domain, the event will be discarded. | |
456 | Currently, filter is only implemented for the user-space tracer. | |
6b8f2e64 DG |
457 | |
458 | Expression examples: | |
459 | ||
460 | 'intfield > 500 && intfield < 503' | |
461 | '(stringfield == "test" || intfield != 10) && intfield > 33' | |
462 | 'doublefield > 1.1 && intfield < 5.3' | |
463 | ||
464 | Wildcards are allowed at the end of strings: | |
465 | 'seqfield1 == "te*"' | |
466 | In string literals, the escape character is a '\\'. Use '\\*' for | |
ee8ccafa MD |
467 | the '*' character, and '\\\\' for the '\\' character. Wildcard |
468 | match any sequence of characters, including an empty sub-string | |
469 | (match 0 or more characters). | |
470 | ||
471 | Context information can be used for filtering. The examples | |
472 | below show usage of context filtering on process name (with a | |
473 | wildcard), process ID range, and unique thread ID for filtering. | |
474 | The process and thread ID of running applications can be found | |
475 | under columns "PID" and "LWP" of the "ps -eLf" command. | |
476 | ||
477 | '$ctx.procname == "demo*"' | |
478 | '$ctx.vpid >= 4433 && $ctx.vpid < 4455' | |
479 | '$ctx.vtid == 1234' | |
6991b181 DG |
480 | .fi |
481 | ||
c9e32613 | 482 | .IP "\fBdisable-channel\fP NAME[,NAME2,...] [\-k|\-u] [OPTIONS]" |
6991b181 DG |
483 | .nf |
484 | Disable tracing channel | |
485 | ||
486 | Disabling a channel makes all event(s) in that channel to stop tracing. You can | |
487 | enable it back by calling \fBlttng enable-channel NAME\fP again. | |
488 | ||
c9e32613 | 489 | If \fB\-s, \-\-session\fP is omitted, the session name is taken from the .lttngrc |
6991b181 DG |
490 | file. |
491 | .fi | |
492 | ||
493 | .B OPTIONS: | |
494 | ||
6b8f2e64 DG |
495 | .nf |
496 | \-h, \-\-help | |
497 | Show summary of possible options and commands. | |
498 | \-\-list-options | |
499 | Simple listing of options | |
500 | \-s, \-\-session NAME | |
6991b181 | 501 | Apply on session name |
c9e32613 | 502 | \-k, \-\-kernel |
6991b181 | 503 | Apply for the kernel tracer |
c9e32613 | 504 | \-u, \-\-userspace |
6991b181 DG |
505 | Apply for the user-space tracer |
506 | .fi | |
507 | ||
c9e32613 | 508 | .IP "\fBdisable-event\fP NAME[,NAME2,...] [\-k|\-u] [OPTIONS]" |
6991b181 DG |
509 | .nf |
510 | Disable tracing event | |
511 | ||
512 | The event, once disabled, can be re-enabled by calling \fBlttng enable-event | |
513 | NAME\fP again. | |
514 | ||
c9e32613 | 515 | If \fB\-s, \-\-session\fP is omitted, the session name is taken from the .lttngrc |
6991b181 DG |
516 | file. |
517 | .fi | |
518 | ||
519 | .B OPTIONS: | |
520 | ||
521 | .nf | |
c9e32613 | 522 | \-h, \-\-help |
6991b181 | 523 | Show summary of possible options and commands. |
c9e32613 | 524 | \-\-list-options |
6991b181 | 525 | Simple listing of options |
391b9c72 | 526 | \-s, \-\-session NAME |
6991b181 | 527 | Apply on session name |
c5650942 DG |
528 | \-a, \-\-all-events |
529 | Disable all events. This does NOT disable "*" but rather | |
530 | every known events of the session. | |
c9e32613 | 531 | \-k, \-\-kernel |
6991b181 | 532 | Apply for the kernel tracer |
c9e32613 | 533 | \-u, \-\-userspace |
6991b181 DG |
534 | Apply for the user-space tracer |
535 | .fi | |
536 | ||
c9e32613 | 537 | .IP "\fBlist\fP [\-k|\-u] [SESSION [SESSION_OPTIONS]]" |
6991b181 | 538 | .nf |
c9e32613 | 539 | List tracing session information. |
6991b181 DG |
540 | |
541 | With no arguments, it will list available tracing session(s). | |
542 | ||
fa072eae YB |
543 | With the session name, it will display the details of the session including |
544 | the trace file path, the associated channels and their state (activated | |
d829b38c | 545 | and deactivated), the activated events and more. |
fa072eae | 546 | |
c9e32613 | 547 | With \-k alone, it will list all available kernel events (except the system |
6991b181 | 548 | calls events). |
c9e32613 DG |
549 | With \-u alone, it will list all available user-space events from registered |
550 | applications. Here is an example of 'lttng list \-u': | |
6991b181 DG |
551 | |
552 | PID: 7448 - Name: /tmp/lttng-ust/tests/hello/.libs/lt-hello | |
553 | ust_tests_hello:tptest_sighandler (type: tracepoint) | |
554 | ust_tests_hello:tptest (type: tracepoint) | |
555 | ||
556 | You can now enable any event listed by using the name : | |
557 | \fBust_tests_hello:tptest\fP. | |
558 | .fi | |
559 | ||
560 | .B OPTIONS: | |
561 | ||
562 | .nf | |
c9e32613 | 563 | \-h, \-\-help |
6991b181 | 564 | Show summary of possible options and commands. |
c9e32613 | 565 | \-\-list-options |
6991b181 | 566 | Simple listing of options |
c9e32613 | 567 | \-k, \-\-kernel |
d829b38c | 568 | Select kernel domain |
c9e32613 | 569 | \-u, \-\-userspace |
6991b181 DG |
570 | Select user-space domain. |
571 | ||
6b8f2e64 DG |
572 | .B SESSION OPTIONS: |
573 | ||
c9e32613 | 574 | \-c, \-\-channel NAME |
6991b181 | 575 | List details of a channel |
c9e32613 | 576 | \-d, \-\-domain |
6991b181 DG |
577 | List available domain(s) |
578 | .fi | |
579 | ||
580 | .IP "\fBset-session\fP NAME" | |
581 | .nf | |
582 | Set current session name | |
583 | ||
584 | Will change the session name in the .lttngrc file. | |
585 | .fi | |
586 | ||
587 | .B OPTIONS: | |
588 | ||
589 | .nf | |
c9e32613 | 590 | \-h, \-\-help |
6991b181 | 591 | Show summary of possible options and commands. |
c9e32613 | 592 | \-\-list-options |
6991b181 DG |
593 | Simple listing of options |
594 | .fi | |
595 | ||
596 | .IP | |
597 | ||
b872baea DG |
598 | .IP "\fBsnapshot\fP ACTION" |
599 | .nf | |
600 | Snapshot command for LTTng session. | |
601 | .fi | |
602 | ||
603 | .B OPTIONS: | |
604 | ||
605 | .nf | |
606 | \-h, \-\-help | |
607 | Show summary of possible options and commands. | |
608 | \-\-list-options | |
609 | Simple listing of options | |
610 | .fi | |
611 | ||
612 | .B ACTION: | |
613 | ||
614 | .nf | |
615 | \fBadd-output\fP [-m <SIZE>] [-s <NAME>] [-n <NAME>] <URL> | -C <URL> -D <URL> | |
616 | ||
617 | Setup and add an snapshot output for a session. Output are the destination | |
618 | where the snapshot will be sent. Only one output is permitted. To change it, | |
619 | you'll need to delete it and add back the new one. | |
620 | ||
621 | \fBdel-output\fP ID | NAME [-s <NAME>] | |
622 | ||
623 | Delete an output for a session using the ID. You can either specify the | |
624 | output's ID that can be found with list-output or the name. | |
625 | ||
626 | \fBlist-output\fP [-s <NAME>] | |
627 | ||
628 | List the output of a session. Attributes of the output are printed. | |
629 | ||
630 | \fBrecord\fP [-m <SIZE>] [-s <NAME>] [-n <NAME>] [<URL> | -C <URL> -D <URL>] | |
631 | ||
632 | Snapshot a session's buffer(s) for all domains. If an URL is specified, it is | |
633 | used instead of a previously added output. Specifying only a name or/and a max | |
634 | size will override the current output values. For instance, you can record a | |
635 | snapshot with a custom maximum size or with a different name. | |
636 | ||
637 | $ lttng add-output -n mysnapshot file:///data/snapshot | |
638 | [...] | |
639 | $ lttng snapshot record -n new_name_snapshot | |
640 | ||
641 | The above will create a snapshot in /data/snapshot/new_name_snapshot* directory | |
642 | rather then in mysnapshot*/ | |
643 | .fi | |
644 | ||
645 | .B LONG OPTIONS | |
646 | ||
647 | .nf | |
3ae6f666 DG |
648 | \-s, \-\-session NAME |
649 | Apply to session name. | |
650 | \-n, \-\-name NAME | |
651 | Name of the snapshot's output. | |
652 | \-m, \-\-max-size SIZE | |
653 | Maximum size in bytes of the snapshot. The maxium size does not | |
654 | include the metadata file. | |
655 | \-C, \-\-ctrl-url URL | |
656 | Set control path URL. (Must use -D also) | |
657 | \-D, \-\-data-url URL | |
658 | Set data path URL. (Must use -C also) | |
b872baea DG |
659 | .fi |
660 | ||
661 | .IP | |
662 | ||
6b8f2e64 | 663 | .IP "\fBstart\fP [NAME] [OPTIONS]" |
6991b181 DG |
664 | .nf |
665 | Start tracing | |
666 | ||
667 | It will start tracing for all tracers for a specific tracing session. | |
668 | ||
669 | If NAME is omitted, the session name is taken from the .lttngrc file. | |
670 | .fi | |
671 | ||
672 | .B OPTIONS: | |
673 | ||
674 | .nf | |
c9e32613 | 675 | \-h, \-\-help |
6991b181 | 676 | Show summary of possible options and commands. |
c9e32613 | 677 | \-\-list-options |
6991b181 DG |
678 | Simple listing of options |
679 | .fi | |
680 | ||
681 | .IP | |
682 | ||
6b8f2e64 | 683 | .IP "\fBstop\fP [NAME] [OPTIONS]" |
6991b181 DG |
684 | .nf |
685 | Stop tracing | |
686 | ||
391b9c72 DG |
687 | It will stop tracing for all tracers for a specific tracing session. Before |
688 | returning, the command checks for data availability meaning that it will wait | |
689 | until the trace is readable for the session. Use \-\-no-wait to avoid this | |
690 | behavior. | |
6991b181 DG |
691 | |
692 | If NAME is omitted, the session name is taken from the .lttngrc file. | |
693 | .fi | |
694 | ||
695 | .B OPTIONS: | |
696 | ||
697 | .nf | |
c9e32613 | 698 | \-h, \-\-help |
6991b181 | 699 | Show summary of possible options and commands. |
c9e32613 | 700 | \-\-list-options |
6991b181 | 701 | Simple listing of options |
391b9c72 DG |
702 | \-\-no-wait |
703 | Don't wait for data availability. | |
6991b181 DG |
704 | .fi |
705 | ||
706 | .IP | |
707 | ||
708 | .IP "\fBversion\fP" | |
709 | .nf | |
710 | Show version information | |
711 | .fi | |
712 | ||
713 | .B OPTIONS: | |
714 | ||
715 | .nf | |
c9e32613 | 716 | \-h, \-\-help |
6991b181 | 717 | Show summary of possible options and commands. |
c9e32613 | 718 | \-\-list-options |
6991b181 DG |
719 | Simple listing of options |
720 | .fi | |
721 | ||
722 | .IP | |
723 | ||
724 | .IP "\fBview\fP [SESSION_NAME] [OPTIONS]" | |
725 | .nf | |
726 | View traces of a tracing session | |
727 | ||
728 | By default, the babeltrace viewer will be used for text viewing. | |
729 | ||
fa072eae YB |
730 | If SESSION_NAME is omitted, the session name is taken from the .lttngrc file. |
731 | ||
6991b181 DG |
732 | .fi |
733 | ||
734 | .B OPTIONS: | |
735 | ||
736 | .nf | |
c9e32613 | 737 | \-h, \-\-help |
6991b181 | 738 | Show this help |
c9e32613 | 739 | \-\-list-options |
6991b181 | 740 | Simple listing of options |
c9e32613 | 741 | \-t, \-\-trace-path PATH |
6991b181 | 742 | Trace directory path for the viewer |
c9e32613 | 743 | \-e, \-\-viewer CMD |
6991b181 DG |
744 | Specify viewer and/or options to use |
745 | This will completely override the default viewers so | |
746 | please make sure to specify the full command. The trace | |
747 | directory path of the session will be appended at the end | |
748 | to the arguments | |
749 | .fi | |
750 | ||
c206d957 | 751 | .SH "EXIT VALUES" |
6b8f2e64 DG |
752 | On success 0 is returned and a positive value on error. Value of 1 means a command |
753 | error, 2 an undefined command, 3 a fatal error and 4 a command warning meaning that | |
754 | something went wrong during the command. | |
c206d957 | 755 | |
6b8f2e64 DG |
756 | Any other value above 10, please refer to |
757 | .BR <lttng/lttng-error.h> | |
758 | for a detailed list or use lttng_strerror() to get a human readable string of | |
759 | the error code. | |
c206d957 | 760 | |
c206d957 | 761 | .PP |
6991b181 DG |
762 | .SH "ENVIRONMENT VARIABLES" |
763 | ||
764 | .PP | |
765 | Note that all command line options override environment variables. | |
766 | .PP | |
767 | ||
768 | .PP | |
05833633 | 769 | .IP "LTTNG_SESSIOND_PATH" |
c9e32613 DG |
770 | Allows one to specify the full session daemon binary path to lttng command line |
771 | tool. You can also use \-\-sessiond-path option having the same effect. | |
6991b181 | 772 | .SH "SEE ALSO" |
6b8f2e64 DG |
773 | .BR babeltrace(1), |
774 | .BR lttng-ust(3), | |
775 | .BR lttng-sessiond(8), | |
776 | .BR lttng-relayd(8), | |
777 | .BR lttng-health-check(3) | |
6991b181 DG |
778 | .SH "BUGS" |
779 | ||
6991b181 | 780 | If you encounter any issues or usability problem, please report it on our |
6b8f2e64 DG |
781 | mailing list <lttng-dev@lists.lttng.org> to help improve this project or |
782 | at https://bugs.lttng.org which is a bugtracker. | |
6991b181 DG |
783 | .SH "CREDITS" |
784 | ||
785 | .PP | |
c9e32613 | 786 | lttng is distributed under the GNU General Public License version 2. See the file |
6991b181 DG |
787 | COPYING for details. |
788 | .PP | |
789 | A Web site is available at http://lttng.org for more information on the LTTng | |
790 | project. | |
791 | .PP | |
792 | You can also find our git tree at http://git.lttng.org. | |
793 | .PP | |
794 | Mailing lists for support and development: <lttng-dev@lists.lttng.org>. | |
795 | .PP | |
796 | You can find us on IRC server irc.oftc.net (OFTC) in #lttng. | |
797 | .PP | |
798 | .SH "THANKS" | |
799 | ||
800 | .PP | |
801 | Thanks to Yannick Brosseau without whom this project would never have been so | |
802 | lean and mean! Also thanks to the Ericsson teams working on tracing which | |
fa072eae | 803 | helped us greatly with detailed bug reports and unusual test cases. |
6991b181 DG |
804 | |
805 | Thanks to our beloved packager Alexandre Montplaisir-Goncalves (Ubuntu and PPA | |
806 | maintainer) and Jon Bernard for our Debian packages. | |
807 | ||
808 | Special thanks to Michel Dagenais and the DORSAL laboratory at Polytechnique de | |
809 | Montreal for the LTTng journey. | |
c9e32613 | 810 | .PP |
6991b181 DG |
811 | .SH "AUTHORS" |
812 | ||
813 | .PP | |
814 | lttng-tools was originally written by Mathieu Desnoyers, Julien Desfossez and | |
815 | David Goulet. More people have since contributed to it. It is currently | |
816 | maintained by David Goulet <dgoulet@efficios.com>. | |
817 | .PP |