4 How to use LTTng and LTTV in a few lines :
6 These operations are made for installing LTTng 0.2 on a linux 2.6.12-rc2-mm2
7 kernel. Change the versions to fit your needs.
9 Author : Mathieu Desnoyers, September 2005
12 * Getting the LTTng packages
17 (see http://ltt.polymtl.ca/lttng for package listing)
18 wget http://ltt.polymtl.ca/lttng/lttng-modules-0.2.tar.bz2
19 wget http://ltt.polymtl.ca/lttng/patch-2.6.12-rc4-mm2-lttng-0.2.bz2
20 bzip2 -cd lttng-modules-0.2.tar.bz2 | tar xvof -
23 * Getting LTTng kernel sources
27 wget http://kernel.org/pub/linux/kernel/v2.6/testing/linux-2.6.12-rc4.tar.bz2
28 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
29 bzip2 -cd linux-2.6.12-rc4.tar.bz2 | tar xvof -
31 bzip2 -cd ../2.6.12-rc4-mm2.bz2 | patch -p1
32 bzip2 -cd /usr/src/lttng/patch-2.6.12-rc4-mm2-lttng-0.2.bz2 | patch -p1
34 mv linux-2.6.12-rc4 linux-2.6.12-rc4-mm2-lttng-0.2
37 * Installing a LTTng kernel
40 cd /usr/src/linux-2.6.12-rc4-mm2-lttng-0.2
43 * Linux Trace Toolkit Instrumentation Support
44 M or * Linux Trace Toolkit Tracer
45 do NOT activate (not ready yet) :
46 Align Linux Trace Toolkit Traces
47 Activate Linux Trace Toolkit Heartbeat Timer
48 IMPORTANT : This is enabled by default : you must disable it!
53 * Install the ltt-modules
56 cd /usr/src/lttng/lttng-modules-0.2
57 KERNELDIR=/usr/src/linux-2.6.12-rc4-mm2-lttng-0.2 make
58 KERNELDIR=/usr/src/linux-2.6.12-rc4-mm2-lttng-0.2 make modules_install
60 note : at this stage, you might want to execute
63 and you might also want to do this :
64 echo ltt-control >> /etc/modules
67 * Getting and installing the LTTV package
71 wget http://ltt.polymtl.ca/packages/LinuxTraceToolkitViewer-0.5-16092005.tar.gz
72 gzip -cd LinuxTraceToolkitViewer-0.5-16092005.tar.gz | tar xvof -
73 cd LinuxTraceToolkitViewer-0.5-16092005
80 lttv-gui (or /usr/local/bin/lttv-gui)
81 - Spot the "Trace Control" icon : click on it
82 - enter the root password
86 * You should now see a trace
89 * Getting and installing genevent
93 wget http://ltt.polymtl.ca/packages/genevent-0.1.tar.gz
94 gzip -cd genevent-0.1.tar.gz | tar xvof -
100 * Add new events to the kernel with genevent
103 cd /usr/local/share/LinuxTraceToolkitViewer/facilities
104 cp process.xml yourfacility.xml
105 * edit yourfacility.xml to fit your needs.
107 /usr/local/bin/genevent /usr/local/share/LinuxTraceToolkitViewer/yourfacility.xml
108 cp ltt-facility-yourfacility.h ltt-facility-id-yourfacility.h \
109 /usr/src/linux-2.6.12-rc4-mm2-lttng-0.2/include/linux/ltt
110 cp ltt-facility-loader-yourfacility.c ltt-facility-loader-yourfacility.h \
111 /usr/src/linux-2.6.12-rc4-mm2-lttng-0.2/ltt
112 * edit the kernel file you want to instrument
113 - Add #include <linux/ltt/ltt-facility-yourfacility.h> at the beginning
115 - Add a call to the tracing functions. See their names and parameters in
116 /usr/src/linux-2.6.12-rc4-mm2-lttng-0.2/include/linux/ltt/ltt-facility-yourfacility.h