1LTTNG-GEN-TP(1)                  LTTng Manual                  LTTNG-GEN-TP(1)
2
3
4

NAME

6       lttng-gen-tp - Generate LTTng-UST tracepoint provider code
7

SYNOPSIS

9       lttng-gen-tp [--verbose] [--output=FILE.c]
10                    [--output=FILE.h] [--output=FILE.o] TEMPLATE
11

DESCRIPTION

13       The lttng-gen-tp tool simplifies the generation of LTTng-UST tracepoint
14       provider files. It takes a simple template file, TEMPLATE, and
15       generates the necessary C code to use the defined tracepoints in your
16       application. See the Template file format section below for more
17       information about the format of TEMPLATE.
18
19       Currently, lttng-gen-tp can generate the .h, .c, and .o files
20       associated with your tracepoint provider. The generated .h file can be
21       included directly in your application. You can let lttng-gen-tp
22       generate the .o file or compile the .c file yourself. See lttng-ust(3)
23       for more information about compiling LTTng-UST tracepoint providers.
24
25       By default, lttng-gen-tp generates the .h, .c, and .o files, their
26       basename being the basename of TEMPLATE. You can generate one or more
27       specific file types with the --output option, repeated if needed.
28
29   Template file format
30       The template file, which usually has the .tp extension, contains a list
31       of LTTNG_UST_TRACEPOINT_EVENT() definitions and other optional
32       definition entries, like LTTNG_UST_TRACEPOINT_LOGLEVEL(). See lttng-
33       ust(3) for the complete list of available definitions.
34
35       The LTTNG_UST_TRACEPOINT_EVENT() definitions are written as you would
36       write them in an LTTng-UST template provider header file. C comments
37       are supported (/* */ and //), as well as lines starting with #.
38
39           Note
40           The provider name (the first argument of
41           LTTNG_UST_TRACEPOINT_EVENT()) must be the same in all the
42           LTTNG_UST_TRACEPOINT_EVENT() macros of TEMPLATE.
43
44       Here’s an example:
45
46           LTTNG_UST_TRACEPOINT_EVENT(
47               // Tracepoint provider name
48               my_provider,
49
50               // Tracepoint/event name
51               my_event,
52
53               // Tracepoint arguments (input)
54               LTTNG_UST_TP_ARGS(char *, text),
55
56               // Tracepoint/event fields (output)
57               LTTNG_UST_TP_FIELDS(
58                   lttng_ust_field_string(message, text)
59               )
60           )
61

OPTIONS

63       -o, --output=FILE
64           Do not generate default files: generate FILE.
65
66           The extension of FILE determines what is generated, amongst .h, .c,
67           and .o. This option can be used more than one time to generate
68           different file types.
69
70       -v, --verbose
71           Increase verbosity.
72
73       -h, --help
74           Show command help.
75

ENVIRONMENT VARIABLES

77       CC
78           C compiler to use. Default: cc, then gcc if cc is not found. This
79           option is only relevant when generating the .o file.
80
81       CFLAGS
82           Flags and options passed directly to the compiler ($CC). This
83           option is only relevant when generating the .o file.
84

EXIT STATUS

86       0
87           Success
88
89       Non-zero
90           Error
91

BUGS

93       If you encounter any issue or usability problem, please report it on
94       the LTTng bug tracker <https://bugs.lttng.org/projects/lttng-ust>.
95

RESOURCES

97       •   LTTng project website <http://lttng.org>
98
99       •   LTTng documentation <http://lttng.org/docs>
100
101       •   Git repositories <http://git.lttng.org>
102
103       •   GitHub organization <http://github.com/lttng>
104
105       •   Continuous integration <http://ci.lttng.org/>
106
107       •   Mailing list <http://lists.lttng.org> for support and development:
108           lttng-dev@lists.lttng.org
109
110       •   IRC channel <irc://irc.oftc.net/lttng>: #lttng on irc.oftc.net
111

COPYRIGHTS

113       lttng-gen-tp is part of the LTTng-UST project.
114
115       lttng-gen-tp is distributed under the GNU General Public License,
116       version 2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html>.
117       See the for more details.
118

AUTHOR

120       lttng-gen-tp was originally written by Yannick Brosseau
121       <mailto:yannick.brosseau@gmail.com>. It is currently maintained by
122       Mathieu Desnoyers <mailto:mathieu.desnoyers@efficios.com>.
123

SEE ALSO

125       lttng-ust(3)
126
127
128
129LTTng 2.13.5                      09/30/2022                   LTTNG-GEN-TP(1)
Impressum