Remove unneeded "will"s + minor fixes
[lttng-docs.git] / contents / using-lttng / instrumenting / c-application / building-linking / intro.md
... / ...
CommitLineData
1---
2id: building-tracepoint-providers-and-user-application
3---
4
5This section explains the final step of using LTTng-UST for tracing
6a user space C application (beside running the application): building and
7linking tracepoint providers and the application itself.
8
9As discussed above, the macros used by the user-written tracepoint provider
10header file are useless until actually used to create probes code
11(global data structures and functions) in a translation unit (C source file).
12This is accomplished by defining `TRACEPOINT_CREATE_PROBES` in a translation
13unit and then including the tracepoint provider header file.
14When `TRACEPOINT_CREATE_PROBES` is defined, macros used and included by
15the tracepoint provider header produce actual source code needed by any
16application using the defined tracepoints. Defining
17`TRACEPOINT_CREATE_PROBES` produces code used when registering
18tracepoint providers when the tracepoint provider package loads.
19
20The other important definition is `TRACEPOINT_DEFINE`. This one creates
21global, per-tracepoint structures referencing the tracepoint providers
22data. Those structures are required by the actual functions inserted
23where `tracepoint()` macros are placed and need to be defined by the
24instrumented application.
25
26Both `TRACEPOINT_CREATE_PROBES` and `TRACEPOINT_DEFINE` need to be defined
27at some places in order to trace a user space C application using LTTng.
28Although explaining their exact mechanism is beyond the scope of this
29document, the reason they both exist separately is to allow the trace
30providers to be packaged as a shared object (dynamically loaded library).
31
32There are two ways to compile and link the tracepoint providers
33with the application: _[statically](#doc-static-linking)_ or
34_[dynamically](#doc-dynamic-linking)_. Both methods are covered in the
35following subsections.
This page took 0.023611 seconds and 4 git commands to generate.