lttv 0.8.13
[lttv.git] / ltt / branches / poly / QUICKSTART
... / ...
CommitLineData
1
2QUICKSTART
3
4How to use LTTng and LTTV in a few lines :
5
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
16These operations are made for installing the LTTng 0.5.6 tracer on a
17linux 2.6.15 kernel. You will also find instructions for installation of
18LTTV 0.8.x : the Linux Trace Toolkit Viewer.
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
27
28** Current development status **
29
30LTTng :
31supported architectures :
32Intel Pentium (UP/SMP) with TSC
33
34LTTV :
35supported architectures :
36Intel i386 and better
37Intel 64 bits
38PowerPC
39
40
41
42Author : Mathieu Desnoyers, September 2005
43Last update : January 10, 2006
44
45
46***********************************************************
47** Section 1 * Installation from Debian or RPM packages **
48***********************************************************
49
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
55* Install from RPM packages on Fedora Core 4 :
56
57Get LTTV RPM from :
58
59http://ltt.polymtl.ca/packages/fedora/RPMS
60
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.
66
67
68* Install from Deb packages on Debian :
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
77
78* Install from precompiled binary packages (LTTV compiled only for i386, and
79 LTTng only for i686 smp), perform the following :
80
81su -
82apt-get update
83apt-get install lttv lttv-doc
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
86 * note : the packages are signed by myself. I am not considered a trusted
87 Debian source yet, so warnings are normal.
88
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 :
95
96su -
97cd /usr/src
98apt-get source lttv
99cd lttv-0.6.9
100dpkg-buildpackage -rfakeroot
101
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 -
109apt-get install kernel-source-2.6.12-rc4-mm2-lttng-0.4.2
110cd /usr/src
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
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
124cd kernel-source-2.6.12-rc4-mm2-lttng-0.4.2
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
130
131Then, follow the section "Editing the system wide configuration" in section 2.
132
133
134***********************************************************
135** Section 2 * Installation from sources **
136***********************************************************
137
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
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)
180
181
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)
188wget http://ltt.polymtl.ca/lttng/lttng-modules-0.4.tar.bz2
189wget http://ltt.polymtl.ca/lttng/patch-2.6.15-lttng-0.5.6.tar.bz2
190bzip2 -cd lttng-modules-0.4.tar.bz2 | tar xvof -
191bzip2 -cd patch-2.6.15-lttng-0.5.6.tar.bz2 | tar xvof -
192
193
194* Getting LTTng kernel sources
195
196su -
197cd /usr/src
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
201cat /usr/src/lttng/patch-2.6.15-lttng-0.5.6* | patch -p1
202cd ..
203mv linux-2.6.15 linux-2.6.15-lttng-0.5.6
204
205
206* Installing a LTTng kernel
207
208su -
209cd /usr/src/linux-2.6.15-lttng-0.5.6
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.
216 go to the "Instrumentation Support" section
217 Select the following options :
218 [*] Linux Trace Toolkit Instrumentation Support
219 <M> or <*> Linux Trace Toolkit Tracer
220 It makes no difference for the rest of the procedure whether the Tracer
221 is compiled built-in or as a module.
222 activate :
223 [*] Align Linux Trace Toolkit Traces
224 do NOT activate (not ready yet) :
225 [ ] Activate Linux Trace Toolkit Heartbeat Timer
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.
231 Select <Exit>
232 Select <Exit>
233 Select <Yes>
234make
235make modules_install
236make install
237
238reboot
239
240 Select the Linux 2.6.15-lttng-0.5.6 kernel in your boot loader.
241
242
243* Install the ltt-modules
244
245su -
246cd /usr/src/lttng/lttng-modules-0.4
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
249
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
266You need to load the ltt-control module to be able to control tracing from user
267space. This is done by issuing the command :
268
269modprobe ltt-control
270
271You can automate at boot time loading the ltt-control module by :
272
273echo ltt-control >> /etc/modules
274
275
276* Getting and installing the LTTV package
277
278su -
279cd /usr/src
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
283(refer to README to see the development libraries that must be installed on you
284system)
285./configure
286make
287make install
288
289
290
291
292***********************************************************
293** Section 3 * Using LTTng and LTTV **
294***********************************************************
295
296* Use graphical LTTV to control tracing and analyse traces
297
298lttv-gui (or /usr/local/bin/lttv-gui)
299 - Spot the "Tracing Control" icon : click on it
300 (it's a traffic light icon)
301 - enter the root password
302 - click "start"
303 - click "stop"
304 - Yes
305 * You should now see a trace
306
307* Use text mode LTTng to control tracing
308
309The tracing can be controlled from a terminal by using the lttctl command (as
310root).
311
312Start tracing :
313
314lttctl -n trace -d -l /mnt/relayfs/ltt -t /tmp/trace
315
316Stop tracing and destroy trace channels :
317
318lttctl -n trace -R
319
320see lttctl --help for details.
321
322
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***********************************************************
340
341* Getting and installing genevent
342
343su -
344cd /usr/src
345wget http://ltt.polymtl.ca/packages/genevent-0.6.tar.gz
346gzip -cd genevent-0.6.tar.gz | tar xvof -
347cd genevent-0.6
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
359/usr/local/bin/genevent /usr/local/share/LinuxTraceToolkitViewer/facilities/yourfacility.xml
360cp ltt-facility-yourfacility.h ltt-facility-id-yourfacility.h \
361 /usr/src/linux-2.6.15-lttng-0.5.6/include/linux/ltt
362cp ltt-facility-loader-yourfacility.c ltt-facility-loader-yourfacility.h \
363 /usr/src/linux-2.6.15-lttng-0.5.6/ltt
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
368 /usr/src/linux-2.6.15-lttng-0.5.6/include/linux/ltt/ltt-facility-yourfacility.h
369
370
371
This page took 0.023366 seconds and 4 git commands to generate.