d9cd3a2e |
1 | |
2 | QUICKSTART |
3 | |
4 | How to use LTTng and LTTV in a few lines : |
5 | |
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. |
8 | |
af88bd8a |
9 | Author : Mathieu Desnoyers, September 2005 |
10 | |
d9cd3a2e |
11 | |
12 | * Getting the LTTng packages |
13 | |
14 | su - |
15 | mkdir /usr/src/lttng |
16 | cd /usr/src/lttng |
17 | (see http://ltt.polymtl.ca/lttng for package listing) |
18 | wget http://ltt.polymtl.ca/lttng/lttng-modules-0.2.tar.bz2 |
4408c54c |
19 | wget http://ltt.polymtl.ca/lttng/patch-2.6.12-rc4-mm2-lttng-0.3.bz2 |
d9cd3a2e |
20 | bzip2 -cd lttng-modules-0.2.tar.bz2 | tar xvof - |
21 | |
22 | |
23 | * Getting LTTng kernel sources |
24 | |
25 | su - |
26 | cd /usr/src |
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 - |
30 | cd linux-2.6.12-rc4 |
31 | bzip2 -cd ../2.6.12-rc4-mm2.bz2 | patch -p1 |
4408c54c |
32 | bzip2 -cd /usr/src/lttng/patch-2.6.12-rc4-mm2-lttng-0.3.bz2 | patch -p1 |
d9cd3a2e |
33 | cd .. |
4408c54c |
34 | mv linux-2.6.12-rc4 linux-2.6.12-rc4-mm2-lttng-0.3 |
d9cd3a2e |
35 | |
36 | |
37 | * Installing a LTTng kernel |
38 | |
39 | su - |
4408c54c |
40 | cd /usr/src/linux-2.6.12-rc4-mm2-lttng-0.3 |
d9cd3a2e |
41 | make menuconfig |
42 | General setup |
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 |
7bfce92a |
48 | IMPORTANT : This is enabled by default : you must disable it! |
02bc6879 |
49 | make |
d9cd3a2e |
50 | make install |
26d45a39 |
51 | make modules_install |
d9cd3a2e |
52 | reboot |
53 | |
54 | |
55 | * Install the ltt-modules |
56 | |
57 | su - |
58 | cd /usr/src/lttng/lttng-modules-0.2 |
4408c54c |
59 | KERNELDIR=/usr/src/linux-2.6.12-rc4-mm2-lttng-0.3 make |
60 | KERNELDIR=/usr/src/linux-2.6.12-rc4-mm2-lttng-0.3 make modules_install |
d9cd3a2e |
61 | |
62 | note : at this stage, you might want to execute |
63 | modprobe ltt-control |
64 | |
65 | and you might also want to do this : |
66 | echo ltt-control >> /etc/modules |
67 | |
68 | |
69 | * Getting and installing the LTTV package |
70 | |
71 | su - |
72 | cd /usr/src |
73 | wget http://ltt.polymtl.ca/packages/LinuxTraceToolkitViewer-0.5-16092005.tar.gz |
74 | gzip -cd LinuxTraceToolkitViewer-0.5-16092005.tar.gz | tar xvof - |
75 | cd LinuxTraceToolkitViewer-0.5-16092005 |
76 | ./configure |
77 | make |
78 | make install |
79 | |
80 | * Use LTTV |
81 | |
82 | lttv-gui (or /usr/local/bin/lttv-gui) |
83 | - Spot the "Trace Control" icon : click on it |
84 | - enter the root password |
85 | - click "start" |
86 | - click "stop" |
87 | - Yes |
88 | * You should now see a trace |
89 | |
90 | |
91 | * Getting and installing genevent |
92 | |
cb598ad7 |
93 | su - |
d9cd3a2e |
94 | cd /usr/src |
95 | wget http://ltt.polymtl.ca/packages/genevent-0.1.tar.gz |
96 | gzip -cd genevent-0.1.tar.gz | tar xvof - |
97 | cd genevent-0.1 |
98 | make |
99 | make install |
100 | |
101 | |
102 | * Add new events to the kernel with genevent |
103 | |
104 | su - |
105 | cd /usr/local/share/LinuxTraceToolkitViewer/facilities |
106 | cp process.xml yourfacility.xml |
107 | * edit yourfacility.xml to fit your needs. |
108 | cd /tmp |
109 | /usr/local/bin/genevent /usr/local/share/LinuxTraceToolkitViewer/yourfacility.xml |
110 | cp ltt-facility-yourfacility.h ltt-facility-id-yourfacility.h \ |
4408c54c |
111 | /usr/src/linux-2.6.12-rc4-mm2-lttng-0.3/include/linux/ltt |
d9cd3a2e |
112 | cp ltt-facility-loader-yourfacility.c ltt-facility-loader-yourfacility.h \ |
4408c54c |
113 | /usr/src/linux-2.6.12-rc4-mm2-lttng-0.3/ltt |
d9cd3a2e |
114 | * edit the kernel file you want to instrument |
115 | - Add #include <linux/ltt/ltt-facility-yourfacility.h> at the beginning |
116 | of the file. |
117 | - Add a call to the tracing functions. See their names and parameters in |
4408c54c |
118 | /usr/src/linux-2.6.12-rc4-mm2-lttng-0.3/include/linux/ltt/ltt-facility-yourfacility.h |
d9cd3a2e |
119 | |
120 | |
121 | |