2 * Copyright (C) 2022 Jérémie Galarneau <jeremie.galarneau@efficios.com>
4 * SPDX-License-Identifier: GPL-2.0-only
8 #include "ctf2-trace-class-visitor.hpp"
10 #include "lttng-sessiond.hpp"
11 #include "notification-thread-commands.hpp"
12 #include "session.hpp"
13 #include "trace-class.hpp"
14 #include "tsdl-trace-class-visitor.hpp"
15 #include "ust-app.hpp"
16 #include "ust-field-quirks.hpp"
17 #include "ust-registry-session.hpp"
18 #include "ust-registry.hpp"
20 #include <common/compat/directory-handle.hpp>
21 #include <common/error.hpp>
22 #include <common/exception.hpp>
23 #include <common/format.hpp>
24 #include <common/hashtable/utils.hpp>
25 #include <common/macros.hpp>
26 #include <common/make-unique.hpp>
27 #include <common/pthread-lock.hpp>
28 #include <common/runas.hpp>
29 #include <common/time.hpp>
30 #include <common/urcu.hpp>
34 #include <initializer_list>
39 namespace ls
= lttng::sessiond
;
40 namespace lst
= lttng::sessiond::trace
;
41 namespace lsu
= lttng::sessiond::ust
;
44 lttng_uuid
generate_uuid_or_throw()
48 if (lttng_uuid_generate(new_uuid
)) {
49 LTTNG_THROW_POSIX("Failed to generate UST uuid", errno
);
55 int get_count_order(unsigned int count
)
59 order
= lttng_fls(count
) - 1;
60 if (count
& (count
- 1)) {
64 LTTNG_ASSERT(order
>= 0);
68 void clear_metadata_file(int fd
)
70 const auto lseek_ret
= lseek(fd
, 0, SEEK_SET
);
73 "Failed to seek to the beginning of the metadata file while clearing it",
77 const auto ret
= ftruncate(fd
, 0);
79 LTTNG_THROW_POSIX("Failed to truncate the metadata file while clearing it", errno
);
84 * Validate that the id has reached the maximum allowed or not.
86 bool is_max_channel_id(uint32_t id
)
88 return id
== UINT32_MAX
;
91 void destroy_channel_rcu(struct rcu_head
*head
)
94 DIAGNOSTIC_IGNORE_INVALID_OFFSETOF
95 lsu::registry_channel
*chan
=
96 lttng::utils::container_of(head
, &lsu::registry_channel::_rcu_head
);
103 * Destroy every element of the registry and free the memory. This does NOT
104 * free the registry pointer since it might not have been allocated before so
105 * it's the caller responsability.
107 * Called from ~registry_session(), must not throw.
109 void destroy_channel(lsu::registry_channel
*chan
, bool notify
) noexcept
114 const auto cmd_ret
= notification_thread_command_remove_channel(
115 the_notification_thread_handle
, chan
->_consumer_key
, LTTNG_DOMAIN_UST
);
116 if (cmd_ret
!= LTTNG_OK
) {
117 ERR("Failed to remove channel from notification thread");
122 /* Destroy all event associated with this registry. */
124 lttng::urcu::lfht_iteration_adapter
<lsu::registry_event
,
125 decltype(lsu::registry_event::_node
),
126 &lsu::registry_event::_node
>(
127 *chan
->_events
->ht
)) {
128 /* Delete the node from the ht and free it. */
129 ust_registry_channel_destroy_event(chan
, event
);
133 call_rcu(&chan
->_rcu_head
, destroy_channel_rcu
);
136 void destroy_enum(lsu::registry_enum
*reg_enum
)
145 void destroy_enum_rcu(struct rcu_head
*head
)
148 DIAGNOSTIC_IGNORE_INVALID_OFFSETOF
149 lsu::registry_enum
*reg_enum
=
150 lttng::utils::container_of(head
, &lsu::registry_enum::rcu_head
);
153 destroy_enum(reg_enum
);
157 * Hash table match function for enumerations in the session. Match is
158 * performed on enumeration name, and confirmed by comparing the enum
161 int ht_match_enum(struct cds_lfht_node
*node
, const void *_key
)
163 lsu::registry_enum
*_enum
;
164 const lsu::registry_enum
*key
;
170 DIAGNOSTIC_IGNORE_INVALID_OFFSETOF
171 _enum
= caa_container_of(node
, lsu::registry_enum
, node
.node
);
175 key
= (lsu::registry_enum
*) _key
;
177 return *_enum
== *key
;
181 * Hash table match function for enumerations in the session. Match is
182 * performed by enumeration ID.
184 int ht_match_enum_id(struct cds_lfht_node
*node
, const void *_key
)
186 lsu::registry_enum
*_enum
;
187 const lsu::registry_enum
*key
= (lsu::registry_enum
*) _key
;
193 DIAGNOSTIC_IGNORE_INVALID_OFFSETOF
194 _enum
= caa_container_of(node
, lsu::registry_enum
, node
.node
);
199 if (_enum
->id
!= key
->id
) {
211 * Hash table hash function for enumerations in the session. The
212 * enumeration name is used for hashing.
214 unsigned long ht_hash_enum(void *_key
, unsigned long seed
)
216 lsu::registry_enum
*key
= (lsu::registry_enum
*) _key
;
219 return hash_key_str(key
->name
.c_str(), seed
);
223 void lsu::details::locked_registry_session_release(lsu::registry_session
*session
)
225 pthread_mutex_unlock(&session
->_lock
);
228 lsu::registry_session::registry_session(const struct lst::abi
& in_abi
,
231 const char *root_shm_path
,
232 const char *shm_path
,
235 uint64_t tracing_id
) :
236 lst::trace_class(in_abi
, generate_uuid_or_throw()),
237 _root_shm_path
{ root_shm_path
? root_shm_path
: "" },
238 _shm_path
{ shm_path
? shm_path
: "" },
239 _metadata_path
{ _shm_path
.size() > 0 ? lttng::format("{}/metadata", _shm_path
) :
243 _app_tracer_version
{ .major
= major
, .minor
= minor
},
244 _tracing_id
{ tracing_id
},
245 _clock
{ lttng::make_unique
<lsu::clock_class
>() },
246 _metadata_generating_visitor
{ lttng::make_unique
<ls::tsdl::trace_class_visitor
>(
248 [this](const std::string
& fragment
) { _append_metadata_fragment(fragment
); }) },
249 _packet_header
{ _create_packet_header() }
251 pthread_mutex_init(&_lock
, nullptr);
252 if (_shm_path
.size() > 0) {
253 if (run_as_mkdir_recursive(_shm_path
.c_str(), S_IRWXU
| S_IRWXG
, euid
, egid
)) {
254 LTTNG_THROW_POSIX("run_as_mkdir_recursive", errno
);
258 if (_metadata_path
.size() > 0) {
259 /* Create metadata file. */
260 const int ret
= run_as_open(_metadata_path
.c_str(),
261 O_WRONLY
| O_CREAT
| O_EXCL
,
268 "Failed to open metadata file during registry session creation: path = {}",
276 _enums
.reset(lttng_ht_new(0, LTTNG_HT_TYPE_STRING
));
278 LTTNG_THROW_POSIX("Failed to create enums hash table", ENOMEM
);
281 /* hash/match functions are specified at call site. */
282 _enums
->match_fct
= nullptr;
283 _enums
->hash_fct
= nullptr;
285 _channels
.reset(lttng_ht_new(0, LTTNG_HT_TYPE_U64
));
287 LTTNG_THROW_POSIX("Failed to create channels hash table", ENOMEM
);
291 lst::type::cuptr
lsu::registry_session::_create_packet_header() const
293 lst::structure_type::fields packet_header_fields
;
296 packet_header_fields
.emplace_back(lttng::make_unique
<lst::field
>(
298 lttng::make_unique
<lst::integer_type
>(
299 abi
.uint32_t_alignment
,
302 lst::integer_type::signedness::UNSIGNED
,
303 lst::integer_type::base::HEXADECIMAL
,
304 std::initializer_list
<lst::integer_type::role
>(
305 { lst::integer_type::role::PACKET_MAGIC_NUMBER
}))));
308 packet_header_fields
.emplace_back(lttng::make_unique
<lst::field
>(
310 lttng::make_unique
<lst::static_length_blob_type
>(
313 std::initializer_list
<lst::static_length_blob_type::role
>(
314 { lst::static_length_blob_type::role::METADATA_STREAM_UUID
}))));
316 /* uint32_t stream_id */
317 packet_header_fields
.emplace_back(lttng::make_unique
<lst::field
>(
319 lttng::make_unique
<lst::integer_type
>(
320 abi
.uint32_t_alignment
,
323 lst::integer_type::signedness::UNSIGNED
,
324 lst::integer_type::base::DECIMAL
,
325 std::initializer_list
<lst::integer_type::role
>(
326 { lst::integer_type::role::DATA_STREAM_CLASS_ID
}))));
328 /* uint64_t stream_instance_id */
329 packet_header_fields
.emplace_back(lttng::make_unique
<lst::field
>(
330 "stream_instance_id",
331 lttng::make_unique
<lst::integer_type
>(
332 abi
.uint64_t_alignment
,
335 lst::integer_type::signedness::UNSIGNED
,
336 lst::integer_type::base::DECIMAL
,
337 std::initializer_list
<lst::integer_type::role
>(
338 { lst::integer_type::role::DATA_STREAM_ID
}))));
340 return lttng::make_unique
<lst::structure_type
>(0, std::move(packet_header_fields
));
343 const lst::type
*lsu::registry_session::packet_header() const noexcept
345 return _packet_header
.get();
349 * For a given enumeration in a registry, delete the entry and destroy
352 * Note that this is used by ~registry_session() and must not throw.
354 void lsu::registry_session::_destroy_enum(lsu::registry_enum
*reg_enum
) noexcept
357 const lttng::urcu::read_lock_guard read_lock_guard
;
359 LTTNG_ASSERT(reg_enum
);
360 ASSERT_RCU_READ_LOCKED();
362 /* Delete the node first. */
363 struct lttng_ht_iter iter
;
364 iter
.iter
.node
= ®_enum
->node
.node
;
365 ret
= lttng_ht_del(_enums
.get(), &iter
);
367 call_rcu(®_enum
->rcu_head
, destroy_enum_rcu
);
370 lsu::registry_session::~registry_session()
374 /* On error, EBUSY can be returned if lock. Code flow error. */
375 ret
= pthread_mutex_destroy(&_lock
);
379 /* Destroy all event associated with this registry. */
381 lttng::urcu::lfht_iteration_adapter
<lsu::registry_channel
,
382 decltype(lsu::registry_channel::_node
),
383 &lsu::registry_channel::_node
>(
385 /* Delete the node from the ht and free it. */
386 ret
= cds_lfht_del(_channels
.get()->ht
, &chan
->_node
.node
);
388 destroy_channel(chan
, true);
393 if (_metadata_fd
>= 0) {
394 ret
= close(_metadata_fd
);
399 ret
= run_as_unlink(_metadata_path
.c_str(), _uid
, _gid
);
405 if (_root_shm_path
[0]) {
406 /* Try to delete the directory hierarchy. */
407 (void) run_as_rmdir_recursive(_root_shm_path
.c_str(),
410 LTTNG_DIRECTORY_HANDLE_SKIP_NON_EMPTY_FLAG
);
413 /* Destroy the enum hash table */
415 /* Destroy all enum entries associated with this registry. */
416 for (auto *reg_enum
:
417 lttng::urcu::lfht_iteration_adapter
<lsu::registry_enum
,
418 decltype(lsu::registry_enum::node
),
419 &lsu::registry_enum::node
>(*_enums
->ht
)) {
420 _destroy_enum(reg_enum
);
425 lsu::registry_session::locked_ref
lsu::registry_session::lock() noexcept
427 pthread_mutex_lock(&_lock
);
428 return locked_ref(this);
432 * Initialize registry with default values.
434 void lsu::registry_session::add_channel(uint64_t key
)
436 const lttng::pthread::lock_guard
session_lock_guard(_lock
);
439 * Assign a channel ID right now since the event notification comes
440 * *before* the channel notify so the ID needs to be set at this point so
441 * the metadata can be dumped for that event.
443 if (is_max_channel_id(_used_channel_id
)) {
444 LTTNG_THROW_ERROR(lttng::format(
445 "Failed to allocate unique id for channel under session while adding channel"));
448 auto chan
= new lsu::registry_channel(
449 _get_next_channel_id(),
452 /* Registered channel listener. */
453 [this](const lsu::registry_channel
& registered_channel
) {
455 * Channel registration completed, serialize it's layout's
458 registered_channel
.accept(*_metadata_generating_visitor
);
460 /* Added event listener. */
461 [this](const lsu::registry_channel
& channel
,
462 const lsu::registry_event
& added_event
) {
464 * The channel and its event classes will be dumped at once when
465 * it is registered. This check prevents event classes from being
466 * declared before their stream class.
468 if (channel
.is_registered()) {
469 added_event
.accept(*_metadata_generating_visitor
);
473 const lttng::urcu::read_lock_guard rcu_read_lock_guard
;
474 lttng_ht_node_init_u64(&chan
->_node
, key
);
475 lttng_ht_add_unique_u64(_channels
.get(), &chan
->_node
);
478 lttng::sessiond::ust::registry_channel
& lsu::registry_session::channel(uint64_t channel_key
) const
480 const lttng::urcu::read_lock_guard read_lock_guard
;
481 struct lttng_ht_node_u64
*node
;
482 struct lttng_ht_iter iter
;
484 ASSERT_LOCKED(_lock
);
486 lttng_ht_lookup(_channels
.get(), &channel_key
, &iter
);
487 node
= lttng_ht_iter_get_node
<lttng_ht_node_u64
>(&iter
);
489 LTTNG_THROW_INVALID_ARGUMENT_ERROR(lttng::format(
490 "Invalid channel key provided: channel key = {}", channel_key
));
494 DIAGNOSTIC_IGNORE_INVALID_OFFSETOF
495 auto chan
= lttng::utils::container_of(node
, &lsu::registry_channel::_node
);
500 void lsu::registry_session::remove_channel(uint64_t channel_key
, bool notify
)
502 struct lttng_ht_iter iter
;
504 const lttng::urcu::read_lock_guard read_lock_guard
;
506 ASSERT_LOCKED(_lock
);
507 auto& channel_to_remove
= channel(channel_key
);
509 iter
.iter
.node
= &channel_to_remove
._node
.node
;
510 ret
= lttng_ht_del(_channels
.get(), &iter
);
512 destroy_channel(&channel_to_remove
, notify
);
515 void lsu::registry_session::accept(
516 lttng::sessiond::trace::trace_class_environment_visitor
& visitor
) const
518 ASSERT_LOCKED(_lock
);
520 visitor
.visit(lst::environment_field
<const char *>("domain", "ust"));
521 visitor
.visit(lst::environment_field
<const char *>("tracer_name", "lttng-ust"));
522 visitor
.visit(lst::environment_field
<int64_t>("tracer_major", _app_tracer_version
.major
));
523 visitor
.visit(lst::environment_field
<int64_t>("tracer_minor", _app_tracer_version
.minor
));
524 visitor
.visit(lst::environment_field
<const char *>(
525 "tracer_buffering_scheme",
526 buffering_scheme() == LTTNG_BUFFER_PER_PID
? "pid" : "uid"));
527 visitor
.visit(lst::environment_field
<int64_t>("architecture_bit_width", abi
.bits_per_long
));
530 /* The caller already holds the session and session list locks. */
531 ASSERT_SESSION_LIST_LOCKED();
532 const auto session
= ltt_session::find_session(_tracing_id
);
533 ASSERT_LOCKED(session
->_lock
);
535 visitor
.visit(lst::environment_field
<const char *>(
537 session
->has_auto_generated_name
? DEFAULT_SESSION_NAME
: session
->name
));
538 visitor
.visit(lst::environment_field
<std::string
>(
539 "trace_creation_datetime",
540 lttng::utils::time_to_iso8601_str(session
->creation_time
)));
541 visitor
.visit(lst::environment_field
<const char *>("hostname", session
->hostname
));
545 void lsu::registry_session::_accept_on_clock_classes(lst::trace_class_visitor
& visitor
) const
547 ASSERT_LOCKED(_lock
);
548 _clock
->accept(visitor
);
551 void lsu::registry_session::_accept_on_stream_classes(lst::trace_class_visitor
& visitor
) const
553 ASSERT_LOCKED(_lock
);
555 const lttng::urcu::lfht_iteration_adapter
<lsu::registry_channel
,
556 decltype(lsu::registry_channel::_node
),
557 &lsu::registry_channel::_node
>
558 channels_ht_view(*_channels
->ht
);
559 std::vector
<const lttng::sessiond::ust::registry_channel
*> sorted_stream_classes(
560 channels_ht_view
.begin(), channels_ht_view
.end());
562 std::sort(sorted_stream_classes
.begin(),
563 sorted_stream_classes
.end(),
564 [](const lttng::sessiond::ust::registry_channel
*a
,
565 const lttng::sessiond::ust::registry_channel
*b
) { return a
->id
< b
->id
; });
567 for (const auto *stream_class
: sorted_stream_classes
) {
568 stream_class
->accept(visitor
);
573 * Return next available channel id and increment the used counter. The
574 * is_max_channel_id function MUST be called before in order to validate
575 * if the maximum number of IDs have been reached. If not, it is safe to call
578 * Return a unique channel ID. If max is reached, the used_channel_id counter
581 uint32_t lsu::registry_session::_get_next_channel_id()
583 if (is_max_channel_id(_used_channel_id
)) {
584 return _used_channel_id
;
588 return _next_channel_id
++;
591 void lsu::registry_session::_increase_metadata_size(size_t reservation_length
)
593 const auto new_len
= _metadata_len
+ reservation_length
;
594 auto new_alloc_len
= new_len
;
595 const auto old_alloc_len
= _metadata_alloc_len
;
597 /* Rounding the new allocation length to the next power of 2 would overflow. */
598 if (new_alloc_len
> (UINT32_MAX
>> 1)) {
600 "Failed to reserve trace metadata storage as the new size would overflow");
603 /* The current allocation length is already the largest we can afford. */
604 if ((old_alloc_len
<< 1) > (UINT32_MAX
>> 1)) {
606 "Failed to reserve trace metadata storage as the max size was already reached");
609 if (new_alloc_len
> old_alloc_len
) {
611 std::max
<size_t>(1U << get_count_order(new_alloc_len
), old_alloc_len
<< 1);
613 auto newptr
= (char *) realloc(_metadata
, new_alloc_len
);
615 LTTNG_THROW_POSIX("Failed to allocate trace metadata storage", errno
);
620 /* We zero directly the memory from start of allocation. */
621 memset(&_metadata
[old_alloc_len
], 0, new_alloc_len
- old_alloc_len
);
622 _metadata_alloc_len
= new_alloc_len
;
625 _metadata_len
+= reservation_length
;
628 void lsu::registry_session::_append_metadata_fragment(const std::string
& fragment
)
630 const auto offset
= _metadata_len
;
632 _increase_metadata_size(fragment
.size());
633 memcpy(&_metadata
[offset
], fragment
.c_str(), fragment
.size());
635 if (_metadata_fd
>= 0) {
636 const auto bytes_written
=
637 lttng_write(_metadata_fd
, fragment
.c_str(), fragment
.size());
639 if (bytes_written
!= fragment
.size()) {
640 LTTNG_THROW_POSIX("Failed to write trace metadata fragment to file", errno
);
645 void lsu::registry_session::_reset_metadata()
647 _metadata_len_sent
= 0;
648 memset(_metadata
, 0, _metadata_alloc_len
);
651 if (_metadata_fd
> 0) {
652 /* Clear the metadata file's content. */
653 clear_metadata_file(_metadata_fd
);
657 void lsu::registry_session::_generate_metadata()
659 trace_class::accept(*_metadata_generating_visitor
);
662 void lsu::registry_session::regenerate_metadata()
664 const lttng::pthread::lock_guard
registry_lock(_lock
);
666 /* Resample the clock */
667 _clock
= lttng::make_unique
<lsu::clock_class
>();
671 _generate_metadata();
675 * Lookup enumeration by enum ID.
677 * Note that there is no need to lock the registry session as this only
678 * performs an RCU-protected look-up. The function also return an rcu-protected
679 * reference, which ensures that the caller keeps the RCU read lock until it
680 * disposes of the object.
682 lsu::registry_enum::const_rcu_protected_reference
683 lsu::registry_session::enumeration(const char *enum_name
, uint64_t enum_id
) const
685 lsu::registry_enum
*reg_enum
= nullptr;
686 struct lttng_ht_node_str
*node
;
687 struct lttng_ht_iter iter
;
688 lttng::urcu::unique_read_lock rcu_lock
;
690 * Hack: only the name is used for hashing; the rest of the attributes
693 lsu::registry_signed_enum
reg_enum_lookup(enum_name
, nullptr, 0);
695 ASSERT_RCU_READ_LOCKED();
697 reg_enum_lookup
.id
= enum_id
;
698 cds_lfht_lookup(_enums
->ht
,
699 ht_hash_enum((void *) ®_enum_lookup
, lttng_ht_seed
),
703 node
= lttng_ht_iter_get_node
<lttng_ht_node_str
>(&iter
);
705 LTTNG_THROW_PROTOCOL_ERROR(lttng::format(
706 "Unknown enumeration referenced by application event field: enum name = `{}`, enum id = {}",
712 DIAGNOSTIC_IGNORE_INVALID_OFFSETOF
713 reg_enum
= lttng::utils::container_of(node
, &lsu::registry_enum::node
);
716 return lsu::registry_enum::const_rcu_protected_reference
{ *reg_enum
, std::move(rcu_lock
) };
720 * Lookup enumeration by name and comparing enumeration entries.
721 * Needs to be called from RCU read-side critical section.
724 lsu::registry_session::_lookup_enum(const lsu::registry_enum
*reg_enum_lookup
) const
726 lsu::registry_enum
*reg_enum
= nullptr;
727 struct lttng_ht_node_str
*node
;
728 struct lttng_ht_iter iter
;
730 ASSERT_RCU_READ_LOCKED();
732 cds_lfht_lookup(_enums
->ht
,
733 ht_hash_enum((void *) reg_enum_lookup
, lttng_ht_seed
),
737 node
= lttng_ht_iter_get_node
<lttng_ht_node_str
>(&iter
);
743 DIAGNOSTIC_IGNORE_INVALID_OFFSETOF
744 reg_enum
= lttng::utils::container_of(node
, &lsu::registry_enum::node
);
752 * Create a lsu::registry_enum from the given parameters and add it to the
753 * registry hash table, or find it if already there.
755 * Should be called with session registry mutex held.
757 * We receive ownership of entries.
759 void lsu::registry_session::create_or_find_enum(int session_objd
,
760 const char *enum_name
,
761 struct lttng_ust_ctl_enum_entry
*raw_entries
,
765 struct cds_lfht_node
*nodep
;
766 lsu::registry_enum
*reg_enum
= nullptr, *old_reg_enum
;
767 const lttng::urcu::read_lock_guard read_lock_guard
;
768 auto entries
= lttng::make_unique_wrapper
<lttng_ust_ctl_enum_entry
, lttng::memory::free
>(
771 LTTNG_ASSERT(enum_name
);
774 * This should not happen but since it comes from the UST tracer, an
775 * external party, don't assert and simply validate values.
777 if (session_objd
< 0) {
778 LTTNG_THROW_INVALID_ARGUMENT_ERROR(lttng::format(
779 "Invalid parameters used to create or look-up enumeration from registry session: session_objd = {}",
782 if (nr_entries
== 0) {
783 LTTNG_THROW_INVALID_ARGUMENT_ERROR(lttng::format(
784 "Invalid parameters used to create or look-up enumeration from registry session: nr_entries = {}",
787 if (lttng_strnlen(enum_name
, LTTNG_UST_ABI_SYM_NAME_LEN
) == LTTNG_UST_ABI_SYM_NAME_LEN
) {
788 LTTNG_THROW_INVALID_ARGUMENT_ERROR(
789 "Invalid parameters used to create or look-up enumeration from registry session: enumeration name is not null terminated");
792 if (entries
->start
.signedness
) {
793 reg_enum
= new lsu::registry_signed_enum(enum_name
, entries
.get(), nr_entries
);
795 reg_enum
= new lsu::registry_unsigned_enum(enum_name
, entries
.get(), nr_entries
);
798 old_reg_enum
= _lookup_enum(reg_enum
);
800 DBG("enum %s already in sess_objd: %u", enum_name
, session_objd
);
801 /* Fall through. Use prior enum. */
802 destroy_enum(reg_enum
);
803 reg_enum
= old_reg_enum
;
805 DBG("UST registry creating enum: %s, sess_objd: %u", enum_name
, session_objd
);
806 if (_next_enum_id
== -1ULL) {
807 destroy_enum(reg_enum
);
809 "Failed to allocate unique enumeration ID as it would overflow");
812 reg_enum
->id
= _next_enum_id
++;
813 nodep
= cds_lfht_add_unique(_enums
->ht
,
814 ht_hash_enum(reg_enum
, lttng_ht_seed
),
817 ®_enum
->node
.node
);
818 LTTNG_ASSERT(nodep
== ®_enum
->node
.node
);
821 DBG("UST registry reply with enum %s with id %" PRIu64
" in sess_objd: %u",
825 *enum_id
= reg_enum
->id
;