dynamic-type: remove underscore prefix from mapping names
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 29 Jul 2022 19:32:57 +0000 (15:32 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 13 Jan 2023 14:46:31 +0000 (09:46 -0500)
commitf63969cc383c919fdad975497d668605783c6c3a
treec8e39c8c4334e4826d45ae8f0635968ab945e249
parent4159f02937a2740abd7f5b113f376b198a86bc71
dynamic-type: remove underscore prefix from mapping names

Dynamic types are expressed by LTTng-UST as a variant + its tag.
Currenly (v2.13 and older), the names of the variant's choices and the
enumeration's entries do not match: enumeration entry names are prefixed
with an underscore.

This worked with older versions of LTTng-tools since all fields in the
TSDL metadata were "escaped" by prepending an underscore, causing the
variant choices to match the enumeration mapping names.

Following a rewrite of the TSDL producer, that no longer systematically
prepends an underscore, I noticed this discrepancy.

Newer LTTng-tools versions using the v10 protocol will assume that a
variant field's choices matches its tag's mapping names exactly, while a
work-around for older supported versions (8 and 9) will strip the
leading underscores from the enumeration mapping names when this
specified combination is found.

Note that the "oldest compatible" version remains unchanged as this
change is not ABI breaking.

There is one scenario where this fix can cause problem: running an older
LTTng-tools (e.g. 2.13) linked against a recent LTTng-UST (2.14+). This
configuration is _not_ supported and versions are properly checked at
build time by LTTng-tools.

In that problematic case, the older LTTng-tools would expect the
enumeration mappings to be prefixed with an underscore and produce an
invalid CTF trace.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Ia7e78096a9c31cd4c0574d599c961067d8f03791
include/lttng/ust-abi.h
src/common/dynamic-type.c
This page took 0.025415 seconds and 4 git commands to generate.