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