X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fust-app.c;h=d3c28883c74bea2416d9afb8a5f0db7c87c03f91;hp=823de94785c1a6d6964ed9b165f47d4690d59741;hb=44cdb3a261262ebabea3fb0cae9360ac05e66f2c;hpb=4b5ab17b3aec396cfa096ecac1b990242072d644 diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index 823de9478..d3c28883c 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -45,6 +45,10 @@ #include "notification-thread-commands.h" #include "rotate.h" +struct lttng_ht *ust_app_ht; +struct lttng_ht *ust_app_ht_by_sock; +struct lttng_ht *ust_app_ht_by_notify_sock; + static int ust_app_flush_app_session(struct ust_app *app, struct ust_app_session *ua_sess); @@ -4347,6 +4351,11 @@ int ust_app_start_trace(struct ltt_ust_session *usess, struct ust_app *app) goto end; } + if (ua_sess->enabled) { + pthread_mutex_unlock(&ua_sess->lock); + goto end; + } + /* Upon restart, we skip the setup, already done */ if (ua_sess->started) { goto skip_setup; @@ -4387,6 +4396,7 @@ skip_setup: /* Indicate that the session has been started once */ ua_sess->started = 1; + ua_sess->enabled = 1; pthread_mutex_unlock(&ua_sess->lock); @@ -4476,6 +4486,7 @@ int ust_app_stop_trace(struct ltt_ust_session *usess, struct ust_app *app) } health_code_update(); + ua_sess->enabled = 0; /* Quiescent wait after stopping trace */ pthread_mutex_lock(&app->sock_lock);