4 How to use LTTng and LTTV in a few lines :
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.
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.
16 These operations are made for installing LTTng 0.2 on a linux 2.6.12-rc2-mm2
17 kernel. Change the versions to fit your needs.
19 Author : Mathieu Desnoyers, September 2005
23 ***********************************************************
24 ** Section 1 * Installation from Debian or RPM packages **
25 ***********************************************************
27 No Debian or RPM packages are ready yet.
32 ***********************************************************
33 ** Section 2 * Installation from sources **
34 ***********************************************************
36 * Getting the LTTng packages
41 (see http://ltt.polymtl.ca/lttng for package listing)
42 wget http://ltt.polymtl.ca/lttng/lttng-modules-0.2.tar.bz2
43 wget http://ltt.polymtl.ca/lttng/patch-2.6.12-rc4-mm2-lttng-0.3.bz2
44 bzip2 -cd lttng-modules-0.2.tar.bz2 | tar xvof -
47 * Getting LTTng kernel sources
51 wget http://kernel.org/pub/linux/kernel/v2.6/testing/linux-2.6.12-rc4.tar.bz2
52 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
53 bzip2 -cd linux-2.6.12-rc4.tar.bz2 | tar xvof -
55 bzip2 -cd ../2.6.12-rc4-mm2.bz2 | patch -p1
56 bzip2 -cd /usr/src/lttng/patch-2.6.12-rc4-mm2-lttng-0.3.bz2 | patch -p1
58 mv linux-2.6.12-rc4 linux-2.6.12-rc4-mm2-lttng-0.3
61 * Installing a LTTng kernel
64 cd /usr/src/linux-2.6.12-rc4-mm2-lttng-0.3
67 * Linux Trace Toolkit Instrumentation Support
68 M or * Linux Trace Toolkit Tracer
69 do NOT activate (not ready yet) :
70 Align Linux Trace Toolkit Traces
71 Activate Linux Trace Toolkit Heartbeat Timer
72 IMPORTANT : This is enabled by default : you must disable it!
77 Depending on your boot loader, you may want to execute :
83 * Install the ltt-modules
86 cd /usr/src/lttng/lttng-modules-0.2
87 KERNELDIR=/usr/src/linux-2.6.12-rc4-mm2-lttng-0.3 make
88 KERNELDIR=/usr/src/linux-2.6.12-rc4-mm2-lttng-0.3 make modules_install
90 note : at this stage, you might want to execute
93 and you might also want to do this :
94 echo ltt-control >> /etc/modules
97 * Getting and installing the LTTV package
101 wget http://ltt.polymtl.ca/packages/LinuxTraceToolkitViewer-0.5-16092005.tar.gz
102 gzip -cd LinuxTraceToolkitViewer-0.5-16092005.tar.gz | tar xvof -
103 cd LinuxTraceToolkitViewer-0.5-16092005
104 (refer to README to see the development libraries that must be installed on you
113 ***********************************************************
114 ** Section 3 * Using LTTV **
115 ***********************************************************
119 lttv-gui (or /usr/local/bin/lttv-gui)
120 - Spot the "Tracing Control" icon : click on it
121 (it's a traffic light icon)
122 - enter the root password
126 * You should now see a trace
130 Fell free to look in /usr/local/lib/lttv/plugins to see all the text and
131 graphical plugins available.
133 For example, a simple trace dump in text format is available with :
135 lttv -m textDump -t /tmp/trace
137 see lttv -m textDump --help for detailed command line options of textDump.
142 ***********************************************************
143 ** Section 4 * Adding new instrumentations with genevent **
144 ***********************************************************
146 * Getting and installing genevent
150 wget http://ltt.polymtl.ca/packages/genevent-0.1.tar.gz
151 gzip -cd genevent-0.1.tar.gz | tar xvof -
157 * Add new events to the kernel with genevent
160 cd /usr/local/share/LinuxTraceToolkitViewer/facilities
161 cp process.xml yourfacility.xml
162 * edit yourfacility.xml to fit your needs.
164 /usr/local/bin/genevent /usr/local/share/LinuxTraceToolkitViewer/yourfacility.xml
165 cp ltt-facility-yourfacility.h ltt-facility-id-yourfacility.h \
166 /usr/src/linux-2.6.12-rc4-mm2-lttng-0.3/include/linux/ltt
167 cp ltt-facility-loader-yourfacility.c ltt-facility-loader-yourfacility.h \
168 /usr/src/linux-2.6.12-rc4-mm2-lttng-0.3/ltt
169 * edit the kernel file you want to instrument
170 - Add #include <linux/ltt/ltt-facility-yourfacility.h> at the beginning
172 - Add a call to the tracing functions. See their names and parameters in
173 /usr/src/linux-2.6.12-rc4-mm2-lttng-0.3/include/linux/ltt/ltt-facility-yourfacility.h