X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Fconsumer%2Fconsumer.cpp;h=685d55f838120a4b94cf407d9e420e03cf294e32;hb=c9e313bc594f40a86eed237dce222c0fc99c957f;hp=838990ccedefd7e24d693721140c0eb1924e3d22;hpb=4222116f0098672bbbc0fea2b994e50007929d58;p=lttng-tools.git diff --git a/src/common/consumer/consumer.cpp b/src/common/consumer/consumer.cpp index 838990cce..685d55f83 100644 --- a/src/common/consumer/consumer.cpp +++ b/src/common/consumer/consumer.cpp @@ -7,43 +7,42 @@ * */ -#include "common/index/ctf-index.h" -#include #define _LGPL_SOURCE +#include #include #include +#include #include #include #include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include lttng_consumer_global_data the_consumer_data; @@ -174,7 +173,6 @@ static void clean_channel_stream_list(struct lttng_consumer_channel *channel) /* Delete streams that might have been left in the stream list. */ cds_list_for_each_entry_safe(stream, stmp, &channel->streams.head, send_node) { - cds_list_del(&stream->send_node); /* * Once a stream is added to this list, the buffers were created so we * have a guarantee that this call will succeed. Setting the monitor @@ -3405,7 +3403,7 @@ ssize_t lttng_consumer_read_subbuffer(struct lttng_consumer_stream *stream, */ if (stream->rotate_ready) { DBG("Rotate stream before consuming data"); - ret = lttng_consumer_rotate_stream(ctx, stream); + ret = lttng_consumer_rotate_stream(stream); if (ret < 0) { ERR("Stream rotation error before consuming data"); goto end; @@ -3461,7 +3459,7 @@ ssize_t lttng_consumer_read_subbuffer(struct lttng_consumer_stream *stream, */ rotation_ret = lttng_consumer_stream_is_rotate_ready(stream); if (rotation_ret == 1) { - rotation_ret = lttng_consumer_rotate_stream(ctx, stream); + rotation_ret = lttng_consumer_rotate_stream(stream); if (rotation_ret < 0) { ret = rotation_ret; ERR("Stream rotation error after consuming data"); @@ -3987,8 +3985,7 @@ end: * Returns 0 on success, < 0 on error */ int lttng_consumer_rotate_channel(struct lttng_consumer_channel *channel, - uint64_t key, uint64_t relayd_id, uint32_t metadata, - struct lttng_consumer_local_data *ctx) + uint64_t key, uint64_t relayd_id) { int ret; struct lttng_consumer_stream *stream; @@ -4538,8 +4535,7 @@ void lttng_consumer_reset_stream_rotate_state(struct lttng_consumer_stream *stre * Perform the rotation a local stream file. */ static -int rotate_local_stream(struct lttng_consumer_local_data *ctx, - struct lttng_consumer_stream *stream) +int rotate_local_stream(struct lttng_consumer_stream *stream) { int ret = 0; @@ -4578,8 +4574,7 @@ end: * * Return 0 on success, a negative number of error. */ -int lttng_consumer_rotate_stream(struct lttng_consumer_local_data *ctx, - struct lttng_consumer_stream *stream) +int lttng_consumer_rotate_stream(struct lttng_consumer_stream *stream) { int ret; @@ -4614,7 +4609,7 @@ int lttng_consumer_rotate_stream(struct lttng_consumer_local_data *ctx, } if (stream->net_seq_idx == (uint64_t) -1ULL) { - ret = rotate_local_stream(ctx, stream); + ret = rotate_local_stream(stream); if (ret < 0) { ERR("Failed to rotate stream, ret = %i", ret); goto error; @@ -4658,7 +4653,7 @@ error: * Returns 0 on success, < 0 on error */ int lttng_consumer_rotate_ready_streams(struct lttng_consumer_channel *channel, - uint64_t key, struct lttng_consumer_local_data *ctx) + uint64_t key) { int ret; struct lttng_consumer_stream *stream; @@ -4687,7 +4682,7 @@ int lttng_consumer_rotate_ready_streams(struct lttng_consumer_channel *channel, } DBG("Consumer rotate ready stream %" PRIu64, stream->key); - ret = lttng_consumer_rotate_stream(ctx, stream); + ret = lttng_consumer_rotate_stream(stream); pthread_mutex_unlock(&stream->lock); pthread_mutex_unlock(&stream->chan->lock); if (ret) {