How barectf works
barectf generates a CTF metadata stream and C source files from a configuration.
barectf Python package, you build the barectf configuration
programatically by assembling configuration objects. This documentation
is not about the Python package.
barectf generates the following files from a configuration:
The generated tracer’s public C header file.
This header contains the prototypes of the packet opening, packet closing, and tracing functions.
Your application and platforms need to include this file.
Internal macros for the generated tracer (included by
The generated tracer’s C source code.
Those file names assume that the configuration uses the default prefixes.
All C files are written in ANSI C.
Your application calls the tracing
functions found in
barectf.h to write
event records to CTF
data streams of
packets. Those CTF data streams and the
generated CTF metadata stream form a complete
How exactly the event timestamps are sourced and the CTF packets are appended to some file or memory buffer is controlled by the platform.
The typical data flow with barectf is:
barectf reads your YAML configuration file.
barectf generates the CTF metadata stream file.
barectf also generates the tracer’s C files.
Your application creates CTF data stream files during its execution.
Those data stream files and the metadata stream file of step 2 form a complete CTF trace.