lib: have dedicated "dynamic array FC with/without length field" types
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 10 Oct 2019 15:35:29 +0000 (11:35 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 15 Oct 2019 19:59:10 +0000 (15:59 -0400)
commit81b8fa4490092c27f40470f1f50a925f768b7b83
tree16c58a9b325f47da0292a4d114ab2cc02bf5d988
parent96eccbbcd37201bf462fe0d655ca77ecb81b7e1e
lib: have dedicated "dynamic array FC with/without length field" types

This is to match what is already done for option and variant field
classes: you can know with their type enumerator whether or not they
have a selector and which type it is.

Now, when you pass `NULL` as the length FC to
bt_field_class_array_dynamic_create(), you get a FC with the type
`BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITHOUT_LENGTH_FIELD`. Otherwise
it is `BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITH_LENGTH_FIELD`.

Now you can only call
bt_field_class_array_dynamic_with_length_field_borrow_length_field_path_const()
with a FC having the type
`BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITH_LENGTH_FIELD`. The way to know
whether or not the dynamic array FC has a length field path is to check
its type.

In the Python bindings, there are dedicated
`_DynamicArrayWithLengthFieldFieldClass` and
`_DynamicArrayWithLengthFieldFieldClassConst` classes to match the
library changes. The `length_field_path` property is only available in
those.

A `sink.text.details` component now writes

    Dynamic array (no length field)

and

    Dynamic array (with length field)

depending on the dynamic array FC's type.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Ibdc0ef1110bf05d517b241ba4f6a9a631ade8a0c
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2169
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
24 files changed:
include/babeltrace2/trace-ir/field-class-const.h
src/bindings/python/bt2/bt2/__init__.py
src/bindings/python/bt2/bt2/field.py
src/bindings/python/bt2/bt2/field_class.py
src/bindings/python/bt2/bt2/trace_class.py
src/common/common.h
src/lib/lib-logging.c
src/lib/trace-ir/field-class.c
src/lib/trace-ir/field-class.h
src/lib/trace-ir/field.c
src/lib/trace-ir/field.h
src/lib/trace-ir/resolve-field-path.c
src/plugins/ctf/common/msg-iter/msg-iter.c
src/plugins/ctf/fs-sink/fs-sink-ctf-meta.h
src/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.c
src/plugins/lttng-utils/debug-info/debug-info.c
src/plugins/lttng-utils/debug-info/trace-ir-data-copy.c
src/plugins/lttng-utils/debug-info/trace-ir-metadata-field-class-copy.c
src/plugins/text/details/write.c
src/plugins/text/pretty/print.c
tests/bindings/python/bt2/test_field_class.py
tests/bindings/python/bt2/test_package.py
tests/data/plugins/src.ctf.fs/succeed/trace-session-rotation.expect
tests/data/plugins/src.ctf.lttng-live/cli-multi-domains.expect
This page took 0.027207 seconds and 4 git commands to generate.