Blob Blame History Raw
'\" t
.\"     Title: lttng-gen-tp
.\"    Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\"      Date: 06/05/2016
.\"    Manual: LTTng Manual
.\"    Source: LTTng 2.9.0-pre
.\"  Language: English
.\"
.TH "LTTNG\-GEN\-TP" "1" "06/05/2016" "LTTng 2\&.9\&.0\-pre" "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 \fBTRACEPOINT_EVENT()\fR definitions and other optional definition entries, like \fBTRACEPOINT_LOGLEVEL()\fR\&. See \fBlttng-ust\fR(3) for the complete list of available definitions\&.
.sp
The \fBTRACEPOINT_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 \fBTRACEPOINT_EVENT()\fR) must be the same in all the \fBTRACEPOINT_EVENT()\fR macros of \fITEMPLATE\fR\&.
.sp .5v
.RE
.sp
Here\(cqs an example:
.sp
.if n \{\
.RS 4
.\}
.nf
TRACEPOINT_EVENT(
    // Tracepoint provider name
    my_provider,

    // Tracepoint/event name
    my_event,

    // Tracepoint arguments (input)
    TP_ARGS(char *, text),

    // Tracepoint/event fields (output)
    TP_FIELDS(
        ctf_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 <https://bugs.lttng.org/projects/lttng-ust>\&.
.SH "RESOURCES"
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
LTTng project website <http://lttng.org>
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
LTTng documentation <http://lttng.org/docs>
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Git repositories <http://git.lttng.org>
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
GitHub organization <http://github.com/lttng>
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Continuous integration <http://ci.lttng.org/>
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Mailing list <http://lists.lttng.org>
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 <irc://irc.oftc.net/lttng>:
\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 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html>\&. See the \fBCOPYING\fR <https://github.com/lttng/lttng-ust/blob/master/COPYING> file for more details\&.
.SH "AUTHOR"
.sp
\fBlttng-gen-tp\fR was originally written by Yannick Brosseau <mailto:yannick.brosseau@gmail.com>\&. It is currently maintained by Mathieu Desnoyers <mailto:mathieu.desnoyers@efficios.com>\&.
.SH "SEE ALSO"
.sp
\fBlttng-ust\fR(3)