relayd protocol: reply path for close chunk and create session 2.11
[lttng-tools.git] / src / common / kernel-consumer / kernel-consumer.c
index 95c92ba9b961d99821a80d21c339dc466af2924d..29a27134f0e372c8c8295114048537a07dcc6453 100644 (file)
@@ -979,14 +979,14 @@ error_streams_sent_nosignal:
                ret = consumer_send_status_msg(sock, ret_code);
                if (ret < 0) {
                        /* Somehow, the session daemon is not responding anymore. */
-                       goto end_nosignal;
+                       goto end_destroy_channel;
                }
 
                health_code_update();
 
                /* Stop right now if no channel was found. */
                if (!channel) {
-                       goto end_nosignal;
+                       goto end_destroy_channel;
                }
 
                /*
@@ -1002,7 +1002,7 @@ error_streams_sent_nosignal:
                assert(!uatomic_sub_return(&channel->refcount, 1));
 
                consumer_del_channel(channel);
-
+end_destroy_channel:
                goto end_nosignal;
        }
        case LTTNG_CONSUMER_DISCARDED_EVENTS:
@@ -1145,7 +1145,7 @@ error_streams_sent_nosignal:
                ret = consumer_send_status_msg(sock, ret_code);
                if (ret < 0) {
                        /* Somehow, the session daemon is not responding anymore. */
-                       goto end_nosignal;
+                       goto error_rotate_channel;
                }
                if (channel) {
                        /* Rotate the streams that are ready right now. */
@@ -1155,8 +1155,9 @@ error_streams_sent_nosignal:
                                ERR("Rotate ready streams failed");
                        }
                }
-
                break;
+error_rotate_channel:
+               goto end_nosignal;
        }
        case LTTNG_CONSUMER_INIT:
        {
@@ -1249,6 +1250,8 @@ error_streams_sent_nosignal:
                                msg.u.close_trace_chunk.close_command.value;
                const uint64_t relayd_id =
                                msg.u.close_trace_chunk.relayd_id.value;
+               struct lttcomm_consumer_close_trace_chunk_reply reply;
+               char path[LTTNG_PATH_MAX];
 
                ret_code = lttng_consumer_close_trace_chunk(
                                msg.u.close_trace_chunk.relayd_id.is_set ?
@@ -1259,8 +1262,18 @@ error_streams_sent_nosignal:
                                (time_t) msg.u.close_trace_chunk.close_timestamp,
                                msg.u.close_trace_chunk.close_command.is_set ?
                                                &close_command :
-                                               NULL);
-               goto end_msg_sessiond;
+                                               NULL, path);
+               reply.ret_code = ret_code;
+               reply.path_length = strlen(path) + 1;
+               ret = lttcomm_send_unix_sock(sock, &reply, sizeof(reply));
+               if (ret != sizeof(reply)) {
+                       goto error_fatal;
+               }
+               ret = lttcomm_send_unix_sock(sock, path, reply.path_length);
+               if (ret != reply.path_length) {
+                       goto error_fatal;
+               }
+               goto end_nosignal;
        }
        case LTTNG_CONSUMER_TRACE_CHUNK_EXISTS:
        {
This page took 0.024928 seconds and 5 git commands to generate.