#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>
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(
{
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;
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
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 */