X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fust-app.c;h=e1d0c40e9cf03e34b935a171b1ca8d67686f55f5;hb=c45536e170aa9ba8aeb9ba21da25b7cec73392f6;hp=70a647608a3f8881e36a9e22b004ef66cdbc35dd;hpb=4d710ac2a9cffbfa9e4ebdba4162b8d6ee9020fc;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index 70a647608..e1d0c40e9 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -2252,9 +2252,6 @@ int ust_app_start_trace(struct ltt_ust_session *usess, struct ust_app *app) } } - /* Indicate that the session has been started once */ - ua_sess->started = 1; - ret = create_ust_app_metadata(ua_sess, usess->pathname, app); if (ret < 0) { ret = LTTNG_ERR_UST_META_FAIL; @@ -2352,6 +2349,9 @@ skip_setup: goto error_rcu_unlock; } + /* Indicate that the session has been started once */ + ua_sess->started = 1; + health_code_update(&health_thread_cmd); /* Quiescent wait after starting trace */ @@ -2393,10 +2393,13 @@ int ust_app_stop_trace(struct ltt_ust_session *usess, struct ust_app *app) /* * 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. + * that was never started. It's possible since we can have a fail start + * from either the application manager thread or the command thread. Simply + * indicate that this is a stop error. */ - assert(ua_sess->started == 1); + if (ua_sess->started == 1) { + goto error_rcu_unlock; + } health_code_update(&health_thread_cmd);