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