# lttng-gen-tp

## NAME



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


## SYNOPSIS



           **lttng-gen-tp**[**--verbose**] [**--output** =_FILE_.c]
                        [**--output** =_FILE_.h] [**--output** =_FILE_.o] _TEMPLATE_
    


## DESCRIPTION



           The **lttng-gen-tp** tool simplifies the generation of LTTng-UST
           tracepoint provider files. It takes a simple template file,
           _TEMPLATE_ , and generates the necessary C code to use the defined
           tracepoints in your application. See the _Template file format_
           section below for more information about the format of _TEMPLATE_.
    
           Currently, **lttng-gen-tp** can generate the **.h** , **.c** , and **.o** files
           associated with your tracepoint provider. The generated **.h** file
           can be included directly in your application. You can let **lttng-**
           **gen-tp** generate the **.o** file or compile the **.c** file yourself. See
           lttng-ust(3) for more information about compiling LTTng-UST
           tracepoint providers.
    
           By default, **lttng-gen-tp** generates the **.h** , **.c** , and **.o** files, their
           basename being the basename of _TEMPLATE_. You can generate one or
           more specific file types with the **--output** option, repeated if
           needed.
    
       **Template file format**
           The template file, which usually has the **.tp** extension, contains a
           list of **LTTNG_UST_TRACEPOINT_EVENT()** definitions and other
           optional definition entries, like **LTTNG_UST_TRACEPOINT_LOGLEVEL()**.
           See lttng-ust(3) for the complete list of available definitions.
    
           The **LTTNG_UST_TRACEPOINT_EVENT()** definitions are written as you
           would write them in an LTTng-UST template provider header file. C
           comments are supported (**/* */** and **//**), as well as lines starting
           with **#**.
    
               **Note**
    
               The provider name (the first argument of
               **LTTNG_UST_TRACEPOINT_EVENT()**) must be the same in all the
               **LTTNG_UST_TRACEPOINT_EVENT()** macros of _TEMPLATE_.
    
           Here’s an example:
    
               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)
                   )
               )
    


## OPTIONS



           **-o** , **--output** =_FILE_
               Do not generate default files: generate _FILE_.
    
               The extension of _FILE_ determines what is generated, amongst
               **.h** , **.c** , and **.o**. This option can be used more than one time to
               generate different file types.
    
           **-v** , **--verbose**
               Increase verbosity.
    
           **-h** , **--help**
               Show command help.
    


## ENVIRONMENT VARIABLES



           **CC**
               C compiler to use. Default: **cc** , then **gcc** if **cc** is not found.
               This option is only relevant when generating the **.o** file.
    
           **CFLAGS**
               Flags and options passed directly to the compiler (**$CC**). This
               option is only relevant when generating the **.o** file.
    


## EXIT STATUS



           **0**
               Success
    
           **Non-zero**
               Error
    


## BUGS



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


## RESOURCES



           •   LTTng project website <http://lttng.org>
    
           •   LTTng documentation <http://lttng.org/docs>
    
           •   Git repositories <http://git.lttng.org>
    
           •   GitHub organization <http://github.com/lttng>
    
           •   Continuous integration <http://ci.lttng.org/>
    
           •   Mailing list <http://lists.lttng.org> for support and
               development: **lttng-dev@lists.lttng.org**
    
           •   IRC channel <irc://irc.oftc.net/lttng>: **#lttng** on **irc.oftc.net**
    


* * *