update QUICKSTART
[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
9c78dc8f 16These operations are made for installing the LTTng 0.5.18 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)
9c78dc8f 188wget http://ltt.polymtl.ca/lttng/lttng-modules-0.5.tar.bz2
189wget http://ltt.polymtl.ca/lttng/patch-2.6.15-lttng-0.5.18.tar.bz2
190bzip2 -cd lttng-modules-0.5.tar.bz2 | tar xvof -
191bzip2 -cd patch-2.6.15-lttng-0.5.18.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
9c78dc8f 201cat /usr/src/lttng/patch-2.6.15-lttng-0.5.18* | patch -p1
d9cd3a2e 202cd ..
9c78dc8f 203mv linux-2.6.15 linux-2.6.15-lttng-0.5.18
d9cd3a2e 204
205
206* Installing a LTTng kernel
207
208su -
9c78dc8f 209cd /usr/src/linux-2.6.15-lttng-0.5.18
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
9c78dc8f 240 Select the Linux 2.6.15-lttng-0.5.18 kernel in your boot loader.
38e8e662 241
d9cd3a2e 242
243* Install the ltt-modules
244
245su -
9c78dc8f 246cd /usr/src/lttng/lttng-modules-0.5
247KERNELDIR=/usr/src/linux-2.6.15-lttng-0.5.18 make
248KERNELDIR=/usr/src/linux-2.6.15-lttng-0.5.18 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
9c78dc8f 271If you want to have complete information about the kernel state (including all
272the process names), you need to load the ltt-statedump module. This is done by
273issuing the command :
274
275modprobe ltt-statedump
276
38e8e662 277You can automate at boot time loading the ltt-control module by :
8ede3ed9 278
d9cd3a2e 279echo ltt-control >> /etc/modules
9c78dc8f 280echo ltt-statedump >> /etc/modules
d9cd3a2e 281
282
283* Getting and installing the LTTV package
284
285su -
286cd /usr/src
9c78dc8f 287wget http://ltt.polymtl.ca/packages/LinuxTraceToolkitViewer-0.8.13-07022006.tar.gz
288gzip -cd LinuxTraceToolkitViewer-0.8.13-07022006.tar.gz | tar xvof -
289cd LinuxTraceToolkitViewer-0.8.13-07022006
36fcd0b7 290(refer to README to see the development libraries that must be installed on you
291system)
d9cd3a2e 292./configure
293make
294make install
295
6c913994 296
297
298
299***********************************************************
d1f19ac5 300** Section 3 * Using LTTng and LTTV **
6c913994 301***********************************************************
302
d1f19ac5 303* Use graphical LTTV to control tracing and analyse traces
d9cd3a2e 304
305lttv-gui (or /usr/local/bin/lttv-gui)
e44b6048 306 - Spot the "Tracing Control" icon : click on it
307 (it's a traffic light icon)
d9cd3a2e 308 - enter the root password
309 - click "start"
310 - click "stop"
311 - Yes
312 * You should now see a trace
313
d1f19ac5 314* Use text mode LTTng to control tracing
315
5e5b1de1 316The tracing can be controlled from a terminal by using the lttctl command (as
317root).
d1f19ac5 318
319Start tracing :
320
29f07f68 321lttctl -n trace -d -l /mnt/relayfs/ltt -t /tmp/trace
d1f19ac5 322
323Stop tracing and destroy trace channels :
324
325lttctl -n trace -R
326
327see lttctl --help for details.
328
329
6c913994 330* Use text mode LTTV
331
332Fell free to look in /usr/local/lib/lttv/plugins to see all the text and
333graphical plugins available.
334
335For example, a simple trace dump in text format is available with :
336
337lttv -m textDump -t /tmp/trace
338
339see lttv -m textDump --help for detailed command line options of textDump.
340
341
342
343
344***********************************************************
345** Section 4 * Adding new instrumentations with genevent **
346***********************************************************
d9cd3a2e 347
348* Getting and installing genevent
349
cb598ad7 350su -
d9cd3a2e 351cd /usr/src
ff15f6a6 352wget http://ltt.polymtl.ca/packages/genevent-0.6.tar.gz
9c78dc8f 353gzip -cd genevent-0.8.tar.gz | tar xvof -
354cd genevent-0.8
d9cd3a2e 355make
356make install
357
358
359* Add new events to the kernel with genevent
360
361su -
362cd /usr/local/share/LinuxTraceToolkitViewer/facilities
363cp process.xml yourfacility.xml
364 * edit yourfacility.xml to fit your needs.
365cd /tmp
81685107 366/usr/local/bin/genevent /usr/local/share/LinuxTraceToolkitViewer/facilities/yourfacility.xml
d9cd3a2e 367cp ltt-facility-yourfacility.h ltt-facility-id-yourfacility.h \
9c78dc8f 368 /usr/src/linux-2.6.15-lttng-0.5.18/include/linux/ltt
d9cd3a2e 369cp ltt-facility-loader-yourfacility.c ltt-facility-loader-yourfacility.h \
9c78dc8f 370 /usr/src/linux-2.6.15-lttng-0.5.18/ltt
d9cd3a2e 371 * edit the kernel file you want to instrument
372 - Add #include <linux/ltt/ltt-facility-yourfacility.h> at the beginning
373 of the file.
374 - Add a call to the tracing functions. See their names and parameters in
9c78dc8f 375 /usr/src/linux-2.6.15-lttng-0.5.18/include/linux/ltt/ltt-facility-yourfacility.h
d9cd3a2e 376
377
378
This page took 0.04215 seconds and 4 git commands to generate.