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