X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=lttng-sessiond%2Fmain.c;h=54dcbdff06f68965b8f2923160825e180bfe65c9;hp=9464c2c1b8e0f4f3d17ef300cf15975d2174c6ec;hb=88ff5b7f958a7bb60723d10ed97ceb79f9913167;hpb=8be98f9a4419d360bce0678981ba3f4b891b0a19 diff --git a/lttng-sessiond/main.c b/lttng-sessiond/main.c index 9464c2c1b..54dcbdff0 100644 --- a/lttng-sessiond/main.c +++ b/lttng-sessiond/main.c @@ -305,8 +305,14 @@ static void teardown_kernel_session(struct ltt_session *session) */ static void teardown_ust_session(struct ltt_session *session) { + int ret; + DBG("Tearing down UST session(s)"); + ret = ust_app_destroy_trace_all(session->ust_session); + if (ret) { + ERR("Error in ust_app_destroy_trace_all"); + } trace_ust_destroy_session(session->ust_session); } @@ -1054,9 +1060,10 @@ static void *thread_manage_apps(void *data) /* Register applicaton to the session daemon */ ret = ust_app_register(&ust_cmd.reg_msg, ust_cmd.sock); - if (ret < 0) { - /* Only critical ENOMEM error can be returned here */ + if (ret == -ENOMEM) { goto error; + } else if (ret < 0) { + break; } /* @@ -2676,6 +2683,8 @@ static int cmd_destroy_session(struct ltt_session *session, char *name) /* Clean kernel session teardown */ teardown_kernel_session(session); + /* UST session teardown */ + teardown_ust_session(session); /* * Must notify the kernel thread here to update it's poll setin order @@ -2814,14 +2823,14 @@ static ssize_t cmd_list_channels(int domain, struct ltt_session *session, if (session->kernel_session != NULL) { nb_chan = session->kernel_session->channel_count; } - DBG3("Number of kernel channels %ld", nb_chan); + DBG3("Number of kernel channels %zd", nb_chan); break; case LTTNG_DOMAIN_UST: if (session->ust_session != NULL) { nb_chan = hashtable_get_count( session->ust_session->domain_global.channels); } - DBG3("Number of UST global channels %ld", nb_chan); + DBG3("Number of UST global channels %zd", nb_chan); break; default: *channels = NULL;