Clean-up: sessiond: rename public accessors
[lttng-tools.git] / src / bin / lttng-sessiond / ust-registry.hpp
index 627ae06c0a65ee91aa058e75123f8113df8042cd..2095cdda3ab3f15c8b04f7794971b784d241b0f7 100644 (file)
@@ -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 <common/format.hpp>
 #include <common/hashtable/hashtable.hpp>
@@ -43,21 +42,10 @@ struct ust_app;
 namespace lttng {
 namespace sessiond {
 namespace ust {
-namespace details {
 
-template <class MappingIntegerType>
-typename trace::typed_enumeration_type<MappingIntegerType>::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 <class MappingIntegerType>
 typename trace::typed_enumeration_type<MappingIntegerType>::mappings mappings_from_ust_ctl_entries(
@@ -65,10 +53,23 @@ typename trace::typed_enumeration_type<MappingIntegerType>::mappings mappings_fr
 {
        typename trace::typed_enumeration_type<MappingIntegerType>::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<MappingIntegerType>(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;
@@ -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 */
This page took 0.047192 seconds and 4 git commands to generate.