Propagate trace format all the way to the consumer
[lttng-tools.git] / src / common / kernel-consumer / kernel-consumer.cpp
index fa3e8a55377213dc5e5e91d6b0c660b6c890caab..4bb2681af603856fc3bfd39dc84e3763116846c4 100644 (file)
 #include <sys/stat.h>
 #include <stdint.h>
 
-#include <bin/lttng-consumerd/health-consumerd.h>
-#include <common/common.h>
-#include <common/kernel-ctl/kernel-ctl.h>
-#include <common/sessiond-comm/sessiond-comm.h>
-#include <common/sessiond-comm/relayd.h>
-#include <common/compat/fcntl.h>
-#include <common/compat/endian.h>
-#include <common/pipe.h>
-#include <common/relayd/relayd.h>
-#include <common/utils.h>
-#include <common/consumer/consumer-stream.h>
-#include <common/index/index.h>
-#include <common/consumer/consumer-timer.h>
-#include <common/optional.h>
-#include <common/buffer-view.h>
-#include <common/consumer/consumer.h>
-#include <common/consumer/metadata-bucket.h>
-
-#include "kernel-consumer.h"
+#include <bin/lttng-consumerd/health-consumerd.hpp>
+#include <common/common.hpp>
+#include <common/kernel-ctl/kernel-ctl.hpp>
+#include <common/sessiond-comm/sessiond-comm.hpp>
+#include <common/sessiond-comm/relayd.hpp>
+#include <common/compat/fcntl.hpp>
+#include <common/compat/endian.hpp>
+#include <common/pipe.hpp>
+#include <common/relayd/relayd.hpp>
+#include <common/utils.hpp>
+#include <common/consumer/consumer-stream.hpp>
+#include <common/index/index.hpp>
+#include <common/consumer/consumer-timer.hpp>
+#include <common/optional.hpp>
+#include <common/buffer-view.hpp>
+#include <common/consumer/consumer.hpp>
+#include <common/consumer/metadata-bucket.hpp>
+
+#include "kernel-consumer.hpp"
 
 extern struct lttng_consumer_global_data the_consumer_data;
 extern int consumer_poll_timeout;
@@ -514,17 +514,12 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
                DBG("consumer_add_channel %" PRIu64, msg.u.channel.channel_key);
                new_channel = consumer_allocate_channel(msg.u.channel.channel_key,
                                msg.u.channel.session_id,
-                               msg.u.channel.chunk_id.is_set ?
-                                               &chunk_id : NULL,
-                               msg.u.channel.pathname,
-                               msg.u.channel.name,
-                               msg.u.channel.relayd_id, msg.u.channel.output,
-                               msg.u.channel.tracefile_size,
-                               msg.u.channel.tracefile_count, 0,
-                               msg.u.channel.monitor,
-                               msg.u.channel.live_timer_interval,
-                               msg.u.channel.is_live,
-                               NULL, NULL);
+                               msg.u.channel.chunk_id.is_set ? &chunk_id : NULL,
+                               msg.u.channel.pathname, msg.u.channel.name, msg.u.channel.relayd_id,
+                               msg.u.channel.output, msg.u.channel.tracefile_size,
+                               msg.u.channel.tracefile_count, 0, msg.u.channel.monitor,
+                               msg.u.channel.live_timer_interval, msg.u.channel.is_live, NULL,
+                               NULL, msg.u.channel.trace_format);
                if (new_channel == NULL) {
                        lttng_consumer_send_error(ctx, LTTCOMM_CONSUMERD_OUTFD_ERROR);
                        goto end_nosignal;
@@ -672,18 +667,10 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
                health_code_update();
 
                pthread_mutex_lock(&channel->lock);
-               new_stream = consumer_stream_create(
-                               channel,
-                               channel->key,
-                               fd,
-                               channel->name,
-                               channel->relayd_id,
-                               channel->session_id,
-                               channel->trace_chunk,
-                               msg.u.stream.cpu,
-                               &alloc_ret,
-                               channel->type,
-                               channel->monitor);
+               new_stream = consumer_stream_create(channel, channel->key, fd, channel->name,
+                               channel->relayd_id, channel->session_id, channel->trace_chunk,
+                               msg.u.stream.cpu, &alloc_ret, channel->type, channel->monitor,
+                               channel->trace_format);
                if (new_stream == NULL) {
                        switch (alloc_ret) {
                        case -ENOMEM:
@@ -1244,9 +1231,13 @@ error_rotate_channel:
        case LTTNG_CONSUMER_INIT:
        {
                int ret_send_status;
+               lttng_uuid sessiond_uuid;
+
+               std::copy(std::begin(msg.u.init.sessiond_uuid), std::end(msg.u.init.sessiond_uuid),
+                               sessiond_uuid.begin());
 
                ret_code = lttng_consumer_init_command(ctx,
-                               msg.u.init.sessiond_uuid);
+                               sessiond_uuid);
                health_code_update();
                ret_send_status = consumer_send_status_msg(sock, ret_code);
                if (ret_send_status < 0) {
This page took 0.027408 seconds and 5 git commands to generate.