LTTNG_ASSERT(node);
LTTNG_ASSERT(_key);
- DIAGNOSTIC_PUSH
- DIAGNOSTIC_IGNORE_INVALID_OFFSETOF
- event = caa_container_of(node, lttng::sessiond::ust::registry_event, _node.node);
- DIAGNOSTIC_POP
-
- LTTNG_ASSERT(event);
+ event = lttng::utils::container_of(node, <tng::sessiond::ust::registry_event::_node);
key = (lttng::sessiond::ust::registry_event *) _key;
/* It has to be a perfect match. First, compare the event names. */
lst::stream_class(channel_id, lst::stream_class::header_type::LARGE),
_key{-1ULL},
_consumer_key{-1ULL},
- _metadata_dumped{false},
_next_event_id{0},
_is_registered_listener{channel_registered_listener},
_event_added_listener{event_added_listener},
/* Set custom match function. */
_events->match_fct = ht_match_event;
_events->hash_fct = ht_hash_event;
+
+ _rcu_head = {};
+ /*
+ * Node's key is initialized by the channel's parent session. Its value is irrelevant to the
+ * channel object itself.
+ */
+ _node = {};
}
void lsu::registry_channel::add_event(
* are matched using the event name and signature.
*/
nptr = cds_lfht_add_unique(_events->ht, _events->hash_fct(event.get(), lttng_ht_seed),
- _events->match_fct, event.get(), &event->_node.node);
- if (nptr != &event->_node.node) {
+ _events->match_fct, event.get(), &event->_node);
+ if (nptr != &event->_node) {
if (buffer_type == LTTNG_BUFFER_PER_UID) {
/*
* This is normal, we just have to send the event id of the
* returned node.
*/
- DIAGNOSTIC_PUSH
- DIAGNOSTIC_IGNORE_INVALID_OFFSETOF
- const auto existing_event = caa_container_of(
- nptr, lttng::sessiond::ust::registry_event, _node.node);
- DIAGNOSTIC_POP
+ const auto existing_event = lttng::utils::container_of(
+ nptr, <tng::sessiond::ust::registry_event::_node);
event_id = existing_event->id;
} else {
LTTNG_THROW_INVALID_ARGUMENT_ERROR(fmt::format(
DIAGNOSTIC_PUSH
DIAGNOSTIC_IGNORE_INVALID_OFFSETOF
- cds_lfht_for_each_entry(_events->ht, &iter.iter, event, _node.node) {
+ cds_lfht_for_each_entry(_events->ht, &iter.iter, event, _node) {
sorted_event_classes.emplace_back(event);
}
DIAGNOSTIC_POP