5 `tracef()` is a small LTTng-UST API to avoid defining your own
6 tracepoints and tracepoint providers. The signature of `tracef()` is
7 the same as `printf()`'s.
9 The `tracef()` utility function was developed to make user space tracing
10 super simple, albeit with notable disadvantages compared to custom,
11 full-fledged tracepoint providers:
13 * All generated events have the same provider/event names, respectively
14 `lttng-ust-tracef` and `event`.
15 * There's no static type checking.
16 * The only event field you actually get, named `msg`, is a string
17 potentially containing the values you passed to the function
18 using your own format. This also means that you cannot use filtering
19 using a custom expression at runtime because there are no isolated
21 * Since `tracef()` uses C standard library's `vasprintf()` function
22 in the background to format the strings at runtime, its
23 expected performance is lower than using custom tracepoint providers
24 with typed fields, which do not require a conversion to a string.
26 Thus, `tracef()` is useful for quick prototyping and debugging, but
27 should not be considered for any permanent/serious application
30 To use `tracef()`, first include `<lttng/tracef.h>` in the C source file
31 where you need to insert probes:
34 #include <lttng/tracef.h>
37 Use `tracef()` like you would use `printf()` in your source code, e.g.:
42 tracef("my message, my integer: %d", my_integer);
47 Link your application with `liblttng-ust`:
50 gcc -o app app.c <strong>-llttng-ust</strong>
53 Execute the application as usual:
59 VoilĂ ! Use the `lttng` command line tool to
60 [control tracing](#doc-controlling-tracing).