Cygwin: Introduce new LTTNG_UST_STREAM_PIPE command to open wakeup pipe
[lttng-tools.git] / src / bin / lttng-sessiond / ust-app.c
index 28b761dc58c149e4292493ef87d0f207792df2b4..5c66776d4901c42ed44b19a591f56c32f188147e 100644 (file)
@@ -894,8 +894,9 @@ static struct ust_app_session *create_ust_app_session(
                if (ret < 0) {
                        ERR("Creating session for app pid %d", app->pid);
                        /* This means that the tracer is gone... */
+                       delete_ust_app_session(-1, ua_sess);
                        ua_sess = (void*) -1UL;
-                       goto error;
+                       goto end;
                }
 
                ua_sess->handle = ret;
@@ -909,10 +910,6 @@ static struct ust_app_session *create_ust_app_session(
 
 end:
        return ua_sess;
-
-error:
-       delete_ust_app_session(-1, ua_sess);
-       return NULL;
 }
 
 /*
@@ -2058,6 +2055,31 @@ int ust_app_start_trace(struct ltt_ust_session *usess, struct ust_app *app)
                goto error_rcu_unlock;
        }
 
+       /* Ask UST to open the write side of the wait pipe */
+       DBG("Asking UST to open metadata stream wait pipe path: %s\n",
+           ua_sess->metadata->stream_obj->wait_pipe_path);
+
+       ret = ustctl_open_wait_pipe(app->sock, ua_sess->metadata->obj);
+
+       if (ret < 0) {
+               ERR("Asking UST to open wait_pipe failed");
+       }
+
+       /* each channel */
+       cds_lfht_for_each_entry(ua_sess->channels->ht, &iter.iter, ua_chan,
+                               node.node) {
+
+               DBG("Asking UST to open channel wait pipe path: %s\n",
+                   ua_chan->obj->wait_pipe_path);
+
+               ret = ustctl_open_wait_pipe(app->sock, ua_chan->obj);
+
+               if (ret < 0) {
+                       ERR("Asking UST to open wait_pipe failed for wait pipe: %s",
+                           ua_chan->obj->wait_pipe_path);
+               }
+       }
+
 skip_setup:
        /* This start the UST tracing */
        ret = ustctl_start_session(app->sock, ua_sess->handle);
@@ -2307,7 +2329,7 @@ void ust_app_global_update(struct ltt_ust_session *usess, int sock)
        }
 
        ua_sess = create_ust_app_session(usess, app);
-       if (ua_sess == NULL) {
+       if (ua_sess == NULL || ua_sess == (void *) -1UL) {
                goto error;
        }
 
This page took 0.033922 seconds and 4 git commands to generate.