YAML configuration object

The configuration object is the root of a barectf YAML configuration document. It describes a complete barectf configuration.

The configuration object must have the YAML tag tag:barectf.org,2020/3/config.

The configuration object has a mandatory trace object and options.

Properties

Name Type Description Req? Default

options

Options object

Configuration options.

No

See Options object for default values.

trace

Trace object

Configuration’s trace.

Yes

Options object

The options of a configuration object.

Properties

Name Type Description Default

code-generation

Code generation options object

Code generation options.

See Code generation options object for default values.

Code generation options object

The code generation options of a configuration object.

Properties

All the properties are optional.

Name Type Description Default

prefix

String or prefix object

Identifier and file name prefixes.

If the value is the string PREFIX, then the identifier prefix is PREFIX_ and the file name prefix is PREFIX.

The identifier prefix barectf_ and the file name prefix barectf.

header

Code generation header options object

C header generation options.

See Code generation header options object default values.

Prefix object

Identifier and file name prefixes.

Properties

All the properties are required.

Name Type Description

file-name

String

Prefix of any C file which barectf generates.

barectf adds - between this prefix and other file name parts if needed.

This prefix must only contain valid characters for a file name.

identifier

String

Prefix of any public C identifier which barectf generates.

barectf does not add anything between this prefix and the rest of the identifier.

For example, if this prefix is acme_corp_, then a tracing function name could be acme_corp_trace_my_event().

This prefix must be a valid C identifier.

Code generation header options object

The C header generation options of a configuration object.

Properties

All the properties are optional.

Name Type Description Default

identifier-prefix-definition

Boolean

If this property is true, then barectf generates a public C preprocessor definition named _BARECTF_IDENTIFIER_PREFIX which is set to the configuration’s identifier prefix.

False

default-data-stream-type-name-definition

Boolean

If this property is true, then barectf generates a public C preprocessor definition named _BARECTF_DEFAULT_DATA_STREAM_TYPE_NAME which is set to the name of the trace type’s default data stream type.

False

Examples

The following examples omit the trace object for clarity.
Example 1. Basic configuration object.
--- !<tag:barectf.org,2020/3/config>
trace:
  # ...
Example 2. Configuration object with custom prefixes.
--- !<tag:barectf.org,2020/3/config>
options:
  code-generation:
    prefix:
      file-name: acme-corp
      identifier: acme_corp_
trace:
  # ...
--- !<tag:barectf.org,2020/3/config>
options:
  code-generation:
    header:
      identifier-prefix-definition: true
      default-data-stream-type-name-definition: true
trace:
  # ...
Example 4. Basic configuration object with a YAML directive.

This YAML directive indicates that the YAML document honours the YAML 1.2 specification.

%YAML 1.2
--- !<tag:barectf.org,2020/3/config>
trace:
  # ...