1 # Example using `barectf-tracepoint.h`
3 This example is based on the [linux-fs-simple example](../linux-fs-simple),
4 but it uses the `tracepoint()` macro defined in
5 [`barectf-tracepoint.h`](../../../extra/barectf-tracepoint.h) instead of
6 calling the generated tracing functions directly.
8 This example also shows the compatibility with
9 [LTTng-UST](http://lttng.org/) that this `barectf-tracepoint.h` allows.
14 To build both barectf and LTTng-UST targets, make sure both tools are
19 To build only the example using barectf:
21 make -f Makefile.barectf
23 To build only the example using LTTng-UST:
25 make -f Makefile.lttng-ust
32 ./barectf-tracepoint-barectf
34 The complete CTF trace is written to the `ctf` directory.
36 You may run the example with any arguments; they will be recorded,
37 as string fields in the events of the binary stream, e.g.:
39 ./barectf-tracepoint-barectf this argument and this one will be recorded
44 Create an LTTng tracing session:
46 lttng create my-session
48 Enable the events of this example:
50 lttng enable-event --userspace 'barectf_tp:*'
58 ./barectf-tracepoint-lttng-ust
60 You may run the example with any arguments; they will be recorded,
61 as string fields in the events of the binary stream, e.g.:
63 ./barectf-tracepoint-lttng-ust this argument and this one will be recorded
65 Stop tracing and inspect the recorded events: