relayd: send sessiond uuid and session id as part of create session
[lttng-tools.git] / src / bin / lttng-sessiond / consumer.c
index 12db236d08335c34221c7305527be81c049f97d1..171301ab5688fafc305210d955c5daa94e204977 100644 (file)
@@ -35,6 +35,7 @@
 #include "health-sessiond.h"
 #include "ust-app.h"
 #include "utils.h"
+#include "lttng-sessiond.h"
 
 /*
  * Send a data payload using a given consumer socket of size len.
@@ -1078,7 +1079,8 @@ int consumer_send_relayd_socket(struct consumer_socket *consumer_sock,
                ret = relayd_create_session(rsock,
                                &msg.u.relayd_sock.relayd_session_id,
                                session_name, hostname, session_live_timer,
-                               consumer->snapshot);
+                               consumer->snapshot, session_id,
+                               sessiond_uuid);
                if (ret < 0) {
                        /* Close the control socket. */
                        (void) relayd_close(rsock);
@@ -1894,3 +1896,27 @@ error:
        health_code_update();
        return ret;
 }
+
+int consumer_init(struct consumer_socket *socket,
+               const lttng_uuid sessiond_uuid)
+{
+       int ret;
+       struct lttcomm_consumer_msg msg = {
+               .cmd_type = LTTNG_CONSUMER_INIT,
+       };
+
+       assert(socket);
+
+       DBG("Sending consumer initialization command");
+       lttng_uuid_copy(msg.u.init.sessiond_uuid, sessiond_uuid);
+
+       health_code_update();
+       ret = consumer_send_msg(socket, &msg);
+       if (ret < 0) {
+               goto error;
+       }
+
+error:
+       health_code_update();
+       return ret;
+}
This page took 0.029175 seconds and 5 git commands to generate.