X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fust-field-convert.hpp;h=c0e663983267c2315c0dcc6e0c2a921b8c7beff4;hp=e165cdf1d6e07047af40939c28aad2f41a6d9a34;hb=63c3462c3dbd028a08f7a9b504c45e178371248d;hpb=def9854df69838c3625360c725739ba865297187 diff --git a/src/bin/lttng-sessiond/ust-field-convert.hpp b/src/bin/lttng-sessiond/ust-field-convert.hpp index e165cdf1d..c0e663983 100644 --- a/src/bin/lttng-sessiond/ust-field-convert.hpp +++ b/src/bin/lttng-sessiond/ust-field-convert.hpp @@ -14,16 +14,40 @@ #include #include +#include namespace lttng { namespace sessiond { namespace ust { +enum class ctl_field_quirks : unsigned int { + NONE = 0, + /* + * LTTng-UST with ABI major version <= 9 express variants with a tag + * enumeration that doesn't match the fields of the variant. The + * tag's mapping names are systematically prefixed with an underscore. + */ + UNDERSCORE_PREFIXED_VARIANT_TAG_MAPPINGS = 1 << 0, +}; + +inline ctl_field_quirks operator&(ctl_field_quirks lhs, ctl_field_quirks rhs) +{ + using enum_type = std::underlying_type::type; + return ctl_field_quirks(static_cast(lhs) & static_cast(rhs)); +} + +inline ctl_field_quirks operator|(ctl_field_quirks lhs, ctl_field_quirks rhs) +{ + using enum_type = std::underlying_type::type; + return ctl_field_quirks(static_cast(lhs) | static_cast(rhs)); +} + std::vector create_trace_fields_from_ust_ctl_fields( const lttng::sessiond::ust::registry_session& session, const lttng_ust_ctl_field *fields, std::size_t field_count, - trace::field_location::root lookup_root); + trace::field_location::root lookup_root, + ctl_field_quirks quirks = ctl_field_quirks::NONE); } /* namespace ust */ } /* namespace sessiond */