michel comments
[lttv.git] / ltt / branches / poly / QUICKSTART
CommitLineData
d9cd3a2e 1
2QUICKSTART
3
4How to use LTTng and LTTV in a few lines :
5
6c913994 6This document is made of four parts : The first one explains how to install
7LTTng and LTTV from Debian and RPM binary packages, the second one explains how
8to install LTTng and LTTV from sources and the third one describes the steps
9to follow to trace a system and view it. The fourth and last part explains
10briefly how to add a new trace point to the kernel.
11
12What you will typically want is to read sections 1 and 3 : install LTTng from
13binary packages and use it. If there are no packages ready for your system, you
14will have to install from sources (section 2) instead.
15
38e8e662 16These operations are made for installing the LTTng 0.4 tracer on a
17linux 2.6.12-rc4-mm2 kernel. You will also find instructions for installtion of
18LTTV 0.6.x : the Linux Trace Toolkit Viewer.
19
20At this point, the -mm tree of the kernel is used because it has RelayFS support
21in it. In a nearby future, a vanilla kernel 2.6.14 will be used, as RelayFS has
22been integrated in the linux 2.6.14-rc series.
23
24The following lttng patch is necessary to have the tracing hooks in the kernel.
25The following ltt-control module controls the tracing.
26
27Required programs and librairies are assumed to be automatically installed in an
28installation with Debian or RPM packages. In the case of an installation from
29sources, the dependencies are listed.
30
d9cd3a2e 31
af88bd8a 32Author : Mathieu Desnoyers, September 2005
33
d9cd3a2e 34
6c913994 35
36***********************************************************
37** Section 1 * Installation from Debian or RPM packages **
38***********************************************************
39
40No Debian or RPM packages are ready yet.
41
42TODO
43
44
45***********************************************************
46** Section 2 * Installation from sources **
47***********************************************************
48
38e8e662 49* Prerequisites
50
51Tools needed to follow the package download steps :
52
53o wget
54o bzip2
55o gzip
56o tar
57
58You have to install the standard development librairies and programs necessary
59to compile a kernel :
60
61(from Documentation/Changes in the Linux kernel tree)
62o Gnu C 2.95.3 # gcc --version
63o Gnu make 3.79.1 # make --version
64o binutils 2.12 # ld -v
65o util-linux 2.10o # fdformat --version
66o module-init-tools 0.9.10 # depmod -V
67
68You might also want to have libncurses5 to have the text mode kernel
69configuration menu, but there are alternatives.
70
71Prerequisites for LTTV 0.6.x installation are :
72
73gtk 2.4 or better development libraries (libgtk2.0, libgtk2.0-dev)
74glib 2.4 or better development libraries (libglib2.0-0, libglib2.0-dev)
75libpopt development libraries (libpopt0, libpopt-dev)
76libpango development libraries (libpango1.0, libpango1.0-dev)
77libc6 development librairies (libc6, libc6-dev)
78
79
d9cd3a2e 80* Getting the LTTng packages
81
82su -
83mkdir /usr/src/lttng
84cd /usr/src/lttng
85(see http://ltt.polymtl.ca/lttng for package listing)
8ede3ed9 86wget http://ltt.polymtl.ca/lttng/lttng-modules-0.3.tar.bz2
0717223e 87wget http://ltt.polymtl.ca/lttng/patch-2.6.12-rc4-mm2-lttng-0.4.bz2
8ede3ed9 88bzip2 -cd lttng-modules-0.3.tar.bz2 | tar xvof -
d9cd3a2e 89
90
91* Getting LTTng kernel sources
92
93su -
94cd /usr/src
95wget http://kernel.org/pub/linux/kernel/v2.6/testing/linux-2.6.12-rc4.tar.bz2
96wget http://kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.12-rc4/2.6.12-rc4-mm2/2.6.12-rc4-mm2.bz2
97bzip2 -cd linux-2.6.12-rc4.tar.bz2 | tar xvof -
98cd linux-2.6.12-rc4
99bzip2 -cd ../2.6.12-rc4-mm2.bz2 | patch -p1
0717223e 100bzip2 -cd /usr/src/lttng/patch-2.6.12-rc4-mm2-lttng-0.4.bz2 | patch -p1
d9cd3a2e 101cd ..
0717223e 102mv linux-2.6.12-rc4 linux-2.6.12-rc4-mm2-lttng-0.4
d9cd3a2e 103
104
105* Installing a LTTng kernel
106
107su -
0717223e 108cd /usr/src/linux-2.6.12-rc4-mm2-lttng-0.4
38e8e662 109make menuconfig (or make xconfig or make config)
110 Select the < Help > button if you are not familiar with kernel
111 configuration.
112 Items preceded by [*] means they has to be built into the kernel.
113 Items preceded by [M] means they has to be built as modules.
114 Items preceded by [ ] means they should be removed.
115 go to the "General setup" section
116 Select the following options :
117 [*] Linux Trace Toolkit Instrumentation Support
118 [M] or [*] Linux Trace Toolkit Tracer
8ede3ed9 119 It makes no difference for the rest of the procedure whether the Tracer
120 is compiled built-in or as a module.
d9cd3a2e 121 do NOT activate (not ready yet) :
38e8e662 122 [ ] Align Linux Trace Toolkit Traces
123 [ ] Activate Linux Trace Toolkit Heartbeat Timer
7bfce92a 124 IMPORTANT : This is enabled by default : you must disable it!
38e8e662 125 Select <Exit>
126 Select <Exit>
127 Select <Yes>
02bc6879 128make
26d45a39 129make modules_install
8ede3ed9 130make install
916ec268 131
38e8e662 132You must activate relayfs and specify a mount point. This is typically done in
133fstab such that it happens at boot time.
134
135If you have never used RelayFS before, these operation would do this for you :
8ede3ed9 136
e8e288b8 137mkdir /mnt/relayfs
8ede3ed9 138cp /etc/fstab /etc/fstab.lttng.bkp
139echo "relayfs /mnt/relayfs relayfs rw 0 0" >> /etc/fstab
e8e288b8 140
d9cd3a2e 141reboot
142
38e8e662 143 Select the Linux 2.6.12-rc4-mm2-lttng-0.4 kernel in your boot loader.
144
d9cd3a2e 145
146* Install the ltt-modules
147
148su -
8ede3ed9 149cd /usr/src/lttng/lttng-modules-0.3
0717223e 150KERNELDIR=/usr/src/linux-2.6.12-rc4-mm2-lttng-0.4 make
151KERNELDIR=/usr/src/linux-2.6.12-rc4-mm2-lttng-0.4 make modules_install
d9cd3a2e 152
38e8e662 153You need to load the ltt-control module to be able to control tracing from user
154space. This is done by issuing the command :
8ede3ed9 155
d9cd3a2e 156modprobe ltt-control
157
38e8e662 158You can automate at boot time loading the ltt-control module by :
8ede3ed9 159
d9cd3a2e 160echo ltt-control >> /etc/modules
161
162
163* Getting and installing the LTTV package
164
165su -
166cd /usr/src
6d898ec5 167wget http://ltt.polymtl.ca/packages/LinuxTraceToolkitViewer-0.6.5-21092005.tar.gz
168gzip -cd LinuxTraceToolkitViewer-0.6.5-21092005.tar.gz | tar xvof -
169cd LinuxTraceToolkitViewer-0.6.5-21092005
36fcd0b7 170(refer to README to see the development libraries that must be installed on you
171system)
d9cd3a2e 172./configure
173make
174make install
175
6c913994 176
177
178
179***********************************************************
d1f19ac5 180** Section 3 * Using LTTng and LTTV **
6c913994 181***********************************************************
182
d1f19ac5 183* Use graphical LTTV to control tracing and analyse traces
d9cd3a2e 184
185lttv-gui (or /usr/local/bin/lttv-gui)
e44b6048 186 - Spot the "Tracing Control" icon : click on it
187 (it's a traffic light icon)
d9cd3a2e 188 - enter the root password
189 - click "start"
190 - click "stop"
191 - Yes
192 * You should now see a trace
193
d1f19ac5 194* Use text mode LTTng to control tracing
195
5e5b1de1 196The tracing can be controlled from a terminal by using the lttctl command (as
197root).
d1f19ac5 198
199Start tracing :
200
29f07f68 201lttctl -n trace -d -l /mnt/relayfs/ltt -t /tmp/trace
d1f19ac5 202
203Stop tracing and destroy trace channels :
204
205lttctl -n trace -R
206
207see lttctl --help for details.
208
209
6c913994 210* Use text mode LTTV
211
212Fell free to look in /usr/local/lib/lttv/plugins to see all the text and
213graphical plugins available.
214
215For example, a simple trace dump in text format is available with :
216
217lttv -m textDump -t /tmp/trace
218
219see lttv -m textDump --help for detailed command line options of textDump.
220
221
222
223
224***********************************************************
225** Section 4 * Adding new instrumentations with genevent **
226***********************************************************
d9cd3a2e 227
228* Getting and installing genevent
229
cb598ad7 230su -
d9cd3a2e 231cd /usr/src
e7e20d44 232wget http://ltt.polymtl.ca/packages/genevent-0.2.tar.gz
233gzip -cd genevent-0.2.tar.gz | tar xvof -
234cd genevent-0.2
d9cd3a2e 235make
236make install
237
238
239* Add new events to the kernel with genevent
240
241su -
242cd /usr/local/share/LinuxTraceToolkitViewer/facilities
243cp process.xml yourfacility.xml
244 * edit yourfacility.xml to fit your needs.
245cd /tmp
246/usr/local/bin/genevent /usr/local/share/LinuxTraceToolkitViewer/yourfacility.xml
247cp ltt-facility-yourfacility.h ltt-facility-id-yourfacility.h \
0717223e 248 /usr/src/linux-2.6.12-rc4-mm2-lttng-0.4/include/linux/ltt
d9cd3a2e 249cp ltt-facility-loader-yourfacility.c ltt-facility-loader-yourfacility.h \
0717223e 250 /usr/src/linux-2.6.12-rc4-mm2-lttng-0.4/ltt
d9cd3a2e 251 * edit the kernel file you want to instrument
252 - Add #include <linux/ltt/ltt-facility-yourfacility.h> at the beginning
253 of the file.
254 - Add a call to the tracing functions. See their names and parameters in
0717223e 255 /usr/src/linux-2.6.12-rc4-mm2-lttng-0.4/include/linux/ltt/ltt-facility-yourfacility.h
d9cd3a2e 256
257
258
This page took 0.033171 seconds and 4 git commands to generate.