8 lttng-gen-tp - Generate LTTng-UST tracepoint provider code
14 *lttng-gen-tp* [option:--verbose] [option:--output='FILE'.c]
15 [option:--output='FILE'.h] [option:--output='FILE'.o] 'TEMPLATE'
20 The `lttng-gen-tp` tool simplifies the generation of LTTng-UST
21 tracepoint provider files. It takes a simple template file, 'TEMPLATE',
22 and generates the necessary C code to use the defined tracepoints in
23 your application. See the <<template-file-format,Template file format>>
24 section below for more information about the format of 'TEMPLATE'.
26 Currently, `lttng-gen-tp` can generate the `.h`, `.c`, and `.o` files
27 associated with your tracepoint provider. The generated `.h` file can be
28 included directly in your application. You can let `lttng-gen-tp`
29 generate the `.o` file or compile the `.c` file yourself. See
30 man:lttng-ust(3) for more information about compiling LTTng-UST
33 By default, `lttng-gen-tp` generates the `.h`, `.c`, and `.o` files,
34 their basename being the basename of 'TEMPLATE'. You can generate one or
35 more specific file types with the option:--output option, repeated if
39 [[template-file-format]]
42 The template file, which usually has the `.tp` extension, contains a
43 list of `LTTNG_UST_TRACEPOINT_EVENT()` definitions and other optional
44 definition entries, like `LTTNG_UST_TRACEPOINT_LOGLEVEL()`. See
45 man:lttng-ust(3) for the complete list of available definitions.
47 The `LTTNG_UST_TRACEPOINT_EVENT()` definitions are written as you would
48 write them in an LTTng-UST template provider header file. C comments are
49 supported (`/* */` and `//`), as well as lines starting with `#`.
51 NOTE: The provider name (the first argument of
52 `LTTNG_UST_TRACEPOINT_EVENT()`) must be the same in all the
53 `LTTNG_UST_TRACEPOINT_EVENT()` macros of 'TEMPLATE'.
57 ---------------------------------------
58 LTTNG_UST_TRACEPOINT_EVENT(
59 // Tracepoint provider name
62 // Tracepoint/event name
65 // Tracepoint arguments (input)
66 LTTNG_UST_TP_ARGS(char *, text),
68 // Tracepoint/event fields (output)
70 lttng_ust_field_string(message, text)
73 ---------------------------------------
78 option:-o, option:--output='FILE'::
79 Do not generate default files: generate 'FILE'.
81 The extension of 'FILE' determines what is generated, amongst `.h`,
82 `.c`, and `.o`. This option can be used more than one time to generate
85 option:-v, option:--verbose::
88 option:-h, option:--help::
95 C compiler to use. Default: `cc`, then `gcc` if `cc` is not found.
96 This option is only relevant when generating the `.o` file.
99 Flags and options passed directly to the compiler (`$CC`).
100 This option is only relevant when generating the `.o` file.
112 include::common-footer.txt[]
117 `lttng-gen-tp` is part of the LTTng-UST project.
119 `lttng-gen-tp` is distributed under the
120 http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html[GNU General
121 Public License, version 2]. See the
122 https://github.com/lttng/lttng-ust/blob/v{lttng_version}/COPYING[`COPYING`] file
128 `lttng-gen-tp` was originally written by
129 mailto:yannick.brosseau@gmail.com[Yannick Brosseau]. It is currently
130 maintained by mailto:mathieu.desnoyers@efficios.com[Mathieu Desnoyers].