Skip to content

Running the barectf command line tool

Philippe Proulx edited this page Mar 18, 2016 · 1 revision

Using the barectf command-line utility is easy. In its simplest form, it outputs a CTF metadata file and a few C files out of a YAML configuration file:

barectf config.yaml

will output, in the current working directory:

  • metadata: CTF metadata file
  • barectf-bitfield.h: macros used by tracing functions to pack bits
  • barectf.h: other macros and prototypes of context/tracing functions
  • barectf.c: context/tracing functions

barectf_ is the default name of the files and the default prefix of barectf C functions and structures. The prefix is read from the configuration file, but you may override it on the command line:

barectf --prefix=my_app_ config.yaml

You may also output the files elsewhere:

barectf --code-dir=src --headers-dir=include --metadata-dir=ctf config.yaml

By default, barectf searches for relative included YAML files in the current working directory, and then in the provided include directory if not found. Other directories can be searched into before searching those default directories thanks to the -I option, which can be repeated:

barectf -I /path/to/includes -I ~/my-includes -I project/include config.yaml