Refactoring: combine notifier and session-common hash table types
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 8 Nov 2021 19:28:05 +0000 (14:28 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 12 Jul 2024 15:39:52 +0000 (11:39 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Id6b25e25d58c36bf6b5675210c383106c7599d9f

src/common/events.h
src/lib/lttng-ust/lttng-events.c

index 955e307ac9336a4f35b3786ced7414bbc799b3f5..0eb7ecc930d799cfb22ce5459fc0abe666b6a5e0 100644 (file)
@@ -252,12 +252,6 @@ struct lttng_ust_event_ht {
        struct cds_hlist_head table[LTTNG_UST_EVENT_HT_SIZE];
 };
 
-#define LTTNG_UST_EVENT_NOTIFIER_HT_BITS               12
-#define LTTNG_UST_EVENT_NOTIFIER_HT_SIZE               (1U << LTTNG_UST_EVENT_NOTIFIER_HT_BITS)
-struct lttng_ust_event_notifier_ht {
-       struct cds_hlist_head table[LTTNG_UST_EVENT_NOTIFIER_HT_SIZE];
-};
-
 #define LTTNG_UST_ENUM_HT_BITS         12
 #define LTTNG_UST_ENUM_HT_SIZE         (1U << LTTNG_UST_ENUM_HT_BITS)
 
@@ -272,7 +266,7 @@ struct lttng_event_notifier_group {
        struct cds_list_head node;              /* Event notifier group handle list */
        struct cds_list_head enablers_head;
        struct cds_list_head event_notifiers_head; /* list of event_notifiers */
-       struct lttng_ust_event_notifier_ht event_notifiers_ht; /* hashtable of event_notifiers */
+       struct lttng_ust_event_ht event_notifiers_ht; /* hashtable of event notifiers */
        struct lttng_ust_ctx *ctx;              /* contexts for filters. */
 
        struct lttng_ust_channel_counter *error_counter;
index 57c323cfc21f72415931e91f6ecf364842b53a16..4ffba70d19b4bb5d98714b165e3dd1e5cb1a0268 100644 (file)
@@ -229,7 +229,7 @@ struct lttng_event_notifier_group *lttng_event_notifier_group_create(void)
 
        CDS_INIT_LIST_HEAD(&event_notifier_group->enablers_head);
        CDS_INIT_LIST_HEAD(&event_notifier_group->event_notifiers_head);
-       for (i = 0; i < LTTNG_UST_EVENT_NOTIFIER_HT_SIZE; i++)
+       for (i = 0; i < LTTNG_UST_EVENT_HT_SIZE; i++)
                CDS_INIT_HLIST_HEAD(&event_notifier_group->event_notifiers_ht.table[i]);
 
        cds_list_add(&event_notifier_group->node, &event_notifier_groups);
@@ -1041,7 +1041,7 @@ int lttng_event_notifier_create(struct lttng_event_notifier_enabler *event_notif
        lttng_ust_format_event_name(desc, name);
        head = borrow_hash_table_bucket(
                event_notifier_group->event_notifiers_ht.table,
-               LTTNG_UST_EVENT_NOTIFIER_HT_SIZE, name);
+               LTTNG_UST_EVENT_HT_SIZE, name);
 
        cds_hlist_for_each_entry(event_priv, node, head, name_hlist_node) {
                /*
@@ -1430,7 +1430,7 @@ void probe_provider_event_for_each(const struct lttng_ust_probe_desc *provider_d
                        lttng_ust_format_event_name(event_desc, name);
                        head = borrow_hash_table_bucket(
                                event_notifier_group->event_notifiers_ht.table,
-                               LTTNG_UST_EVENT_NOTIFIER_HT_SIZE, name);
+                               LTTNG_UST_EVENT_HT_SIZE, name);
 
                        cds_hlist_for_each_entry_safe(event_priv, node, tmp_node, head, name_hlist_node) {
                                if (event_desc == event_priv->desc) {
This page took 0.026378 seconds and 4 git commands to generate.