X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fdispatch.c;h=22380fcdd58d4f1cdc878be9096ad8bf93a05db5;hb=5c5373c3cbfebddb0068fe13600766bb381048da;hp=52d253d47d3578923d5fbf69c1ce52b438ee5330;hpb=da8734126339713603c25799dcd1dd72726730de;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/dispatch.c b/src/bin/lttng-sessiond/dispatch.c index 52d253d47..22380fcdd 100644 --- a/src/bin/lttng-sessiond/dispatch.c +++ b/src/bin/lttng-sessiond/dispatch.c @@ -36,17 +36,33 @@ static void update_ust_app(int app_sock) { struct ltt_session *sess, *stmp; const struct ltt_session_list *session_list = session_get_list(); + struct ust_app *app; /* Consumer is in an ERROR state. Stop any application update. */ - if (uatomic_read(&ust_consumerd_state) == CONSUMER_ERROR) { + if (uatomic_read(&the_ust_consumerd_state) == CONSUMER_ERROR) { /* Stop the update process since the consumer is dead. */ return; } + rcu_read_lock(); + assert(app_sock >= 0); + app = ust_app_find_by_sock(app_sock); + if (app == NULL) { + /* + * Application can be unregistered before so + * this is possible hence simply stopping the + * update. + */ + DBG3("UST app update failed to find app sock %d", + app_sock); + goto unlock_rcu; + } + + /* Update all event notifiers for the app. */ + ust_app_global_update_event_notifier_rules(app); + /* For all tracing session(s) */ cds_list_for_each_entry_safe(sess, stmp, &session_list->head, list) { - struct ust_app *app; - if (!session_get(sess)) { continue; } @@ -55,26 +71,14 @@ static void update_ust_app(int app_sock) goto unlock_session; } - rcu_read_lock(); - assert(app_sock >= 0); - app = ust_app_find_by_sock(app_sock); - if (app == NULL) { - /* - * Application can be unregistered before so - * this is possible hence simply stopping the - * update. - */ - DBG3("UST app update failed to find app sock %d", - app_sock); - goto unlock_rcu; - } ust_app_global_update(sess->ust_session, app); - unlock_rcu: - rcu_read_unlock(); unlock_session: session_unlock(sess); session_put(sess); } + +unlock_rcu: + rcu_read_unlock(); } /* @@ -231,7 +235,8 @@ static void *thread_dispatch_ust_registration(void *data) rcu_register_thread(); - health_register(health_sessiond, HEALTH_SESSIOND_TYPE_APP_REG_DISPATCH); + health_register(the_health_sessiond, + HEALTH_SESSIOND_TYPE_APP_REG_DISPATCH); if (testpoint(sessiond_thread_app_reg_dispatch)) { goto error_testpoint; @@ -482,7 +487,7 @@ error_testpoint: health_error(); ERR("Health error occurred in %s", __func__); } - health_unregister(health_sessiond); + health_unregister(the_health_sessiond); rcu_unregister_thread(); return NULL; }