sink.ctf.fs: write option field classes and fields
This patch makes a `sink.ctf.fs` component handle option field classes
and fields. Because CTF 1.8 has no option field class type, it makes a
best effort and translates it to a variant field class with two
options:
* An empty structure field class (option field contains nothing).
* The optional field class itself.
The tag field class is always generated before the variant field class
and is an 8-bit unsigned enumeration field class.
For example, a `sink.ctf.fs` component would translate an optional
string field class to:
/*
* This enumeration field class and the following variant field
* class were a trace IR option field class.
*/
enum : integer { size = 8; align = 8; } {
none = 0,
content = 1,
} __module_name_tag;
variant <__module_name_tag> {
struct { } none;
string { encoding = UTF8; } content;
} module_name;
When a `src.ctf.fs` component reads a trace generated by `sink.ctf.fs`
where the input trace IR contained option field classes, the
corresponding variant field classes will stay variant field classes; the
source component has no way to determine if the metadata describes an
option field class or a genuine variant field class. However, the CTF
1.8 to CTF 1.8 scenario will always be unambiguous because a
`src.ctf.fs` component never creates option field classes.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Ib83e011f73795d70cd8545f55ea87e0bf10b68bc
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1901
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
This page took 0.025794 seconds and 4 git commands to generate.