Commit | Line | Data |
---|---|---|
7e3821f0 YB |
1 | .TH "LTTNG-GEN-TP" "1" "February 16, 2012" "" "" |
2 | ||
3 | .SH "NAME" | |
77ca1460 | 4 | lttng-gen-tp \(em LTTng UST 2.x tracepoint code generator |
7e3821f0 YB |
5 | |
6 | .SH "SYNOPSIS" | |
7 | ||
8 | .PP | |
9 | .nf | |
10 | lttng\-gen\-tp [OPTIONS] TEMPLATE_FILE | |
11 | .fi | |
12 | .SH "DESCRIPTION" | |
13 | ||
14 | .PP | |
15 | The LTTng project aims at providing highly efficient tracing tools for Linux. | |
d30d8e1e | 16 | Its tracers help in tracking down performance issues and debugging problems |
7e3821f0 YB |
17 | involving multiple concurrent processes and threads. Tracing across multiple |
18 | systems is also possible. | |
19 | ||
d30d8e1e JG |
20 | The \fBlttng\-gen\-tp\fP tool simplifies the generation of the UST tracepoint |
21 | files. It takes a simple template file and generates the necessary code to use the defined tracepoints in your application. | |
22 | The section TEMPLATE FILE FORMAT describes the content of the template file. | |
7e3821f0 | 23 | |
d30d8e1e | 24 | Currently, the tool can generate the .h, .c and .o associated with your |
7e3821f0 | 25 | tracepoint. The generated .h can be directly included in your application. |
db06a0a2 YB |
26 | You can let the tool generate the .o or compile the .c yourself. |
27 | You can compile the .c into a .o, .a or .so at your choice and | |
28 | link it with your application. | |
29 | Refer to the UST documentation for the | |
7e3821f0 YB |
30 | advantages and disadvantage of each form. |
31 | To compile the resulting .c file, you need to add the options | |
2bda849d | 32 | "\-llttng-ust \-I.". |
7e3821f0 YB |
33 | |
34 | .SH "OPTIONS" | |
35 | ||
36 | .PP | |
d30d8e1e | 37 | This program follows the usual GNU command line syntax with long options starting with |
7e3821f0 YB |
38 | two dashes. Below is a summary of the available options. |
39 | .PP | |
40 | ||
41 | .TP | |
42 | .BR "\-h, \-\-help" | |
43 | Show summary of possible options and commands. | |
44 | .TP | |
45 | .BR "\-v, \-\-verbose" | |
46 | Increase verbosity. | |
47 | .TP | |
48 | .BR "\-o, \-\-output" | |
49 | Specify the generated file. The type of the generated file depend on the file | |
db06a0a2 | 50 | extension (.h, .c, .o). |
d30d8e1e | 51 | This option can be specified multiple times to generate different file type. |
7e3821f0 YB |
52 | |
53 | .PP | |
d30d8e1e | 54 | When no output is specified the default files are generated with the same base filename as the template file. The default files are: .h, .c, .o. |
7e3821f0 YB |
55 | |
56 | .SH "TEMPLATE FILE FORMAT" | |
57 | ||
9b6435af | 58 | The template file, which has the usual extension \fB.tp\fP, contains a list of |
7e3821f0 YB |
59 | TRACEPOINT_EVENT definitions and other optional definition entries like |
60 | TRACEPOINT_LOGLEVEL. | |
61 | (See lttng-ust(3) for the complete list of available definition.) | |
62 | ||
63 | You write them as you would write them in a C header file. You can add | |
64 | comments with \fB/* */\fP, \fB//\fP and \fB#\fP. | |
65 | ||
66 | The provider name (the first field of TRACEPOINT_EVENT) must be | |
67 | the same for the whole file. | |
68 | ||
69 | .TP | |
70 | .SH "Example" | |
71 | .TP | |
72 | .nf | |
73 | TRACEPOINT_EVENT( | |
74 | sample_tracepoint, | |
75 | message, // Comment | |
76 | TP_ARGS(char *, text), | |
77 | /* Next are the fields */ | |
78 | TP_FIELDS( | |
79 | ctf_string(message, text) | |
80 | ) | |
81 | ) | |
db06a0a2 | 82 | .SH "ENVIRONMENT VARIABLES" |
7e3821f0 | 83 | |
db06a0a2 | 84 | .PP |
d30d8e1e | 85 | When the tool generates a .o file, it will look for the following environment variables |
db06a0a2 YB |
86 | .PP |
87 | ||
88 | .PP | |
89 | .IP "CC" | |
d30d8e1e | 90 | Specify which C compiler to use. If the variable is not specified, the |
db06a0a2 YB |
91 | tool will try "cc" and "gcc" |
92 | ||
93 | .IP "CFLAGS" | |
94 | Flags directly passed to the compiler | |
7e3821f0 YB |
95 | .SH "SEE ALSO" |
96 | ||
97 | .PP | |
98 | lttng-ust(3), lttng(1) | |
99 | .PP | |
100 | .SH "BUGS" | |
101 | ||
102 | .PP | |
103 | If you encounter any issues or usability problem, please report it on our | |
104 | mailing list <lttng-dev@lists.lttng.org> to help improve this project. | |
105 | .SH "CREDITS" | |
106 | ||
107 | .PP | |
108 | lttng\-gen\-tp is distributed under the GNU General Public License version 2. See the file | |
109 | COPYING for details. | |
110 | .PP | |
111 | A Web site is available at http://lttng.org for more information on the LTTng | |
112 | project. | |
113 | .PP | |
114 | You can also find our git tree at http://git.lttng.org. | |
115 | .PP | |
116 | Mailing lists for support and development: <lttng-dev@lists.lttng.org>. | |
117 | .PP | |
118 | You can find us on IRC server irc.oftc.net (OFTC) in #lttng. | |
119 | .PP | |
120 | .SH "AUTHORS" | |
121 | ||
122 | .PP | |
123 | lttng\-gen\-tp is written by Yannick Brosseau <yannick.brosseau@gmail.com>. | |
124 | .PP |