.gitignore: ignore local vscode workspace settings file
[lttng-tools.git] / src / bin / lttng-sessiond / ust-field-convert.hpp
index f570e65ed843726c88e604d8078478f36118a83e..063abcd6808f9eae972e819dedebb16d2b91237a 100644 (file)
@@ -9,19 +9,45 @@
 #define LTTNG_UST_FIELD_CONVERT_H
 
 #include "field.hpp"
+#include "ust-registry-session.hpp"
 #include "ust-registry.hpp"
 
 #include <cstddef>
+#include <type_traits>
 #include <vector>
 
 namespace lttng {
 namespace sessiond {
 namespace ust {
 
-std::vector<trace::field::cuptr> create_trace_fields_from_ust_ctl_fields(
-               const ust_registry_session& session,
-               const lttng_ust_ctl_field *fields,
-               std::size_t field_count);
+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<ctl_field_quirks>::type;
+       return ctl_field_quirks(static_cast<enum_type>(lhs) & static_cast<enum_type>(rhs));
+}
+
+inline ctl_field_quirks operator|(ctl_field_quirks lhs, ctl_field_quirks rhs)
+{
+       using enum_type = std::underlying_type<ctl_field_quirks>::type;
+       return ctl_field_quirks(static_cast<enum_type>(lhs) | static_cast<enum_type>(rhs));
+}
+
+std::vector<trace::field::cuptr>
+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 */
This page took 0.025178 seconds and 4 git commands to generate.