supported arch
[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
f221c98e 16These operations are made for installing the LTTng 0.4.1 tracer on a
38e8e662 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
c96be0d0 32** Current development status **
33
34LTTng :
35supported architectures :
36Intel Pentium (UP/SMP) with TSC
37
38LTTV :
39supported architectures :
40Intel i386 and better
41PowerPC
42
43
44
af88bd8a 45Author : Mathieu Desnoyers, September 2005
46
d9cd3a2e 47
6c913994 48
49***********************************************************
50** Section 1 * Installation from Debian or RPM packages **
51***********************************************************
52
6a2c1aed 53No RPM packages are ready yet.
54No Debian kernel LTTng patch is ready yet.
55
56You can use the ltt.polymtl.ca apt source to get LTTV for Debian :
57
58Add the following two sources to your /etc/apt/sources.list :
59
60deb http://ltt.polymtl.ca/packages/debian experimental main
61deb-src http://ltt.polymtl.ca/packages/debian experimental main
62
5694ce4d 63
64* Install from precompiled binary packages (LTTV compiled only for i386, and
65 LTTng only for i686 smp), perform the following :
6a2c1aed 66
67su -
68apt-get update
69apt-get install lttv lttv-doc
5694ce4d 70apt-get install kernel-image-2.6.12-rc4-mm2-lttng-0.4.1
71apt-get install lttng-modules-modules-2.6.12-rc4-mm2-lttng-0.4.1
6a2c1aed 72 * note : the packages are signed by myself. I am not considered a trusted
73 Debian source yet, so warnings are normal.
74
5694ce4d 75Then, follow the section "Editing the system wide configuration" in section 2.
76
77* Create custom LTTV Debian packages
78
79Binary packages are only available for i386. If you want to create your own LTTV
80packages for other platforms, do :
6a2c1aed 81
5694ce4d 82su -
83cd /usr/src
78d521e3 84apt-get source lttv
85cd lttv-0.6.7
86dpkg-buildpackage -rfakeroot
87
5694ce4d 88You should then have your LTTV .deb files created for your architecture.
89
90* Create custom LTTng packages
91
92For building LTTng Debian packages :
93
94su -
95apt-get install kernel-source-2.6.12-rc4-mm2-lttng-0.4.1
96cd /usr/src
97bzip2 -cd kernel-source-2.6.12-rc4-mm2-lttng-0.4.1.tar.bz2 | tar xvof -
98cd kernel-source-2.6.12-rc4-mm2-lttng-0.4.1
99make menuconfig (or xconfig or config) (customize your configuration)
100make-kpkg kernel_image
101
102You will then see your freshly created .deb in /usr/src. Install it with
103dpkg -i /usr/src/(image-name).deb
104
105You will also need to create a package for the lttng-modules :
106
107su -
108cd /usr/src
109apt-get source lttng-modules
110cd kernel-source-2.6.12-rc4-mm2-lttng-0.4.1
111make-kpkg --added_modules /usr/src/lttng-modules-0.3 modules_image
112
113You will then see your freshly created .deb in /usr/src. Install it with
114dpkg -i /usr/src/lttng-modules-modules-(your version).deb
115
6c913994 116
5694ce4d 117Then, follow the section "Editing the system wide configuration" in section 2.
6c913994 118
119
120***********************************************************
121** Section 2 * Installation from sources **
122***********************************************************
123
38e8e662 124* Prerequisites
125
126Tools needed to follow the package download steps :
127
128o wget
129o bzip2
130o gzip
131o tar
132
133You have to install the standard development librairies and programs necessary
134to compile a kernel :
135
136(from Documentation/Changes in the Linux kernel tree)
137o Gnu C 2.95.3 # gcc --version
138o Gnu make 3.79.1 # make --version
139o binutils 2.12 # ld -v
140o util-linux 2.10o # fdformat --version
141o module-init-tools 0.9.10 # depmod -V
142
143You might also want to have libncurses5 to have the text mode kernel
144configuration menu, but there are alternatives.
145
146Prerequisites for LTTV 0.6.x installation are :
147
148gtk 2.4 or better development libraries (libgtk2.0, libgtk2.0-dev)
149glib 2.4 or better development libraries (libglib2.0-0, libglib2.0-dev)
150libpopt development libraries (libpopt0, libpopt-dev)
151libpango development libraries (libpango1.0, libpango1.0-dev)
152libc6 development librairies (libc6, libc6-dev)
153
154
d9cd3a2e 155* Getting the LTTng packages
156
157su -
158mkdir /usr/src/lttng
159cd /usr/src/lttng
160(see http://ltt.polymtl.ca/lttng for package listing)
8ede3ed9 161wget http://ltt.polymtl.ca/lttng/lttng-modules-0.3.tar.bz2
f221c98e 162wget http://ltt.polymtl.ca/lttng/patch-2.6.12-rc4-mm2-lttng-0.4.1.bz2
8ede3ed9 163bzip2 -cd lttng-modules-0.3.tar.bz2 | tar xvof -
d9cd3a2e 164
165
166* Getting LTTng kernel sources
167
168su -
169cd /usr/src
170wget http://kernel.org/pub/linux/kernel/v2.6/testing/linux-2.6.12-rc4.tar.bz2
171wget 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
172bzip2 -cd linux-2.6.12-rc4.tar.bz2 | tar xvof -
173cd linux-2.6.12-rc4
174bzip2 -cd ../2.6.12-rc4-mm2.bz2 | patch -p1
f221c98e 175bzip2 -cd /usr/src/lttng/patch-2.6.12-rc4-mm2-lttng-0.4.1.bz2 | patch -p1
d9cd3a2e 176cd ..
f221c98e 177mv linux-2.6.12-rc4 linux-2.6.12-rc4-mm2-lttng-0.4.1
d9cd3a2e 178
179
180* Installing a LTTng kernel
181
182su -
f221c98e 183cd /usr/src/linux-2.6.12-rc4-mm2-lttng-0.4.1
38e8e662 184make menuconfig (or make xconfig or make config)
185 Select the < Help > button if you are not familiar with kernel
186 configuration.
187 Items preceded by [*] means they has to be built into the kernel.
188 Items preceded by [M] means they has to be built as modules.
189 Items preceded by [ ] means they should be removed.
190 go to the "General setup" section
191 Select the following options :
192 [*] Linux Trace Toolkit Instrumentation Support
193 [M] or [*] Linux Trace Toolkit Tracer
8ede3ed9 194 It makes no difference for the rest of the procedure whether the Tracer
195 is compiled built-in or as a module.
d9cd3a2e 196 do NOT activate (not ready yet) :
38e8e662 197 [ ] Align Linux Trace Toolkit Traces
198 [ ] Activate Linux Trace Toolkit Heartbeat Timer
7bfce92a 199 IMPORTANT : This is enabled by default : you must disable it!
38e8e662 200 Select <Exit>
201 Select <Exit>
202 Select <Yes>
02bc6879 203make
26d45a39 204make modules_install
8ede3ed9 205make install
916ec268 206
d9cd3a2e 207reboot
208
f221c98e 209 Select the Linux 2.6.12-rc4-mm2-lttng-0.4.1 kernel in your boot loader.
38e8e662 210
d9cd3a2e 211
212* Install the ltt-modules
213
214su -
8ede3ed9 215cd /usr/src/lttng/lttng-modules-0.3
f221c98e 216KERNELDIR=/usr/src/linux-2.6.12-rc4-mm2-lttng-0.4.1 make
217KERNELDIR=/usr/src/linux-2.6.12-rc4-mm2-lttng-0.4.1 make modules_install
d9cd3a2e 218
5694ce4d 219
220* Editing the system wide configuration
221
222You must activate relayfs and specify a mount point. This is typically done in
223fstab such that it happens at boot time.
224
225If you have never used RelayFS before, these operation would do this for you :
226
227mkdir /mnt/relayfs
228cp /etc/fstab /etc/fstab.lttng.bkp
229echo "relayfs /mnt/relayfs relayfs rw 0 0" >> /etc/fstab
230
231then, rebooting or issuing the following command will activate relayfs :
232
233mount /mnt/relayfs
234
38e8e662 235You need to load the ltt-control module to be able to control tracing from user
236space. This is done by issuing the command :
8ede3ed9 237
d9cd3a2e 238modprobe ltt-control
239
38e8e662 240You can automate at boot time loading the ltt-control module by :
8ede3ed9 241
d9cd3a2e 242echo ltt-control >> /etc/modules
243
244
245* Getting and installing the LTTV package
246
247su -
248cd /usr/src
6d898ec5 249wget http://ltt.polymtl.ca/packages/LinuxTraceToolkitViewer-0.6.5-21092005.tar.gz
250gzip -cd LinuxTraceToolkitViewer-0.6.5-21092005.tar.gz | tar xvof -
251cd LinuxTraceToolkitViewer-0.6.5-21092005
36fcd0b7 252(refer to README to see the development libraries that must be installed on you
253system)
d9cd3a2e 254./configure
255make
256make install
257
6c913994 258
259
260
261***********************************************************
d1f19ac5 262** Section 3 * Using LTTng and LTTV **
6c913994 263***********************************************************
264
d1f19ac5 265* Use graphical LTTV to control tracing and analyse traces
d9cd3a2e 266
267lttv-gui (or /usr/local/bin/lttv-gui)
e44b6048 268 - Spot the "Tracing Control" icon : click on it
269 (it's a traffic light icon)
d9cd3a2e 270 - enter the root password
271 - click "start"
272 - click "stop"
273 - Yes
274 * You should now see a trace
275
d1f19ac5 276* Use text mode LTTng to control tracing
277
5e5b1de1 278The tracing can be controlled from a terminal by using the lttctl command (as
279root).
d1f19ac5 280
281Start tracing :
282
29f07f68 283lttctl -n trace -d -l /mnt/relayfs/ltt -t /tmp/trace
d1f19ac5 284
285Stop tracing and destroy trace channels :
286
287lttctl -n trace -R
288
289see lttctl --help for details.
290
291
6c913994 292* Use text mode LTTV
293
294Fell free to look in /usr/local/lib/lttv/plugins to see all the text and
295graphical plugins available.
296
297For example, a simple trace dump in text format is available with :
298
299lttv -m textDump -t /tmp/trace
300
301see lttv -m textDump --help for detailed command line options of textDump.
302
303
304
305
306***********************************************************
307** Section 4 * Adding new instrumentations with genevent **
308***********************************************************
d9cd3a2e 309
310* Getting and installing genevent
311
cb598ad7 312su -
d9cd3a2e 313cd /usr/src
e7e20d44 314wget http://ltt.polymtl.ca/packages/genevent-0.2.tar.gz
315gzip -cd genevent-0.2.tar.gz | tar xvof -
316cd genevent-0.2
d9cd3a2e 317make
318make install
319
320
321* Add new events to the kernel with genevent
322
323su -
324cd /usr/local/share/LinuxTraceToolkitViewer/facilities
325cp process.xml yourfacility.xml
326 * edit yourfacility.xml to fit your needs.
327cd /tmp
328/usr/local/bin/genevent /usr/local/share/LinuxTraceToolkitViewer/yourfacility.xml
329cp ltt-facility-yourfacility.h ltt-facility-id-yourfacility.h \
f221c98e 330 /usr/src/linux-2.6.12-rc4-mm2-lttng-0.4.1/include/linux/ltt
d9cd3a2e 331cp ltt-facility-loader-yourfacility.c ltt-facility-loader-yourfacility.h \
f221c98e 332 /usr/src/linux-2.6.12-rc4-mm2-lttng-0.4.1/ltt
d9cd3a2e 333 * edit the kernel file you want to instrument
334 - Add #include <linux/ltt/ltt-facility-yourfacility.h> at the beginning
335 of the file.
336 - Add a call to the tracing functions. See their names and parameters in
f221c98e 337 /usr/src/linux-2.6.12-rc4-mm2-lttng-0.4.1/include/linux/ltt/ltt-facility-yourfacility.h
d9cd3a2e 338
339
340
This page took 0.036525 seconds and 4 git commands to generate.