X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fkernel-consumer%2Fkernel-consumer.cpp;h=95036a44cc6bdda6dec41d009182807fbbd76650;hb=c9e313bc594f40a86eed237dce222c0fc99c957f;hp=8a6ef2a2760e14b7047785add29632589855cfb3;hpb=947bd0978b3d17b34eb1158cc6439eb1d4e5b6c3;p=lttng-tools.git diff --git a/src/common/kernel-consumer/kernel-consumer.cpp b/src/common/kernel-consumer/kernel-consumer.cpp index 8a6ef2a27..95036a44c 100644 --- a/src/common/kernel-consumer/kernel-consumer.cpp +++ b/src/common/kernel-consumer/kernel-consumer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 Julien Desfossez + * Copyright (C) 2011 EfficiOS Inc. * Copyright (C) 2011 Mathieu Desnoyers * Copyright (C) 2017 Jérémie Galarneau * @@ -20,25 +20,25 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "kernel-consumer.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "kernel-consumer.hpp" extern struct lttng_consumer_global_data the_consumer_data; extern int consumer_poll_timeout; @@ -145,8 +145,7 @@ error: static int lttng_kconsumer_snapshot_channel( struct lttng_consumer_channel *channel, uint64_t key, char *path, uint64_t relayd_id, - uint64_t nb_packets_per_stream, - struct lttng_consumer_local_data *ctx) + uint64_t nb_packets_per_stream) { int ret; struct lttng_consumer_stream *stream; @@ -435,7 +434,6 @@ static int lttng_kconsumer_snapshot_metadata( ret = 0; error_snapshot: metadata_stream->read_subbuffer_ops.unlock(metadata_stream); - cds_list_del(&metadata_stream->send_node); consumer_stream_destroy(metadata_stream, NULL); metadata_channel->metadata_stream = NULL; rcu_read_unlock(); @@ -483,11 +481,17 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, switch (msg.cmd_type) { case LTTNG_CONSUMER_ADD_RELAYD_SOCKET: { + uint32_t major = msg.u.relayd_sock.major; + uint32_t minor = msg.u.relayd_sock.minor; + enum lttcomm_sock_proto protocol = (enum lttcomm_sock_proto) + msg.u.relayd_sock.relayd_socket_protocol; + /* Session daemon status message are handled in the following call. */ consumer_add_relayd_socket(msg.u.relayd_sock.net_index, - msg.u.relayd_sock.type, ctx, sock, consumer_sockpoll, - &msg.u.relayd_sock.sock, msg.u.relayd_sock.session_id, - msg.u.relayd_sock.relayd_session_id); + msg.u.relayd_sock.type, ctx, sock, + consumer_sockpoll, msg.u.relayd_sock.session_id, + msg.u.relayd_sock.relayd_session_id, major, + minor, protocol); goto end_nosignal; } case LTTNG_CONSUMER_ADD_CHANNEL: @@ -984,8 +988,7 @@ error_streams_sent_nosignal: msg.u.snapshot_channel.pathname, msg.u.snapshot_channel.relayd_id, msg.u.snapshot_channel - .nb_packets_per_stream, - ctx); + .nb_packets_per_stream); if (ret_snapshot < 0) { ERR("Snapshot channel failed"); ret_code = LTTCOMM_CONSUMERD_SNAPSHOT_FAILED; @@ -1179,8 +1182,7 @@ end_destroy_channel: ret_rotate_channel = lttng_consumer_rotate_channel( channel, key, - msg.u.rotate_channel.relayd_id, - msg.u.rotate_channel.metadata, ctx); + msg.u.rotate_channel.relayd_id); if (ret_rotate_channel < 0) { ERR("Rotate channel failed"); ret_code = LTTCOMM_CONSUMERD_ROTATION_FAIL; @@ -1199,7 +1201,7 @@ end_destroy_channel: int ret_rotate; ret_rotate = lttng_consumer_rotate_ready_streams( - channel, key, ctx); + channel, key); if (ret_rotate < 0) { ERR("Rotate ready streams failed"); } @@ -1729,7 +1731,7 @@ end: static int put_next_subbuffer(struct lttng_consumer_stream *stream, - struct stream_subbuffer *subbuffer) + struct stream_subbuffer *subbuffer __attribute__((unused))) { const int ret = kernctl_put_next_subbuf(stream->wait_fd); @@ -1761,7 +1763,7 @@ bool is_get_next_check_metadata_available(int tracer_fd) static int signal_metadata(struct lttng_consumer_stream *stream, - struct lttng_consumer_local_data *ctx) + struct lttng_consumer_local_data *ctx __attribute__((unused))) { ASSERT_LOCKED(stream->metadata_rdv_lock); return pthread_cond_broadcast(&stream->metadata_rdv) ? -errno : 0;