From: Mathieu Desnoyers Date: Tue, 9 Nov 2021 20:27:28 +0000 (-0500) Subject: Refactoring: use lttng_get_event_list_head_from_enabler in event create X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=959f4d6a83af6c4320437270892d8bc2ea8248bc;p=lttng-ust.git Refactoring: use lttng_get_event_list_head_from_enabler in event create Signed-off-by: Mathieu Desnoyers Change-Id: I267b9b906d5ebcb1838d792c2ef2002da7db7191 --- diff --git a/src/lib/lttng-ust/lttng-events.c b/src/lib/lttng-ust/lttng-events.c index 78a560c2..c8746ea1 100644 --- a/src/lib/lttng-ust/lttng-events.c +++ b/src/lib/lttng-ust/lttng-events.c @@ -1029,11 +1029,11 @@ int lttng_event_recorder_create(struct lttng_event_recorder_enabler *event_recor const struct lttng_ust_event_desc *desc) { struct lttng_ust_event_ht *events_ht = lttng_get_event_ht_from_enabler(&event_recorder_enabler->parent.parent); + struct cds_list_head *event_list_head = lttng_get_event_list_head_from_enabler(&event_recorder_enabler->parent.parent); char name[LTTNG_UST_ABI_SYM_NAME_LEN] = { 0 }; char key_string[LTTNG_KEY_TOKEN_STRING_LEN_MAX] = { 0 }; struct lttng_ust_event_common *event; struct lttng_ust_event_common_private *event_priv_iter; - struct lttng_ust_session *session = event_recorder_enabler->chan->parent->session; struct cds_hlist_head *name_head; int ret = 0; @@ -1085,7 +1085,7 @@ int lttng_event_recorder_create(struct lttng_event_recorder_enabler *event_recor DBG("Error (%d) registering event '%s' key '%s' to sessiond", ret, name, key_string); goto sessiond_register_error; } - cds_list_add(&event->priv->node, &session->priv->events_head); + cds_list_add(&event->priv->node, event_list_head); cds_hlist_add_head(&event->priv->name_hlist_node, name_head); return 0; @@ -1103,6 +1103,7 @@ int lttng_event_counter_create(struct lttng_event_counter_enabler *event_counter const struct lttng_ust_event_desc *desc) { struct lttng_ust_event_ht *events_ht = lttng_get_event_ht_from_enabler(&event_counter_enabler->parent.parent); + struct cds_list_head *event_list_head = lttng_get_event_list_head_from_enabler(&event_counter_enabler->parent.parent); char name[LTTNG_UST_ABI_SYM_NAME_LEN] = { 0 }; char key_string[LTTNG_KEY_TOKEN_STRING_LEN_MAX] = { 0 }; struct lttng_ust_event_common *event; @@ -1162,7 +1163,7 @@ int lttng_event_counter_create(struct lttng_event_counter_enabler *event_counter goto sessiond_register_error; } - cds_list_add(&event->priv->node, &event_counter_enabler->chan->parent->session->priv->events_head); + cds_list_add(&event->priv->node, event_list_head); cds_hlist_add_head(&event->priv->name_hlist_node, name_head); return 0; @@ -1180,10 +1181,10 @@ int lttng_event_notifier_create(struct lttng_event_notifier_enabler *event_notif const struct lttng_ust_event_desc *desc) { struct lttng_ust_event_ht *events_ht = lttng_get_event_ht_from_enabler(&event_notifier_enabler->parent); + struct cds_list_head *event_list_head = lttng_get_event_list_head_from_enabler(&event_notifier_enabler->parent); char key_string[LTTNG_KEY_TOKEN_STRING_LEN_MAX] = { 0 }; struct lttng_ust_event_common *event; struct lttng_ust_event_common_private *event_priv; - struct lttng_event_notifier_group *event_notifier_group = event_notifier_enabler->group; char name[LTTNG_UST_ABI_SYM_NAME_LEN]; struct cds_hlist_head *head; struct cds_hlist_node *node; @@ -1215,7 +1216,7 @@ int lttng_event_notifier_create(struct lttng_event_notifier_enabler *event_notif ret = -ENOMEM; goto error; } - cds_list_add(&event->priv->node, &event_notifier_group->event_notifiers_head); + cds_list_add(&event->priv->node, event_list_head); cds_hlist_add_head(&event->priv->name_hlist_node, head); return 0;