Skip to content

Configuration object

Philippe Proulx edited this page Apr 13, 2016 · 3 revisions

The top-level configuration object of the YAML configuration file.

Properties

Property Type Description Required? Default value
version String Minimum required version of barectf (set to '2.1') Required N/A
options Configuration options object Options Optional {}
prefix String Prefix to be used for function names, file names, etc. Optional barectf_
metadata Metadata object Trace metadata Required N/A

The prefix property must be set to a valid C identifier. It can be overridden by the barectf command-line tool's --prefix option.

Example

version: '2.1'
prefix: axx_
metadata:
  type-aliases:
    uint16:
      class: int
      size: 16
  trace:
    byte-order: le
  streams:
    my_stream:
      packet-context-type:
        class: struct
        fields:
          packet_size: uint16
          content_size: uint16
      events:
        my_event:
          payload-type:
            class: struct
            fields:
              a:
                class: int
                size: 8

Configuration options object

This object contains various options.

Properties

Property Type Description Required? Default value
gen-prefix-def Boolean Generate a C preprocessor definition for the effective barectf prefix Optional false
gen-default-stream-def Boolean Generate a C preprocessor definition for the default stream name Optional false

If the gen-prefix-def option is true, then the C preprocessor definition _BARECTF_PREFIX is set to the effective prefix, for example:

#define _BARECTF_PREFIX barectf_

If the gen-default-stream-def option is true, then the C preprocessor definition _BARECTF_DEFAULT_STREAM is set to the default stream name, for example:

#define definition `_BARECTF_DEFAULT_STREAM my_default_stream