Add debug statement to the teardown session
[lttng-tools.git] / lttng-sessiond / main.c
index d5b4c8db2c73484fd71571a901a5dc1b4b9633d2..dc71e0eaea851990e8982f7152f5bd043733cdaa 100644 (file)
@@ -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,12 +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)");
 
        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);
 }
 
@@ -1780,10 +1787,7 @@ static int create_ust_session(struct ltt_session *session,
 
        DBG("Creating UST session");
 
-       session_lock_list();
-       uid = session_list_ptr->count;
-       session_unlock_list();
-
+       uid = session->uid;
        lus = trace_ust_create_session(session->path, uid, domain);
        if (lus == NULL) {
                ret = LTTCOMM_UST_SESS_FAIL;
@@ -1918,6 +1922,7 @@ static void list_lttng_channels(int domain, struct ltt_session *session,
                        channels[i].attr.read_timer_interval =
                                uchan->attr.read_timer_interval;
                        channels[i].attr.output = uchan->attr.output;
+                       i++;
                }
                break;
        }
This page took 0.025184 seconds and 4 git commands to generate.