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 TRACEPOINT_EVENT() definitions and other optional definition
32       entries, like TRACEPOINT_LOGLEVEL(). See lttng-ust(3) for the complete
33       list of available definitions.
34
35       The TRACEPOINT_EVENT() definitions are written as you would write them
36       in an LTTng-UST template provider header file. C comments are supported
37       (/* */ and //), as well as lines starting with #.
38
39           Note
40           The provider name (the first argument of TRACEPOINT_EVENT()) must
41           be the same in all the TRACEPOINT_EVENT() macros of TEMPLATE.
42
43       Here’s an example:
44
45           TRACEPOINT_EVENT(
46               // Tracepoint provider name
47               my_provider,
48
49               // Tracepoint/event name
50               my_event,
51
52               // Tracepoint arguments (input)
53               TP_ARGS(char *, text),
54
55               // Tracepoint/event fields (output)
56               TP_FIELDS(
57                   ctf_string(message, text)
58               )
59           )
60

OPTIONS

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

ENVIRONMENT VARIABLES

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

EXIT STATUS

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

BUGS

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

RESOURCES

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

COPYRIGHTS

112       lttng-gen-tp is part of the LTTng-UST project.
113
114       lttng-gen-tp is distributed under the GNU General Public License,
115       version 2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html>.
116       See the COPYING <https://github.com/lttng/lttng-
117       ust/blob/v2.12.0-rc3/COPYING> file 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.12.0-rc3                  03/27/2020                   LTTNG-GEN-TP(1)
Impressum