X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fust-app.cpp;h=08089e77e7c56966ab8f41ef6673949bc4415342;hb=3c3390532736cfb5198f863d0d2b218e21fcf76d;hp=f12262101819d08b9c5d365ee1290de3bcac373b;hpb=c559ee63d6a599e594d65b96298229690685e948;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/ust-app.cpp b/src/bin/lttng-sessiond/ust-app.cpp index f12262101..08089e77e 100644 --- a/src/bin/lttng-sessiond/ust-app.cpp +++ b/src/bin/lttng-sessiond/ust-app.cpp @@ -448,20 +448,14 @@ void delete_ust_app_stream(int sock, struct ust_app_stream *stream, free(stream); } -/* - * 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 delete_ust_app_channel_rcu(struct rcu_head *head) { struct ust_app_channel *ua_chan = caa_container_of(head, struct ust_app_channel, rcu_head); - ht_cleanup_push(ua_chan->ctx); - ht_cleanup_push(ua_chan->events); + lttng_ht_destroy(ua_chan->ctx); + lttng_ht_destroy(ua_chan->events); free(ua_chan); } @@ -895,19 +889,13 @@ end: return ret; } -/* - * 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 delete_ust_app_session_rcu(struct rcu_head *head) { struct ust_app_session *ua_sess = caa_container_of(head, struct ust_app_session, rcu_head); - ht_cleanup_push(ua_sess->channels); + lttng_ht_destroy(ua_sess->channels); free(ua_sess); } @@ -1004,8 +992,6 @@ void delete_ust_app_session(int sock, struct ust_app_session *ua_sess, /* * Delete a traceable application structure from the global list. Never call * this function outside of a call_rcu call. - * - * RCU read side lock should _NOT_ be held when calling this function. */ static void delete_ust_app(struct ust_app *app) @@ -1047,10 +1033,10 @@ void delete_ust_app(struct ust_app *app) rcu_read_unlock(); - ht_cleanup_push(app->sessions); - ht_cleanup_push(app->ust_sessions_objd); - ht_cleanup_push(app->ust_objd); - ht_cleanup_push(app->token_to_event_notifier_rule_ht); + lttng_ht_destroy(app->sessions); + lttng_ht_destroy(app->ust_sessions_objd); + lttng_ht_destroy(app->ust_objd); + lttng_ht_destroy(app->token_to_event_notifier_rule_ht); /* * This could be NULL if the event notifier setup failed (e.g the app @@ -4618,8 +4604,6 @@ error: /* * Free and clean all traceable apps of the global list. - * - * Should _NOT_ be called with RCU read-side lock held. */ void ust_app_clean_list(void) { @@ -4666,13 +4650,13 @@ void ust_app_clean_list(void) /* Destroy is done only when the ht is empty */ if (ust_app_ht) { - ht_cleanup_push(ust_app_ht); + lttng_ht_destroy(ust_app_ht); } if (ust_app_ht_by_sock) { - ht_cleanup_push(ust_app_ht_by_sock); + lttng_ht_destroy(ust_app_ht_by_sock); } if (ust_app_ht_by_notify_sock) { - ht_cleanup_push(ust_app_ht_by_notify_sock); + lttng_ht_destroy(ust_app_ht_by_notify_sock); } }