`ctf` plugin: add metadata stream parser utilities
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 25 Apr 2024 15:45:38 +0000 (15:45 +0000)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 4 Sep 2024 19:05:14 +0000 (15:05 -0400)
commit79186dfaa4a468bcd8a38c7ac3162e651eaee823
treefc1fda4dd3003a6e2d80b7dc3f8d04aad07d07c9
parentc86bb441466f58d84f1accb3e09fdfd8c9c2e36b
`ctf` plugin: add metadata stream parser utilities

This patch adds:

ctf::src::getMetadataStreamMajorVersion():
    Returns the major version of a metadata stream based on its first
    byte.

ctf::src::createMetadataStreamParser(MetadataStreamMajorVersion, ...):
    Creates and returns a CTF metadata stream parser of which the
    concrete class depends on some major version.

ctf::src::createMetadataStreamParser(const std::uint8_t *, ...):
    Creates and returns a CTF metadata stream parser of which the
    concrete class depends on the first byte of some data.

ctf::src::parseMetadataStream():
    Parses a whole metadata stream, returning the resulting trace class
    and optional metadata stream UUID.

    This is the preferred way to parse a whole metadata stream as it
    calls the static parse() method of some concrete parser class which
    may contain more validation. For example,
    ctf::src::Ctf2MetadataStreamParser::parse() throws if there's no
    resulting trace class or if the current resulting trace class has no
    data stream classes (required by CTF2‑SPEC‑2.0 [1]).

[1]: https://diamon.org/ctf/CTF2-SPEC-2.0.html#metadata-stream

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