doc/man: document LTTng-UST 2.13
[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
fb24f1b6
PP
43list of `LTTNG_UST_TRACEPOINT_EVENT()` definitions and other optional
44definition entries, like `LTTNG_UST_TRACEPOINT_LOGLEVEL()`. See
45man:lttng-ust(3) for the complete list of available definitions.
4ddbd0b7 46
fb24f1b6
PP
47The `LTTNG_UST_TRACEPOINT_EVENT()` definitions are written as you would
48write them in an LTTng-UST template provider header file. C comments are
49supported (`/* */` and `//`), as well as lines starting with `#`.
4ddbd0b7 50
fb24f1b6
PP
51NOTE: 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'.
4ddbd0b7
PP
54
55Here's an example:
56
57---------------------------------------
fb24f1b6 58LTTNG_UST_TRACEPOINT_EVENT(
4ddbd0b7
PP
59 // Tracepoint provider name
60 my_provider,
61
62 // Tracepoint/event name
63 my_event,
64
65 // Tracepoint arguments (input)
fb24f1b6 66 LTTNG_UST_TP_ARGS(char *, text),
4ddbd0b7
PP
67
68 // Tracepoint/event fields (output)
fb24f1b6
PP
69 LTTNG_UST_TP_FIELDS(
70 lttng_ust_field_string(message, text)
4ddbd0b7
PP
71 )
72)
73---------------------------------------
74
75
76OPTIONS
77-------
78option:-o, option:--output='FILE'::
79 Do not generate default files: generate 'FILE'.
80+
81The extension of 'FILE' determines what is generated, amongst `.h`,
82`.c`, and `.o`. This option can be used more than one time to generate
83different file types.
84
85option:-v, option:--verbose::
86 Increase verbosity.
87
88option:-h, option:--help::
89 Show command help.
90
91
92ENVIRONMENT VARIABLES
93---------------------
94`CC`::
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.
97
98`CFLAGS`::
99 Flags and options passed directly to the compiler (`$CC`).
100 This option is only relevant when generating the `.o` file.
101
102
103EXIT STATUS
104-----------
105*0*::
106 Success
107
108*Non-zero*::
109 Error
110
111
112include::common-footer.txt[]
113
114
115COPYRIGHTS
116----------
117`lttng-gen-tp` is part of the LTTng-UST project.
118
119`lttng-gen-tp` is distributed under the
120http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html[GNU General
121Public License, version 2]. See the
f596de62 122https://github.com/lttng/lttng-ust/blob/v{lttng_version}/COPYING[`COPYING`] file
4ddbd0b7
PP
123for more details.
124
125
126AUTHOR
127------
128`lttng-gen-tp` was originally written by
129mailto:yannick.brosseau@gmail.com[Yannick Brosseau]. It is currently
130maintained by mailto:mathieu.desnoyers@efficios.com[Mathieu Desnoyers].
131
132
133SEE ALSO
134--------
135man:lttng-ust(3)
This page took 0.03203 seconds and 4 git commands to generate.