X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=lttng-sessiond%2Fmain.c;h=dc71e0eaea851990e8982f7152f5bd043733cdaa;hb=8f7a84dd224c529cb7a366f6b191d57bf980d339;hp=dd7ee0d4bdc04ecde16be3a2542be76d0c39a2ad;hpb=f470a390fe7dca4ede0a5808426ff0467e5bd4d1;p=lttng-tools.git diff --git a/lttng-sessiond/main.c b/lttng-sessiond/main.c index dd7ee0d4b..dc71e0eae 100644 --- a/lttng-sessiond/main.c +++ b/lttng-sessiond/main.c @@ -335,21 +335,22 @@ error: */ static void teardown_kernel_session(struct ltt_session *session) { - if (session->kernel_session != NULL) { - DBG("Tearing down kernel session"); + if (!session->kernel_session) { + DBG3("No kernel session when tearingdown session"); + return; + } - /* - * If a custom kernel consumer was registered, close the socket before - * tearing down the complete kernel session structure - */ - if (session->kernel_session->consumer_fd != kconsumer_data.cmd_sock) { - lttcomm_close_unix_sock(session->kernel_session->consumer_fd); - } + DBG("Tearing down kernel session"); - trace_kernel_destroy_session(session->kernel_session); - /* Extra precaution */ - session->kernel_session = NULL; + /* + * If a custom kernel consumer was registered, close the socket before + * tearing down the complete kernel session structure + */ + if (session->kernel_session->consumer_fd != kconsumer_data.cmd_sock) { + lttcomm_close_unix_sock(session->kernel_session->consumer_fd); } + + trace_kernel_destroy_session(session->kernel_session); } /* @@ -360,14 +361,18 @@ static void teardown_ust_session(struct ltt_session *session) { int ret; + if (!session->ust_session) { + DBG3("No UST session when tearingdown session"); + return; + } + DBG("Tearing down UST session(s)"); - if (!session->ust_session) - return; 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); }