X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fust-app.c;h=335c20ff18556f6df3705be8be6440ff14b1f00e;hb=9bc07046c0e2a572eb3821e276949537614f74e0;hp=bb012b5d84fc0e8b92ace19dde174c2dcb633fef;hpb=d32fb0935e594470f6a7e9ff0797ef101c500797;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index bb012b5d8..335c20ff1 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -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;