'\" t .\" Title: lttng-gen-tp .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 09/30/2022 .\" Manual: LTTng Manual .\" Source: LTTng 2.13.5 .\" Language: English .\" .TH "LTTNG\-GEN\-TP" "1" "09/30/2022" "LTTng 2\&.13\&.5" "LTTng Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" lttng-gen-tp \- Generate LTTng\-UST tracepoint provider code .SH "SYNOPSIS" .sp .nf \fBlttng\-gen\-tp\fR [\fB--verbose\fR] [\fB--output\fR=\fIFILE\fR\&.c] [\fB--output\fR=\fIFILE\fR\&.h] [\fB--output\fR=\fIFILE\fR\&.o] \fITEMPLATE\fR .fi .SH "DESCRIPTION" .sp The \fBlttng-gen-tp\fR tool simplifies the generation of LTTng\-UST tracepoint provider files\&. It takes a simple template file, \fITEMPLATE\fR, and generates the necessary C code to use the defined tracepoints in your application\&. See the \fITemplate file format\fR section below for more information about the format of \fITEMPLATE\fR\&. .sp Currently, \fBlttng-gen-tp\fR can generate the \fB.h\fR, \fB.c\fR, and \fB.o\fR files associated with your tracepoint provider\&. The generated \fB.h\fR file can be included directly in your application\&. You can let \fBlttng-gen-tp\fR generate the \fB.o\fR file or compile the \fB.c\fR file yourself\&. See \fBlttng-ust\fR(3) for more information about compiling LTTng\-UST tracepoint providers\&. .sp By default, \fBlttng-gen-tp\fR generates the \fB.h\fR, \fB.c\fR, and \fB.o\fR files, their basename being the basename of \fITEMPLATE\fR\&. You can generate one or more specific file types with the \fB--output\fR option, repeated if needed\&. .SS "Template file format" .sp The template file, which usually has the \fB.tp\fR extension, contains a list of \fBLTTNG_UST_TRACEPOINT_EVENT()\fR definitions and other optional definition entries, like \fBLTTNG_UST_TRACEPOINT_LOGLEVEL()\fR\&. See \fBlttng-ust\fR(3) for the complete list of available definitions\&. .sp The \fBLTTNG_UST_TRACEPOINT_EVENT()\fR definitions are written as you would write them in an LTTng\-UST template provider header file\&. C comments are supported (\fB/* */\fR and \fB//\fR), as well as lines starting with \fB#\fR\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp The provider name (the first argument of \fBLTTNG_UST_TRACEPOINT_EVENT()\fR) must be the same in all the \fBLTTNG_UST_TRACEPOINT_EVENT()\fR macros of \fITEMPLATE\fR\&. .sp .5v .RE .sp Here\(cqs an example: .sp .if n \{\ .RS 4 .\} .nf LTTNG_UST_TRACEPOINT_EVENT( // Tracepoint provider name my_provider, // Tracepoint/event name my_event, // Tracepoint arguments (input) LTTNG_UST_TP_ARGS(char *, text), // Tracepoint/event fields (output) LTTNG_UST_TP_FIELDS( lttng_ust_field_string(message, text) ) ) .fi .if n \{\ .RE .\} .SH "OPTIONS" .PP \fB-o\fR, \fB--output\fR=\fIFILE\fR .RS 4 Do not generate default files: generate \fIFILE\fR\&. .sp The extension of \fIFILE\fR determines what is generated, amongst \fB.h\fR, \fB.c\fR, and \fB.o\fR\&. This option can be used more than one time to generate different file types\&. .RE .PP \fB-v\fR, \fB--verbose\fR .RS 4 Increase verbosity\&. .RE .PP \fB-h\fR, \fB--help\fR .RS 4 Show command help\&. .RE .SH "ENVIRONMENT VARIABLES" .PP \fBCC\fR .RS 4 C compiler to use\&. Default: \fBcc\fR, then \fBgcc\fR if \fBcc\fR is not found\&. This option is only relevant when generating the \fB.o\fR file\&. .RE .PP \fBCFLAGS\fR .RS 4 Flags and options passed directly to the compiler (\fB$CC\fR)\&. This option is only relevant when generating the \fB.o\fR file\&. .RE .SH "EXIT STATUS" .PP \fB0\fR .RS 4 Success .RE .PP \fBNon\-zero\fR .RS 4 Error .RE .SH "BUGS" .sp If you encounter any issue or usability problem, please report it on the LTTng bug tracker \&. .SH "RESOURCES" .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} LTTng project website .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} LTTng documentation .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Git repositories .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} GitHub organization .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Continuous integration .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Mailing list for support and development: \fBlttng-dev@lists.lttng.org\fR .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} IRC channel : \fB#lttng\fR on \fBirc.oftc.net\fR .RE .SH "COPYRIGHTS" .sp \fBlttng-gen-tp\fR is part of the LTTng\-UST project\&. .sp \fBlttng-gen-tp\fR is distributed under the GNU General Public License, version 2 \&. See the for more details\&. .SH "AUTHOR" .sp \fBlttng-gen-tp\fR was originally written by Yannick Brosseau \&. It is currently maintained by Mathieu Desnoyers \&. .SH "SEE ALSO" .sp \fBlttng-ust\fR(3)