Merge branch 'master' of git://git.lttng.org/lttng-tools
[lttng-tools.git] / lttng-sessiond / main.c
index 16dd9ab5dd10d58365f1b04558edf37afcccb71a..fa196e7b033bfe07f97ac994803afc384c6f274c 100644 (file)
@@ -1057,6 +1057,12 @@ static void *thread_manage_apps(void *data)
                                                goto error;
                                        }
 
+                                       /*
+                                        * Add channel(s) and event(s) to newly registered apps
+                                        * from lttng global UST domain.
+                                        */
+                                       update_ust_app(ust_cmd.sock);
+
                                        ret = ustctl_register_done(ust_cmd.sock);
                                        if (ret < 0) {
                                                /*
@@ -1078,11 +1084,6 @@ static void *thread_manage_apps(void *data)
                                                                ust_cmd.sock);
                                        }
 
-                                       /*
-                                        * Add channel(s) and event(s) to newly registered apps
-                                        * from lttng global UST domain.
-                                        */
-                                       update_ust_app(ust_cmd.sock);
                                        break;
                                }
                        } else {
@@ -1097,7 +1098,7 @@ static void *thread_manage_apps(void *data)
                                                goto error;
                                        }
 
-                                       /* Socket closed */
+                                       /* Socket closed on remote end. */
                                        ust_app_unregister(pollfd);
                                        break;
                                }
@@ -2046,7 +2047,7 @@ static int cmd_enable_channel(struct ltt_session *session,
        int ret;
        struct ltt_ust_session *usess = session->ust_session;
 
-       DBG("Enabling channel %s for session %s", session->name, attr->name);
+       DBG("Enabling channel %s for session %s", attr->name, session->name);
 
        switch (domain->type) {
        case LTTNG_DOMAIN_KERNEL:
@@ -2095,7 +2096,7 @@ static int cmd_enable_channel(struct ltt_session *session,
 
                /* Add channel to all registered applications */
                ret = ust_app_add_channel_all(usess, uchan);
-               if (ret != LTTCOMM_OK) {
+               if (ret != 0) {
                        goto error;
                }
 
@@ -2492,10 +2493,11 @@ static int cmd_start_trace(struct ltt_session *session)
 {
        int ret;
        struct ltt_kernel_session *ksession;
-       struct ltt_ust_session *usess = session->ust_session;
+       struct ltt_ust_session *usess;
 
        /* Short cut */
        ksession = session->kernel_session;
+       usess = session->ust_session;
 
        /* Kernel tracing */
        if (ksession != NULL) {
@@ -2552,12 +2554,14 @@ static int cmd_start_trace(struct ltt_session *session)
        }
 
        /* Flag session that trace should start automatically */
-       usess->start_trace = 1;
+       if (usess) {
+               usess->start_trace = 1;
 
-       ret = ust_app_start_trace_all(usess);
-       if (ret < 0) {
-               ret = LTTCOMM_UST_START_FAIL;
-               goto error;
+               ret = ust_app_start_trace_all(usess);
+               if (ret < 0) {
+                       ret = LTTCOMM_UST_START_FAIL;
+                       goto error;
+               }
        }
 
        ret = LTTCOMM_OK;
This page took 0.025055 seconds and 4 git commands to generate.