bf431ad1 |
1 | |
2 | Mathieu Desnoyers -- September 2005 |
3 | |
3888436c |
4 | The 'genevent' program parses event descriptions and generates |
5 | the inline functions to record events in the kernel. |
6 | |
7 | Right now, the program can only parse simple structure, if a |
8 | structure has a nested structure, it will not work. |
9 | |
10 | There are several files in the directory: |
11 | genevent.c, genevent.h, crc32.tab, parser.c and parser.h |
12 | |
13 | In fact, crc32.tab, parser.c and parser.h are the same files as |
14 | those in LTT library. |
15 | |
16 | 'core.xml' is an example event description file. |
17 | |
bf431ad1 |
18 | Here is a brief description of how to use genevent. |
19 | |
20 | make |
21 | make install |
22 | |
23 | |
24 | * Add new events to the kernel with genevent |
25 | |
26 | su - |
27 | cd /usr/local/share/LinuxTraceToolkitViewer/facilities |
28 | cp process.xml yourfacility.xml |
29 | * edit yourfacility.xml to fit your needs. |
30 | cd /tmp |
31 | /usr/local/bin/genevent /usr/local/share/LinuxTraceToolkitViewer/yourfacility.xml |
32 | cp ltt-facility-yourfacility.h ltt-facility-id-yourfacility.h \ |
33 | /usr/src/linux-2.6.12-rc4-mm2-lttng-0.2/include/linux/ltt |
34 | cp ltt-facility-loader-yourfacility.c ltt-facility-loader-yourfacility.h \ |
35 | /usr/src/linux-2.6.12-rc4-mm2-lttng-0.2/ltt |
36 | * edit the kernel file you want to instrument |
37 | - Add #include <linux/ltt/ltt-facility-yourfacility.h> at the beginning |
38 | of the file. |
39 | - Add a call to the tracing functions. See their names and parameters in |
40 | /usr/src/linux-2.6.12-rc4-mm2-lttng-0.2/include/linux/ltt/ltt-facility-yourfacility.h |
41 | |
42 | |