From: Jonathan Rajotte Date: Thu, 31 Oct 2019 21:20:43 +0000 (-0400) Subject: ust-app: remove dead code X-Git-Tag: v2.12.0-rc1~99 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=4b5ab17b3aec396cfa096ecac1b990242072d644;ds=sidebyside ust-app: remove dead code This code path is not possible since all callsite are fenced with a check to "has_been_started". Hence, a session cannot be active at the same time. Change-Id: I53785017989ed7afc8755a41428087d988e5ae88 Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/channel.c b/src/bin/lttng-sessiond/channel.c index 6989fd890..46256208d 100644 --- a/src/bin/lttng-sessiond/channel.c +++ b/src/bin/lttng-sessiond/channel.c @@ -471,15 +471,6 @@ int channel_ust_create(struct ltt_ust_session *usess, goto error_free_chan; } - if (usess->active) { - /* Enable channel for global domain */ - ret = ust_app_create_channel_glb(usess, uchan); - if (ret < 0 && ret != -LTTNG_UST_ERR_EXIST) { - ret = LTTNG_ERR_UST_CHAN_FAIL; - goto error_free_chan; - } - } - /* Adding the channel to the channel hash table. */ rcu_read_lock(); if (strncmp(uchan->name, DEFAULT_METADATA_NAME, diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index b1dba0a09..823de9478 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -4161,88 +4161,6 @@ end: return ret; } -/* - * For a specific UST session, create the channel for all registered apps. - */ -int ust_app_create_channel_glb(struct ltt_ust_session *usess, - struct ltt_ust_channel *uchan) -{ - int ret = 0; - struct cds_lfht_iter iter; - struct ust_app *app; - - assert(usess); - assert(usess->active); - assert(uchan); - - DBG2("UST app adding channel %s to UST domain for session id %" PRIu64, - uchan->name, usess->id); - - rcu_read_lock(); - /* For every registered applications */ - cds_lfht_for_each_entry(ust_app_ht->ht, &iter, app, pid_n.node) { - struct ust_app_session *ua_sess; - int session_was_created = 0; - bool present_in_tracker = - trace_ust_id_tracker_lookup(LTTNG_TRACKER_VPID, - usess, app->pid) && - trace_ust_id_tracker_lookup(LTTNG_TRACKER_VUID, - usess, app->uid) && - trace_ust_id_tracker_lookup(LTTNG_TRACKER_VGID, - usess, app->gid); - - if (!app->compatible || !(present_in_tracker)) { - /* - * This is probably an error this MUST BE TESTED - * Introduced by - * 88e3c2f5610b9ac89b0923d448fee34140fc46fb On app not - * in tracker we should skip it. not sure what to do on - * app !compatible - */ - goto error_rcu_unlock; - } - - /* - * Create session on the tracer side and add it to app session HT. Note - * that if session exist, it will simply return a pointer to the ust - * app session. - */ - ret = find_or_create_ust_app_session(usess, app, &ua_sess, - &session_was_created); - if (ret < 0) { - switch (ret) { - case -ENOTCONN: - /* - * The application's socket is not valid. Either a bad - * socket or a timeout on it. We can't inform the caller - * that for a specific app, the session failed so lets - * continue here; it is not an error. - */ - ret = 0; - goto error_rcu_unlock; - case -ENOMEM: - default: - goto error_rcu_unlock; - } - } - - if (ua_sess->deleted) { - continue; - } - ret = ust_app_channel_create(usess, ua_sess, uchan, app, NULL); - if (ret) { - if (session_was_created) { - destroy_app_session(app, ua_sess); - } - /* Continue to the next application. */ - } - } - -error_rcu_unlock: - rcu_read_unlock(); - return ret; -} - /* * Enable event for a specific session and channel on the tracer. */ diff --git a/src/bin/lttng-sessiond/ust-app.h b/src/bin/lttng-sessiond/ust-app.h index 25aeada65..957d1f95d 100644 --- a/src/bin/lttng-sessiond/ust-app.h +++ b/src/bin/lttng-sessiond/ust-app.h @@ -315,8 +315,6 @@ int ust_app_stop_trace_all(struct ltt_ust_session *usess); int ust_app_destroy_trace_all(struct ltt_ust_session *usess); int ust_app_list_events(struct lttng_event **events); int ust_app_list_event_fields(struct lttng_event_field **fields); -int ust_app_create_channel_glb(struct ltt_ust_session *usess, - struct ltt_ust_channel *uchan); int ust_app_create_event_glb(struct ltt_ust_session *usess, struct ltt_ust_channel *uchan, struct ltt_ust_event *uevent); int ust_app_disable_channel_glb(struct ltt_ust_session *usess, @@ -467,12 +465,6 @@ int ust_app_enable_channel_glb(struct ltt_ust_session *usess, return 0; } static inline -int ust_app_create_channel_glb(struct ltt_ust_session *usess, - struct ltt_ust_channel *uchan) -{ - return 0; -} -static inline int ust_app_create_event_glb(struct ltt_ust_session *usess, struct ltt_ust_channel *uchan, struct ltt_ust_event *uevent) {