Add demo test back as an example
[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"
4lttng-gen-tp \(em LTTng UST 2.0 tracepoint code generator
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.
16It's tracers help tracking down performance issues and debugging problems
17involving multiple concurrent processes and threads. Tracing across multiple
18systems is also possible.
19
20The \fBlttng\-gen\-tp\fP tool simplify the generation of the UST tracepoint
21files. It takes a simple template file and generate the necessary code to use the defined tracepoints in your application.
22The section TEMPLATE FILE FORMAT describe the content of the template file.
23
db06a0a2 24Currently, the tool can generate the .h, .c and .o associated to 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
MD
32"\-llttng-ust \-I.".
33Note for C++ support: although an application instrumented with
34tracepoints can be compiled with g++, tracepoint probes should be
35compiled with gcc (only tested with gcc so far).
7e3821f0
YB
36
37.SH "OPTIONS"
38
39.PP
40This program follow the usual GNU command line syntax with long options starting with
41two dashes. Below is a summary of the available options.
42.PP
43
44.TP
45.BR "\-h, \-\-help"
46Show summary of possible options and commands.
47.TP
48.BR "\-v, \-\-verbose"
49Increase verbosity.
50.TP
51.BR "\-o, \-\-output"
52Specify the generated file. The type of the generated file depend on the file
db06a0a2 53extension (.h, .c, .o).
7e3821f0
YB
54This option can be specfied multiple times to generate different file type.
55
56.PP
db06a0a2 57When no output is specified de default files are generated with the same base filename as the template file. The default files are: .h, .c, .o.
7e3821f0
YB
58
59.SH "TEMPLATE FILE FORMAT"
60
9b6435af 61The template file, which has the usual extension \fB.tp\fP, contains a list of
7e3821f0
YB
62TRACEPOINT_EVENT definitions and other optional definition entries like
63TRACEPOINT_LOGLEVEL.
64(See lttng-ust(3) for the complete list of available definition.)
65
66You write them as you would write them in a C header file. You can add
67comments with \fB/* */\fP, \fB//\fP and \fB#\fP.
68
69The provider name (the first field of TRACEPOINT_EVENT) must be
70the same for the whole file.
71
72.TP
73.SH "Example"
74.TP
75.nf
76TRACEPOINT_EVENT(
77 sample_tracepoint,
78 message, // Comment
79 TP_ARGS(char *, text),
80 /* Next are the fields */
81 TP_FIELDS(
82 ctf_string(message, text)
83 )
84)
db06a0a2 85.SH "ENVIRONMENT VARIABLES"
7e3821f0 86
db06a0a2
YB
87.PP
88When the tool generate an .o file, it will look for the following environment variables
89.PP
90
91.PP
92.IP "CC"
93Specifer which C compiler to use. If the variable is not specified, the
94tool will try "cc" and "gcc"
95
96.IP "CFLAGS"
97Flags directly passed to the compiler
7e3821f0
YB
98.SH "SEE ALSO"
99
100.PP
101lttng-ust(3), lttng(1)
102.PP
103.SH "BUGS"
104
105.PP
106If you encounter any issues or usability problem, please report it on our
107mailing list <lttng-dev@lists.lttng.org> to help improve this project.
108.SH "CREDITS"
109
110.PP
111lttng\-gen\-tp is distributed under the GNU General Public License version 2. See the file
112COPYING for details.
113.PP
114A Web site is available at http://lttng.org for more information on the LTTng
115project.
116.PP
117You can also find our git tree at http://git.lttng.org.
118.PP
119Mailing lists for support and development: <lttng-dev@lists.lttng.org>.
120.PP
121You can find us on IRC server irc.oftc.net (OFTC) in #lttng.
122.PP
123.SH "AUTHORS"
124
125.PP
126lttng\-gen\-tp is written by Yannick Brosseau <yannick.brosseau@gmail.com>.
127.PP
This page took 0.027963 seconds and 4 git commands to generate.