lttng-sessiond: rename ust_registry_channel::ht to events
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 6 Jan 2022 17:49:09 +0000 (12:49 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 30 Mar 2022 02:40:17 +0000 (22:40 -0400)
For clarity, rename the field to "events" to indicate that it contains
the channel's events.

Change-Id: I0bd90c13d7c8e313fff72eb18d0d7ebfc23762d4
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/cmd.cpp
src/bin/lttng-sessiond/ust-registry.cpp
src/bin/lttng-sessiond/ust-registry.hpp

index 47c049b319ed9a9f3dbc31f4dda935f8ff31007d..49fa0c6864401f9aa6a95872c7ab9b4bf5e9a307 100644 (file)
@@ -4366,7 +4366,7 @@ int ust_regenerate_metadata(struct ltt_ust_session *usess)
                                                "(err = %d)", ret);
                                goto end;
                        }
-                       cds_lfht_for_each_entry(chan->ht->ht, &iter_event.iter,
+                       cds_lfht_for_each_entry(chan->events->ht, &iter_event.iter,
                                        event, node.node) {
                                ret = ust_metadata_event_statedump(registry,
                                                chan, event);
index effb319994e98a89cabf01f2ad97bad9e37fe8c3..0b92d19c52b3aa459cd22110d7230c753394e1d5 100644 (file)
@@ -368,8 +368,8 @@ struct ust_registry_event *ust_registry_find_event(
        key.name[sizeof(key.name) - 1] = '\0';
        key.signature = sig;
 
-       cds_lfht_lookup(chan->ht->ht, chan->ht->hash_fct(&key, lttng_ht_seed),
-                       chan->ht->match_fct, &key, &iter.iter);
+       cds_lfht_lookup(chan->events->ht, chan->events->hash_fct(&key, lttng_ht_seed),
+                       chan->events->match_fct, &key, &iter.iter);
        node = lttng_ht_iter_get_node_u64(&iter);
        if (!node) {
                goto end;
@@ -446,8 +446,8 @@ int ust_registry_create_event(struct ust_registry_session *session,
         * This is an add unique with a custom match function for event. The node
         * are matched using the event name and signature.
         */
-       nptr = cds_lfht_add_unique(chan->ht->ht, chan->ht->hash_fct(event,
-                               lttng_ht_seed), chan->ht->match_fct, event, &event->node.node);
+       nptr = cds_lfht_add_unique(chan->events->ht, chan->events->hash_fct(event,
+                               lttng_ht_seed), chan->events->match_fct, event, &event->node.node);
        if (nptr != &event->node.node) {
                if (buffer_type == LTTNG_BUFFER_PER_UID) {
                        /*
@@ -514,7 +514,7 @@ void ust_registry_destroy_event(struct ust_registry_channel *chan,
 
        /* Delete the node first. */
        iter.iter.node = &event->node.node;
-       ret = lttng_ht_del(chan->ht, &iter);
+       ret = lttng_ht_del(chan->events, &iter);
        LTTNG_ASSERT(!ret);
 
        call_rcu(&event->node.head, destroy_event_rcu);
@@ -702,9 +702,10 @@ void destroy_channel_rcu(struct rcu_head *head)
        struct ust_registry_channel *chan =
                caa_container_of(head, struct ust_registry_channel, rcu_head);
 
-       if (chan->ht) {
-               lttng_ht_destroy(chan->ht);
+       if (chan->events) {
+               lttng_ht_destroy(chan->events);
        }
+
        free(chan->ctx_fields);
        free(chan);
 }
@@ -731,11 +732,11 @@ static void destroy_channel(struct ust_registry_channel *chan, bool notif)
                }
        }
 
-       if (chan->ht) {
+       if (chan->events) {
                rcu_read_lock();
                /* Destroy all event associated with this registry. */
                cds_lfht_for_each_entry(
-                               chan->ht->ht, &iter.iter, event, node.node) {
+                               chan->events->ht, &iter.iter, event, node.node) {
                        /* Delete the node from the ht and free it. */
                        ust_registry_destroy_event(chan, event);
                }
@@ -762,15 +763,15 @@ int ust_registry_channel_add(struct ust_registry_session *session,
                goto error_alloc;
        }
 
-       chan->ht = lttng_ht_new(0, LTTNG_HT_TYPE_STRING);
-       if (!chan->ht) {
+       chan->events = lttng_ht_new(0, LTTNG_HT_TYPE_STRING);
+       if (!chan->events) {
                ret = -ENOMEM;
                goto error;
        }
 
        /* Set custom match function. */
-       chan->ht->match_fct = ht_match_event;
-       chan->ht->hash_fct = ht_hash_event;
+       chan->events->match_fct = ht_match_event;
+       chan->events->hash_fct = ht_hash_event;
 
        /*
         * Assign a channel ID right now since the event notification comes
index 3bf439f238174e9770d7d2faf31cde2664be4995..39afe90cef224c397a935deb83b72757a94f2145 100644 (file)
@@ -146,7 +146,7 @@ struct ust_registry_channel {
         * Hash table containing events sent by the UST tracer. MUST be accessed
         * with a RCU read side lock acquired.
         */
-       struct lttng_ht *ht;
+       struct lttng_ht *events;
        /* Next event ID available for a newly registered event. */
        uint32_t next_event_id;
        /* Once this value reaches UINT32_MAX, no more id can be allocated. */
This page took 0.032001 seconds and 5 git commands to generate.