doc/man: include build version in GitHub links
[lttng-ust.git] / doc / man / lttng-gen-tp.1.txt
CommitLineData
4ddbd0b7
PP
1lttng-gen-tp(1)
2===============
3:object-type: program
4
5
6NAME
7----
8lttng-gen-tp - Generate LTTng-UST tracepoint provider code
9
10
11SYNOPSIS
12--------
13[verse]
14*lttng-gen-tp* [option:--verbose] [option:--output='FILE'.c]
15 [option:--output='FILE'.h] [option:--output='FILE'.o] 'TEMPLATE'
16
17
18DESCRIPTION
19-----------
20The `lttng-gen-tp` tool simplifies the generation of LTTng-UST
21tracepoint provider files. It takes a simple template file, 'TEMPLATE',
22and generates the necessary C code to use the defined tracepoints in
23your application. See the <<template-file-format,Template file format>>
24section below for more information about the format of 'TEMPLATE'.
25
26Currently, `lttng-gen-tp` can generate the `.h`, `.c`, and `.o` files
27associated with your tracepoint provider. The generated `.h` file can be
28included directly in your application. You can let `lttng-gen-tp`
29generate the `.o` file or compile the `.c` file yourself. See
30man:lttng-ust(3) for more information about compiling LTTng-UST
31tracepoint providers.
32
33By default, `lttng-gen-tp` generates the `.h`, `.c`, and `.o` files,
34their basename being the basename of 'TEMPLATE'. You can generate one or
35more specific file types with the option:--output option, repeated if
36needed.
37
38
39[[template-file-format]]
40Template file format
41~~~~~~~~~~~~~~~~~~~~
42The template file, which usually has the `.tp` extension, contains a
43list of `TRACEPOINT_EVENT()` definitions and other optional definition
44entries, like `TRACEPOINT_LOGLEVEL()`. See man:lttng-ust(3) for
45the complete list of available definitions.
46
47The `TRACEPOINT_EVENT()` definitions are written as you would write them
48in an LTTng-UST template provider header file. C comments are supported
49(`/* */` and `//`), as well as lines starting with `#`.
50
51NOTE: The provider name (the first argument of `TRACEPOINT_EVENT()`)
52must be the same in all the `TRACEPOINT_EVENT()` macros of 'TEMPLATE'.
53
54Here's an example:
55
56---------------------------------------
57TRACEPOINT_EVENT(
58 // Tracepoint provider name
59 my_provider,
60
61 // Tracepoint/event name
62 my_event,
63
64 // Tracepoint arguments (input)
65 TP_ARGS(char *, text),
66
67 // Tracepoint/event fields (output)
68 TP_FIELDS(
69 ctf_string(message, text)
70 )
71)
72---------------------------------------
73
74
75OPTIONS
76-------
77option:-o, option:--output='FILE'::
78 Do not generate default files: generate 'FILE'.
79+
80The extension of 'FILE' determines what is generated, amongst `.h`,
81`.c`, and `.o`. This option can be used more than one time to generate
82different file types.
83
84option:-v, option:--verbose::
85 Increase verbosity.
86
87option:-h, option:--help::
88 Show command help.
89
90
91ENVIRONMENT VARIABLES
92---------------------
93`CC`::
94 C compiler to use. Default: `cc`, then `gcc` if `cc` is not found.
95 This option is only relevant when generating the `.o` file.
96
97`CFLAGS`::
98 Flags and options passed directly to the compiler (`$CC`).
99 This option is only relevant when generating the `.o` file.
100
101
102EXIT STATUS
103-----------
104*0*::
105 Success
106
107*Non-zero*::
108 Error
109
110
111include::common-footer.txt[]
112
113
114COPYRIGHTS
115----------
116`lttng-gen-tp` is part of the LTTng-UST project.
117
118`lttng-gen-tp` is distributed under the
119http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html[GNU General
120Public License, version 2]. See the
f596de62 121https://github.com/lttng/lttng-ust/blob/v{lttng_version}/COPYING[`COPYING`] file
4ddbd0b7
PP
122for more details.
123
124
125AUTHOR
126------
127`lttng-gen-tp` was originally written by
128mailto:yannick.brosseau@gmail.com[Yannick Brosseau]. It is currently
129maintained by mailto:mathieu.desnoyers@efficios.com[Mathieu Desnoyers].
130
131
132SEE ALSO
133--------
134man:lttng-ust(3)
This page took 0.027771 seconds and 4 git commands to generate.