ust-app: remove dead code
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Thu, 31 Oct 2019 21:20:43 +0000 (17:20 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 20 Dec 2019 05:30:43 +0000 (00:30 -0500)
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 <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/channel.c
src/bin/lttng-sessiond/ust-app.c
src/bin/lttng-sessiond/ust-app.h

index 6989fd890f788fe32be95ebdd4a77edbf7e9af1d..46256208d58d11fcd2fc2524be97f2a2cbccded8 100644 (file)
@@ -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,
index b1dba0a09cf755384b4c80f4a6491a485160b8f0..823de94785c1a6d6964ed9b165f47d4690d59741 100644 (file)
@@ -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.
  */
index 25aeada6541359505041199a97135e6ab66590d6..957d1f95d7b2bf5d82663e13cd9bb3e4ee1e9e59 100644 (file)
@@ -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)
 {
This page took 0.040273 seconds and 4 git commands to generate.