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