Enable all events command enable also syscalls
[lttng-tools.git] / doc / quickstart.txt
CommitLineData
6f8eb304
DG
1NOTES:
2--------------
32011-07-21 : User-space tracer is not released. Tracing in user-space at this
4point is not possible with lttng-tools.
5
e7651054
DG
6QUICKSTART
7--------------
8
9This is a quick start guide for the complete LTTng tool chain. This is divided
6f8eb304 10in three sections respectively kernel tracing, user-space tracing and reading a
e7651054
DG
11trace.
12
13See the README file for installation procedure or use the various Linux
14distribution packages.
15
6f8eb304
DG
16In order to trace the kernel, you'll need the lttng-modules >= 2.0 compiled and
17installed. See http://lttng.org/lttng2.0 for more instructions for that part.
18For user-space tracing, you'll need an instrumented application, please see
19http://lttng.org/ust.
e7651054
DG
20
21lttng-tools provide a session daemon (ltt-sessiond) that acts as a tracing
22registry. To trace any instrumented applications or the kernel, a registered
6f8eb304
DG
23tracing session is needed beforehand. To interact with the session daemon and a
24tracing session, you should use the lttng command line UI (lttng).
e7651054 25
617d7d15 26Here is a list of some powerful features the LTTng 2.0 kernel tracer offers:
6f8eb304
DG
27
28 * Kprobes support
29 * Function Tracer support
30 * Context information support (add context data to an event)
31 * Perf counter support
617d7d15 32 * Tracepoint support
e7651054
DG
33
34The next sections explain how to do tracing :)
35
36Kernel Tracing
37--------------
38
b79f82bb
MD
39You can start the session daemon by invoking the command "ltt-sessiond",
40or let the lttng command line tool do it for you. The session daemon
41loads the LTTng tracer modules for you if those modules can be found on
42your system. If they are not found, the kernel tracing feature will be
43unavailable.
e7651054 44
495c67f5 45List available kernel events:
e7651054
DG
46
47# lttng list -k
48
491) Create a tracing session. A .lttngrc will be created in $HOME containing
50the session name (here 'mysession') you are working on.
51
52# lttng create mysession
53
6f8eb304
DG
54If you have multiple sessions, you can change the current session by using
55
56# lttng set-session myothersession
57
4bc385dd
MD
582) Enable tracepoint event(s). Here for example, we want only
59'sched_switch' and 'sched_wakeup' events for the kernel (-k/--kernel).
e7651054 60
4bc385dd 61# lttng enable-event sched_switch,sched_wakeup -k
e7651054 62
4bc385dd 63or enable ALL tracepoint events (-a/--all):
e7651054
DG
64
65# lttng enable-event -a -k
66
4bc385dd
MD
673) Enable all system call event(s).
68
69# lttng enable-event -a -k --syscall
70
714) Enable kprobes and/or the function tracer with lttng
6f8eb304
DG
72
73This is a new feature made possible by the new LTTng 2.0 kernel tracer. You can
617d7d15
MD
74enable a dynamic probe and data will be output in the trace along side with
75your tracing data.
6f8eb304 76
975fdf53 77# lttng enable-event aname -k --probe symbol+0xffff7260695
6f8eb304
DG
78
79or
80
975fdf53 81# lttng enable-event aname -k --probe 0xffff7260695
6f8eb304 82
617d7d15 83Either an <address> or a <symbol+offset> can be used for probes.
6f8eb304 84
617d7d15 85You can also enable function tracer, which uses the Ftrace API (by Steven
6f8eb304
DG
86Rostedt). Again, data will be output in the trace.
87
975fdf53 88# lttng enable-event aname -k --function <symbol_name>
6f8eb304 89
4bc385dd 905) Enable context information for an event:
6f8eb304
DG
91
92This is also a new feature which allows you to add context information to an
93event. For example, you can add the PID along with the event information:
94
617d7d15 95# lttng add-context -k -e sched_switch -t pid
6f8eb304
DG
96
97At this point, you will have to look at 'lttng add-context --help' for all
98possible context type which are integer values.
99
100You can on the same line activate multiple context:
101
617d7d15 102# lttng add-context -k -e sched_switch -t pid -t nice -t tid
6f8eb304 103
4bc385dd 1046) Enable perf counter for an event:
6f8eb304
DG
105
106Again, a new powerful feature is the possibility to add perf counter data
90b9a268 107(using the perf API by Ingo Molnar and Thomas Gleixner) to the trace on a per
617d7d15 108event basis. Let say we want to get the CPU cycles at each event:
6f8eb304 109
617d7d15 110# lttng add-context -k -e sched_switch -t perf:cpu-cycles
6f8eb304
DG
111
112You'll have to use the add-context help for all possible perf counter values.
113
4bc385dd 1147) Start tracing:
e7651054
DG
115
116# lttng start
117
6f8eb304 118Tracing is in progress at this point and traces will be written in
e7651054
DG
119$HOME/lttng-traces/mysession-<date>-<time>
120
4bc385dd 1218) Stop tracing:
e7651054
DG
122
123# lttng stop
124
6f8eb304
DG
125Note: At this point, you can restart the trace (lttng start), enable/disable
126events or just go take a break and come back 3 days later to start it again :).
127
4bc385dd 1289) Destroy your session after you are done with tracing
e7651054
DG
129
130# lttng destroy
131
6f8eb304
DG
132See Reading a trace section below to read you trace(s).
133
e7651054
DG
134User-space Tracing
135--------------
136
1aa502dd
MD
137User-space tracer 2.0 not released at this point. For the 0.x versions,
138you need to use 'ustctl' to control user-space tracing.
e7651054
DG
139
140Reading a trace
141--------------
142
b79f82bb
MD
143The tool "Babeltrace" can be used to dump your binary trace into a
144human-readable text format. Please see
145http://www.efficios.com/babeltrace and git tree
e7651054
DG
146http://git.efficios.com/?p=babeltrace.git
147
148# babeltrace -n $HOME/lttng-traces/mysession-<date>-<time> | less
149
150VoilĂ !
6f8eb304
DG
151
152Please report any bugs/comments on our mailing list
153(ltt-dev@lists.casi.polymtl.ca) or you can go on our IRC channel at
154irc.oftc.net, channel #lttng
This page took 0.033235 seconds and 5 git commands to generate.