relayd: Transmit current trace chunk id in create_sesssion command
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 4 Jul 2019 13:03:54 +0000 (09:03 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 5 Sep 2019 20:39:14 +0000 (16:39 -0400)
The relay daemon needs the current chunk id to query (when it is set)
the sessiond trace chunk registry and retrieve the instance of the
trace chunk if it is already available during the session's
creation.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/relayd/relayd.c
src/common/sessiond-comm/relayd.h

index ed788b993ffed5e27535e92b3e03323ef05a396b..90c6649acc3f7b26cac59b2c89eb706eb74b0d72 100644 (file)
@@ -129,7 +129,8 @@ error:
 static int relayd_create_session_2_11(struct lttcomm_relayd_sock *rsock,
                const char *session_name, const char *hostname,
                int session_live_timer, unsigned int snapshot,
-               uint64_t sessiond_session_id, const lttng_uuid sessiond_uuid)
+               uint64_t sessiond_session_id, const lttng_uuid sessiond_uuid,
+               const uint64_t *current_chunk_id)
 {
        int ret;
        struct lttcomm_relayd_create_session_2_11 *msg = NULL;
@@ -170,6 +171,11 @@ static int relayd_create_session_2_11(struct lttcomm_relayd_sock *rsock,
        lttng_uuid_copy(msg->sessiond_uuid, sessiond_uuid);
        msg->session_id = htobe64(sessiond_session_id);
 
+       if (current_chunk_id) {
+               LTTNG_OPTIONAL_SET(&msg->current_chunk_id,
+                               htobe64(*current_chunk_id));
+       }
+
        /* Send command */
        ret = send_command(rsock, RELAYD_CREATE_SESSION, msg, msg_length, 0);
        if (ret < 0) {
@@ -241,7 +247,8 @@ int relayd_create_session(struct lttcomm_relayd_sock *rsock,
                const char *session_name, const char *hostname,
                int session_live_timer,
                unsigned int snapshot, uint64_t sessiond_session_id,
-               const lttng_uuid sessiond_uuid)
+               const lttng_uuid sessiond_uuid,
+               const uint64_t *current_chunk_id)
 {
        int ret;
        struct lttcomm_relayd_status_session reply;
@@ -262,7 +269,8 @@ int relayd_create_session(struct lttcomm_relayd_sock *rsock,
                /* From 2.11 to ... */
                ret = relayd_create_session_2_11(rsock, session_name,
                                hostname, session_live_timer, snapshot,
-                               sessiond_session_id, sessiond_uuid);
+                               sessiond_session_id, sessiond_uuid,
+                               current_chunk_id);
        }
 
        if (ret < 0) {
index b5948cc4a10b7a9d3d6838d7fd89ef4a63ed5d53..fd456a3a1502311423c18f1b27d887b9d107072d 100644 (file)
@@ -27,6 +27,7 @@
 #include <common/index/ctf-index.h>
 #include <common/macros.h>
 #include <common/compat/uuid.h>
+#include <common/optional.h>
 
 #define RELAYD_VERSION_COMM_MAJOR             VERSION_MAJOR
 #define RELAYD_VERSION_COMM_MINOR             VERSION_MINOR
@@ -211,6 +212,7 @@ struct lttcomm_relayd_create_session_2_11 {
        lttng_uuid sessiond_uuid;
        /* Sessiond session id */
         uint64_t session_id;
+       LTTNG_OPTIONAL_COMM(uint64_t) current_chunk_id;
        /* Contains the session_name and hostname */
        char names[];
 } LTTNG_PACKED;
This page took 0.027078 seconds and 4 git commands to generate.