manpage -> man pages
[lttng-docs.git] / contents / using-lttng / instrumenting / c-application / lttng-gen-tp.md
CommitLineData
5e0cbfb0
PP
1---
2id: lttng-gen-tp
3---
4
5LTTng-UST ships with `lttng-gen-tp`, a handy command line utility for
6generating most of the stuff discussed above. It takes a _template file_,
7with a name usually ending with the `.tp` extension, containing only
8tracepoint definitions, and outputs a tracepoint provider (either a C
9source file or a precompiled object file) with its header file.
10
11`lttng-gen-tp` should suffice in [static linking](#doc-static-linking)
12situations. When using it, write a template file containing a list of
47bfcb75 13`TRACEPOINT_EVENT()` macro calls. The tool finds the provider names
5e0cbfb0
PP
14used and generate the appropriate files which are going to look a lot
15like `tp.h` and `tp.c` above.
16
17Just call `lttng-gen-tp` like this:
18
19<pre class="term">
20lttng-gen-tp my-template.tp
21</pre>
22
47bfcb75 23`my-template.c`, `my-template.o` and `my-template.h` are created
5e0cbfb0
PP
24in the same directory.
25
da2f3574
PP
26You may specify custom C flags passed to the compiler invoked by
27`lttng-gen-tp` using the `CFLAGS` environment variable:
28
29<pre class="term">
30CFLAGS=-I/custom/include/path lttng-gen-tp my-template.tp
31</pre>
32
5e0cbfb0 33For more information on `lttng-gen-tp`, see
5037eb52 34<a href="/man/1/lttng-gen-tp" class="ext">its man page</a>.
This page took 0.023618 seconds and 4 git commands to generate.