X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fust-field-convert.hpp;h=063abcd6808f9eae972e819dedebb16d2b91237a;hb=04938faeeb4b28c5791029a2542848534ac83b17;hp=e165cdf1d6e07047af40939c28aad2f41a6d9a34;hpb=eda1aa02582ba8af1f30d40f131f4a32d2b372ab;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/ust-field-convert.hpp b/src/bin/lttng-sessiond/ust-field-convert.hpp index e165cdf1d..063abcd68 100644 --- a/src/bin/lttng-sessiond/ust-field-convert.hpp +++ b/src/bin/lttng-sessiond/ust-field-convert.hpp @@ -9,21 +9,45 @@ #define LTTNG_UST_FIELD_CONVERT_H #include "field.hpp" -#include "ust-registry.hpp" #include "ust-registry-session.hpp" +#include "ust-registry.hpp" #include +#include #include namespace lttng { namespace sessiond { namespace ust { -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); +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, + ctl_field_quirks quirks = ctl_field_quirks::NONE); } /* namespace ust */ } /* namespace sessiond */