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