1 = Include partial YAML files
3 You can include a partial YAML file from specific objects within the
4 xref:cfg-obj.adoc[configuration object]:
6 * xref:trace-obj.adoc[Trace object]
7 * xref:trace-type-obj.adoc[Trace type object]
8 * xref:clk-type-obj.adoc[Clock type object]
9 * xref:dst-obj.adoc[Data stream type object]
10 * xref:ert-obj.adoc[Event record type object]
12 Each of the objects above can have an `$include` property which is a
13 sequence of names of files to include.
15 By choosing where to include partial YAML files strategically, you can
16 split a configuration object into multiple reusable parts for different
19 == Inclusion file search
21 barectf tries to find each file of an `$include` property sequence in
24 When using the `barectf` CLI tool's
25 xref:cli:usage.adoc#generate-command[`generate`] or
26 xref:cli:usage.adoc#show-effective-configuration-command[`show-effective-configuration`]
27 commands, the inclusion directory search order is:
30 xref:cli:usage.adoc#generate-include-dir-option[`+--include-dir+`]
33 . The current working directory.
35 . The directory containing the <<std,standard inclusion files>> (like
36 `stdint.yaml` and `stdmisc.yaml`).
38 By default, if `barectf` can't find an inclusion file, the command
39 prints an error and xref:cli:usage.adoc#exit-status[exits] with a
40 non-zero status. Force `barectf` to continue silently instead with its
41 xref:cli:usage.adoc#generate-ignore-include-not-found-option[`+--ignore-include-not-found+`]
46 With the `$include` property, an object _includes_ the properties of
47 one or more YAML documents.
49 barectf processes the items of the `$include` property sequence
52 When an object __**A**__ includes a YAML document __**B**__, the
53 _effective_ object is __**A**__ "`patching`" __**B**__.
55 include::partial$patching-rules-table.adoc[]
59 .Override scalar property (xref:ert-obj.adoc[event record type object]).
72 .Overlay event record type object
79 .Effective event record type object
91 .Add and override scalar properties (xref:clk-type-obj.adoc[clock type object]).
101 .Overlay clock type object
104 $include: [base.yaml]
106 origin-is-unix-epoch: false
109 .Effective clock type object
115 origin-is-unix-epoch: false
119 .Append to sequence property (xref:trace-type-obj.adoc[trace type object]).
126 class: signed-enumeration
134 .Overlay trace type object
137 $include: [base.yaml]
147 .Effective trace type object
152 class: signed-enumeration
164 .Add to nested mapping property (event record type object).
169 specific-context-field-type:
176 .Overlay event record type object
179 $include: [base.yaml]
180 specific-context-field-type:
187 element-field-type: uint8
191 .Effective event record type object
194 specific-context-field-type:
203 element-field-type: uint8
208 == Standard partial YAML files
210 The barectf project ships with a few "`standard`" partial YAML files
211 to be included from a xref:trace-type-obj.adoc[trace type object]:
213 https://github.com/efficios/barectf/blob/stable-{page-component-version}/barectf/include/3/stdint.yaml[`stdint.yaml`]::
214 Standard xref:int-ft-obj.adoc[integer]
215 xref:trace-type-obj.adoc#ft-aliases-prop[field type aliases], like
216 `uint8`, `byte-packed-sint16`, and `bit-packed-uint64`.
218 https://github.com/efficios/barectf/blob/stable-{page-component-version}/barectf/include/3/stdreal.yaml[`stdreal.yaml`]::
219 Standard xref:real-ft-obj.adoc[real] field type aliases, like
220 `float` and `double`.
222 https://github.com/efficios/barectf/blob/stable-{page-component-version}/barectf/include/3/stdmisc.yaml[`stdmisc.yaml`]::
223 The `string` and `str` xref:str-ft-obj.adoc[string] field type
226 https://github.com/efficios/barectf/blob/stable-{page-component-version}/barectf/include/3/lttng-ust-log-levels.yaml[`lttng-ust-log-levels.yaml`]::
227 xref:trace-type-obj.adoc#ll-aliases-prop[Log level aliases] which
228 correspond to the https://lttng.org/[LTTng-UST] log levels.