Add CTF IR classes specific to `src.ctf.*`
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 21 May 2024 17:33:14 +0000 (13:33 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 4 Sep 2024 19:05:14 +0000 (15:05 -0400)
commit1c70ff4a25e82ac360acc6751b31d45db0d358cd
tree27870591add67ba23872aaeafac514e8d446e45f
parent627a24fd9cba5f6ffe61709f8ffb86a73b1e627e
Add CTF IR classes specific to `src.ctf.*`

This patch uses the `ctf::ir` API to expose a source-specific CTF IR API
under the `ctf::src` namespace, to be used by both the `src.ctf.fs` and
the `src.ctf.lttng-live` component classes.

This specific CTF IR API augments the common `ctf::ir` API with user
mixins to add the following:

• Any field class has a "deep type".

  See the comment of `ctf::src::FcDeepType` to understand why we need
  such an enumeration.

• The field class, clock class, event record class, data stream class,
  and trace class classes have an optional equivalent libbabeltrace2
  class object.

  This is a bridge between the CTF IR world and the libbabeltrace2 world
  to be able to create corresponding libbabeltrace2 messages when
  decoding a data stream with the CTF IR classes.

  If a field class has no equivalent libbabeltrace2 class, then the
  values of its instances aren't transported through messages as
  field objects.

• A clock class object may hold its equivalent libbabeltrace2 class
  (owned, shared reference).

• A trace class object may hold its equivalent libbabeltrace2 class
  (owned, shared reference).

• Boolean and integer field classes have an optional "key value"
  saving index.

  See the comment of the `ctf::src::KeyValSavingIndexes` alias to
  learn more.

• Dynamic-length, optional, and variant field classes have a saved
  key value index.

  Again, see the comment of `ctf::src::KeyValSavingIndexes` to
  learn more.

• Field class and field location mixins have an optional text
  location member.

  This will help with precise metadata stream error reporting.

• A trace class contains the maximum number of saved key values for
  its instance.

  Once more, see the comment of `ctf::src::KeyValSavingIndexes` to
  learn more.

The new API adds templateless aliases for all the configurable CTF IR
types, for example `src::ctf::FixedLenIntFc`.

The new API also offers user mixin agnostic functions to create all its
CTF IR objects. For example, call ctf::src::createDynLenBlobFc() to
create a `ctf::src` dynamic-length BLOB field class.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I854d5562778e05f4c438a4e937758bbce114f951
Reviewed-on: https://review.lttng.org/c/babeltrace/+/7840
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12255
Tested-by: jenkins <jenkins@lttng.org>
CI-Build: Simon Marchi <simon.marchi@efficios.com>
src/Makefile.am
src/plugins/ctf/common/metadata/ctf-ir.hpp
src/plugins/ctf/common/src/metadata/ctf-ir.cpp [new file with mode: 0644]
src/plugins/ctf/common/src/metadata/ctf-ir.hpp [new file with mode: 0644]
This page took 0.024995 seconds and 4 git commands to generate.