1 = What's new in barectf{nbsp}3?
3 barectf{nbsp}3 is a major update of the project.
5 The main, user-visible changes are:
7 * Support for user-defined
8 xref:yaml:static-array-ft-obj.adoc[static] and
9 xref:yaml:dyn-array-ft-obj.adoc[dynamic array field types].
11 * Reworked `barectf` Python API to match the recent CTF terminology and
12 model (like https://babeltrace.org/[Babeltrace{nbsp}2] and the
15 * Reworked xref:yaml:index.adoc[YAML configuration] format to match the
18 barectf{nbsp}3 can still read and use barectf{nbsp}2 YAML
23 ** Updated terminology for property names and values.
24 ** The xref:yaml:cfg-obj.adoc[configuration object] mapping (the YAML
25 document) must be tagged with `tag:barectf.org,2020/3/config`.
26 ** The configuration object contains a xref:yaml:trace-obj.adoc[trace
27 object] which contains a xref:yaml:trace-type-obj.adoc[trace type
30 A trace can have an environment while a trace type can have a UUID.
32 ** You can specify two
33 xref:yaml:cfg-obj.adoc#prefix-obj[prefixes] instead of a
34 single one: a file name prefix and an identifier prefix.
36 With barectf{nbsp}2, the single prefix `my_app_` becomes the file name
37 prefix `my_app` and the identifier prefix `my_app_`.
39 ** You don't need to specify special CTF structure field type members,
40 like `magic`, `stream_id`, and `timestamp`.
43 xref:yaml:trace-type-obj.adoc#features-obj[trace type] and
44 xref:yaml:dst-obj.adoc#features-obj[data stream type
45 features]. You can still control the exact field type of a feature.
47 ** A data stream type can have zero or one
48 xref:yaml:dst-obj.adoc#def-clk-type-name-prop[default clock type].
50 When a data stream type has a default clock type, its timestamp integer
51 field types (packet beginning, packet end, and event record)
52 automatically refer to this specific clock type, effectively removing
53 the integer field type's `property-mappings` property.
55 ** The only way to make a data stream type the default one is with its
56 xref:yaml:dst-obj.adoc#is-def-prop[`$is-default`
59 ** You cannot specify custom
60 xref:how-barectf-works:ctf-primer.adoc#pkt[packet] header and
61 xref:how-barectf-works:ctf-primer.adoc#er[event record]
62 header field type members anymore.
64 The header field types only exist for the trace format itself.
67 xref:yaml:dst-obj.adoc#pkt-ctx-ft-extra-members-prop[append user-defined
68 members to the packet context field type]
70 xref:yaml:dst-obj.adoc#er-common-ctx-ft-prop[event record common context
73 ** xref:yaml:trace-type-obj.adoc#ft-aliases-prop[Field type aliases]
74 do not need to be defined in any specific order.
75 ** An xref:yaml:int-ft-obj.adoc[integer field type] _is_ a bit array
78 A bit array field type has size and alignment properties. It doesn't
79 have a byte order property: as of barectf{nbsp}3.0, the generated tracer
80 always uses the native byte order.
82 ** An integer field type doesn't have a `signed` property: unsigned
83 and signed integer field types are two different classes.
84 ** An xref:yaml:enum-ft-obj.adoc[enumeration field type] _is_ an integer
86 ** The xref:yaml:enum-ft-obj.adoc#mappings-prop[mappings] of an
87 enumeration field type are a YAML mapping of labels to sequences of
89 ** A xref:yaml:real-ft-obj.adoc[real field type] _is_ a bit array field
91 ** The xref:yaml:struct-ft-obj.adoc#members-prop[members] of a structure
92 field type are a sequence instead of a mapping (YAML mappings are
95 This sequence is considered to be an _ordered mapping_, similar to
96 YAML's https://yaml.org/type/omap.html[`+!!omap+`] type.
98 * Updated xref:yaml:include.adoc#std[standard partial YAML files] for
99 the new YAML configuration format.
101 * The xref:cli:usage.adoc[`barectf` CLI tool] now has a Git-like user
102 interface with a few commands.
104 The `barectf` CLI tool remains backward compatible with barectf{nbsp}2's
105 CLI: the default command is
106 xref:cli:usage.adoc#generate-command[`generate`].
108 * The generated C{nbsp}code is ``const``-correct.