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