Remove ht-cleanup thread
[lttng-tools.git] / src / bin / lttng-sessiond / ust-registry.cpp
index 17346520380b1d67673fd0dfc10c1fc7cf50e704..baa58d73195c4fa3e1f3ab24d7cb730e41349614 100644 (file)
@@ -19,7 +19,6 @@
 #include "lttng-sessiond.h"
 #include "notification-thread-commands.h"
 
-
 /*
  * Hash table match function for event in the registry.
  */
@@ -27,7 +26,6 @@ static int ht_match_event(struct cds_lfht_node *node, const void *_key)
 {
        const struct ust_registry_event *key;
        struct ust_registry_event *event;
-       int i;
 
        LTTNG_ASSERT(node);
        LTTNG_ASSERT(_key);
@@ -46,18 +44,12 @@ static int ht_match_event(struct cds_lfht_node *node, const void *_key)
                goto no_match;
        }
 
-       /* Compare the number of fields. */
-       if (event->nr_fields != key->nr_fields) {
+       /* Compare the arrays of fields. */
+       if (!match_lttng_ust_ctl_field_array(event->fields, event->nr_fields,
+                       key->fields, key->nr_fields)) {
                goto no_match;
        }
 
-       /* Compare each field individually. */
-       for (i = 0; i < event->nr_fields; i++) {
-               if (!match_lttng_ust_ctl_field(&event->fields[i], &key->fields[i])) {
-                       goto no_match;
-               }
-       }
-
        /* Compare model URI. */
        if (event->model_emf_uri != NULL && key->model_emf_uri == NULL) {
                goto no_match;
@@ -697,12 +689,6 @@ static void ust_registry_destroy_enum(struct ust_registry_session *reg_session,
        call_rcu(&reg_enum->rcu_head, destroy_enum_rcu);
 }
 
-/*
- * We need to execute ht_destroy outside of RCU read-side critical
- * section and outside of call_rcu thread, so we postpone its execution
- * using ht_cleanup_push. It is simpler than to change the semantic of
- * the many callers of delete_ust_app_session().
- */
 static
 void destroy_channel_rcu(struct rcu_head *head)
 {
@@ -710,7 +696,7 @@ void destroy_channel_rcu(struct rcu_head *head)
                caa_container_of(head, struct ust_registry_channel, rcu_head);
 
        if (chan->ht) {
-               ht_cleanup_push(chan->ht);
+               lttng_ht_destroy(chan->ht);
        }
        free(chan->ctx_fields);
        free(chan);
@@ -1019,7 +1005,7 @@ void ust_registry_session_destroy(struct ust_registry_session *reg)
                        destroy_channel(chan, true);
                }
                rcu_read_unlock();
-               ht_cleanup_push(reg->channels);
+               lttng_ht_destroy(reg->channels);
        }
 
        free(reg->metadata);
@@ -1051,6 +1037,6 @@ void ust_registry_session_destroy(struct ust_registry_session *reg)
                        ust_registry_destroy_enum(reg, reg_enum);
                }
                rcu_read_unlock();
-               ht_cleanup_push(reg->enums);
+               lttng_ht_destroy(reg->enums);
        }
 }
This page took 0.023968 seconds and 4 git commands to generate.