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