X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fust-registry.hpp;h=29872a20fc5ddc192f0cdb8b0012a8ead3b175a7;hb=cd9adb8b829564212158943a0d279bb35322ab30;hp=627ae06c0a65ee91aa058e75123f8113df8042cd;hpb=b0f2e8db59fcadc8f4b06a94175792be3c431004;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/ust-registry.hpp b/src/bin/lttng-sessiond/ust-registry.hpp index 627ae06c0..29872a20f 100644 --- a/src/bin/lttng-sessiond/ust-registry.hpp +++ b/src/bin/lttng-sessiond/ust-registry.hpp @@ -18,7 +18,6 @@ #include "ust-clock-class.hpp" #include "ust-registry-channel.hpp" #include "ust-registry-event.hpp" -#include "ust-registry-session.hpp" #include #include @@ -43,21 +42,10 @@ struct ust_app; namespace lttng { namespace sessiond { namespace ust { -namespace details { -template -typename trace::typed_enumeration_type::mapping mapping_from_ust_ctl_entry( - const lttng_ust_ctl_enum_entry& entry) -{ - if (entry.u.extra.options & LTTNG_UST_CTL_UST_ENUM_ENTRY_OPTION_IS_AUTO) { - return {entry.string}; +class registry_session; - } else { - return {entry.string, - {(MappingIntegerType) entry.start.value, - (MappingIntegerType) entry.end.value}}; - } -} +namespace details { template typename trace::typed_enumeration_type::mappings mappings_from_ust_ctl_entries( @@ -65,10 +53,23 @@ typename trace::typed_enumeration_type::mappings mappings_fr { typename trace::typed_enumeration_type::mappings mappings; + MappingIntegerType next_range_begin = 0; for (size_t entry_idx = 0; entry_idx < in_entry_count; entry_idx++) { const auto& entry = in_entries[entry_idx]; - - mappings.emplace_back(mapping_from_ust_ctl_entry(entry)); + MappingIntegerType range_begin, range_end; + + if (entry.u.extra.options & LTTNG_UST_CTL_UST_ENUM_ENTRY_OPTION_IS_AUTO) { + range_begin = range_end = next_range_begin; + } else { + range_begin = (MappingIntegerType) entry.start.value; + range_end = (MappingIntegerType) entry.end.value; + } + + next_range_begin = range_end + 1; + mappings.emplace_back(entry.string, + typename trace::typed_enumeration_type< + MappingIntegerType>::mapping::range_t{ + range_begin, range_end}); } return mappings; @@ -120,7 +121,7 @@ public: _mappings; protected: - virtual bool _is_equal(const registry_enum& base_other) const noexcept + bool _is_equal(const registry_enum& base_other) const noexcept override { const auto &other = static_cast(base_other); @@ -173,15 +174,6 @@ void ust_registry_session_destroy(lttng::sessiond::ust::registry_session *sessio void ust_registry_channel_destroy_event(lttng::sessiond::ust::registry_channel *chan, lttng::sessiond::ust::registry_event *event); -int ust_registry_create_or_find_enum(lttng::sessiond::ust::registry_session *session, - int session_objd, char *name, - struct lttng_ust_ctl_enum_entry *entries, size_t nr_entries, - uint64_t *enum_id); -lttng::sessiond::ust::registry_enum::const_rcu_protected_reference -ust_registry_lookup_enum_by_id(const lttng::sessiond::ust::registry_session *session, - const char *name, uint64_t id); -void ust_registry_destroy_enum(lttng::sessiond::ust::registry_session *reg_session, - lttng::sessiond::ust::registry_enum *reg_enum); #else /* HAVE_LIBLTTNG_UST_CTL */ static inline @@ -262,33 +254,6 @@ int ust_metadata_event_statedump( return 0; } -static inline -int ust_registry_create_or_find_enum( - lttng::sessiond::ust::registry_session *session __attribute__((unused)), - int session_objd __attribute__((unused)), - char *name __attribute__((unused)), - struct lttng_ust_ctl_enum_entry *entries __attribute__((unused)), - size_t nr_entries __attribute__((unused)), - uint64_t *enum_id __attribute__((unused))) -{ - return 0; -} - -static inline -struct ust_registry_enum * - ust_registry_lookup_enum_by_id( - const lttng::sessiond::ust::registry_session *session __attribute__((unused)), - const char *name __attribute__((unused)), - uint64_t id __attribute__((unused))) -{ - return NULL; -} - -static inline -void ust_registry_destroy_enum(lttng::sessiond::ust::registry_session *reg_session __attribute__((unused)), - struct ust_registry_enum *reg_enum __attribute__((unused))) -{} - #endif /* HAVE_LIBLTTNG_UST_CTL */ #endif /* LTTNG_UST_REGISTRY_H */