tests/.../data_from_mp.py: add CTF 2 support
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Sun, 12 May 2024 11:31:45 +0000 (07:31 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 4 Sep 2024 19:05:14 +0000 (15:05 -0400)
commit017188ba3a005c447e0eef7ff85f10be26b2b298
treeb0bddc920f4da4fb2d887ad2ae7dd30f95a88d00
parent10f8c9713aa4208f1a86b6a78e1ef623a3aba8f6
tests/.../data_from_mp.py: add CTF 2 support

This patch changes `tests/data/plugins/src.ctf.fs/field/data_from_mp.py`
to add CTF 2 support.

The script generates a CTF 2 trace when the stripped field class text
starts with `{` (full field class) or `"` (field class alias), which are
exclusive to the CTF 2 metadata syntax (any CTF 1.8 field class starts
with some keyword).

The same automatic field class aliases as the CTF 1.8 case
are available.

_make_ctf_2_metadata() doesn't need the `@` replacement trick of
_make_ctf_1_metadata() because CTF 2 array field classes aren't
different from any CTF 2 field class, for example:

    {
      "type": "static-length-array",
      "length": 4,
      "element-field-class": "u8"
    }

vs.

    u8 @[4]

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I6abe0776c64fde62633cfc7a89094c0aedf6b9be
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12770
tests/data/plugins/src.ctf.fs/field/data_from_mp.py
This page took 0.023965 seconds and 4 git commands to generate.