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