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