Fix double start/stop trace
[lttng-tools.git] / src / bin / lttng-sessiond / ust-app.c
index bb012b5d84fc0e8b92ace19dde174c2dcb633fef..335c20ff18556f6df3705be8be6440ff14b1f00e 100644 (file)
@@ -2037,10 +2037,12 @@ int ust_app_stop_trace(struct ltt_ust_session *usess, struct ust_app *app)
                goto error_rcu_unlock;
        }
 
-       /* Not started, continuing. */
-       if (ua_sess->started == 0) {
-               goto end;
-       }
+       /*
+        * If started = 0, it means that stop trace has been called for a session
+        * that was never started. This is a code flow error and should never
+        * happen.
+        */
+       assert(ua_sess->started == 1);
 
        /* This inhibits UST tracing */
        ret = ustctl_stop_session(app->key.sock, ua_sess->handle);
@@ -2071,8 +2073,6 @@ int ust_app_stop_trace(struct ltt_ust_session *usess, struct ust_app *app)
                                ret);
        }
 
-       ua_sess->started = 0;
-
 end:
        rcu_read_unlock();
        return 0;
This page took 0.023936 seconds and 4 git commands to generate.