Cleanup: ust-app: simplify ust_app_synchronize() error paths
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Tue, 8 Jun 2021 20:14:49 +0000 (16:14 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 11 Jun 2021 20:52:19 +0000 (16:52 -0400)
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I7fd3636dfb1370ebe224aa2e200189b2fe99002a

src/bin/lttng-sessiond/ust-app.c

index a1c681143c90be4afb71390270fb608dcef564e7..4f136550cc32b2dc9aaa277af49fe60e9f664e0a 100644 (file)
@@ -5903,13 +5903,16 @@ void ust_app_synchronize(struct ltt_ust_session *usess,
        ret = find_or_create_ust_app_session(usess, app, &ua_sess, NULL);
        if (ret < 0) {
                /* Tracer is probably gone or ENOMEM. */
-               goto error;
+               if (ua_sess) {
+                       destroy_app_session(app, ua_sess);
+               }
+               goto end;
        }
        assert(ua_sess);
 
        pthread_mutex_lock(&ua_sess->lock);
        if (ua_sess->deleted) {
-               goto end;
+               goto deleted_session;
        }
 
        rcu_read_lock();
@@ -5927,23 +5930,15 @@ void ust_app_synchronize(struct ltt_ust_session *usess,
         */
        ret = create_ust_app_metadata(ua_sess, app, usess->consumer);
        if (ret < 0) {
-               goto error_unlock;
+               ERR("Metadata creation failed for app sock %d for session id %" PRIu64,
+                               app->sock, usess->id);
        }
 
        rcu_read_unlock();
 
-end:
-       pthread_mutex_unlock(&ua_sess->lock);
-       /* Everything went well at this point. */
-       return;
-
-error_unlock:
-       rcu_read_unlock();
+deleted_session:
        pthread_mutex_unlock(&ua_sess->lock);
-error:
-       if (ua_sess) {
-               destroy_app_session(app, ua_sess);
-       }
+end:
        return;
 }
 
This page took 0.031506 seconds and 4 git commands to generate.