sessiond: trace-ust.cpp: iterate on list using list_iteration_adapter
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 31 Jul 2024 01:04:45 +0000 (01:04 +0000)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 31 Jul 2024 03:36:52 +0000 (23:36 -0400)
Change-Id: I20a5549e8a93b7fe0d111b72548af8e74d80531a
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/trace-ust.cpp

index 9a4e2b037d4f86fd0b28096c0a24d2a682a9dee8..a298d6f559eb966f9d6ad91c913a0b1b6cd83e7e 100644 (file)
@@ -1319,11 +1319,12 @@ void trace_ust_delete_channel(struct lttng_ht *ht, struct ltt_ust_channel *chann
 int trace_ust_regenerate_metadata(struct ltt_ust_session *usess)
 {
        int ret = 0;
-       struct buffer_reg_uid *uid_reg = nullptr;
        struct buffer_reg_session *session_reg = nullptr;
 
        const lttng::urcu::read_lock_guard read_lock;
-       cds_list_for_each_entry (uid_reg, &usess->buffer_reg_uid_list, lnode) {
+       for (auto uid_reg :
+            lttng::urcu::list_iteration_adapter<buffer_reg_uid, &buffer_reg_uid::lnode>(
+                    usess->buffer_reg_uid_list)) {
                lsu::registry_session *registry;
 
                session_reg = uid_reg->registry;
@@ -1376,8 +1377,6 @@ static void destroy_domain_global(struct ltt_ust_domain_global *dom)
  */
 void trace_ust_destroy_session(struct ltt_ust_session *session)
 {
-       struct buffer_reg_uid *reg, *sreg;
-
        LTTNG_ASSERT(session);
 
        DBG2("Trace UST destroy session %" PRIu64, session->id);
@@ -1397,7 +1396,8 @@ void trace_ust_destroy_session(struct ltt_ust_session *session)
        lttng_ht_destroy(session->agents);
 
        /* Cleanup UID buffer registry object(s). */
-       cds_list_for_each_entry_safe (reg, sreg, &session->buffer_reg_uid_list, lnode) {
+       for (auto reg : lttng::urcu::list_iteration_adapter<buffer_reg_uid, &buffer_reg_uid::lnode>(
+                    session->buffer_reg_uid_list)) {
                cds_list_del(&reg->lnode);
                buffer_reg_uid_remove(reg);
                buffer_reg_uid_destroy(reg, session->consumer);
This page took 0.025426 seconds and 4 git commands to generate.