X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fconsumer%2Fconsumer.c;h=0cfbf5c7c03ef36bf1dc958601babd76e6f3d279;hb=e5212a1dde8128fb55fac4308d54cae575b8305e;hp=3e991c8c71035f6ee9f43f768db27247209e8707;hpb=e098433c90550d74288498f8c4474ef4c2daea68;p=lttng-tools.git diff --git a/src/common/consumer/consumer.c b/src/common/consumer/consumer.c index 3e991c8c7..0cfbf5c7c 100644 --- a/src/common/consumer/consumer.c +++ b/src/common/consumer/consumer.c @@ -808,7 +808,8 @@ int consumer_send_relayd_stream(struct lttng_consumer_stream *stream, pthread_mutex_lock(&relayd->ctrl_sock_mutex); ret = relayd_add_stream(&relayd->control_sock, stream->name, path, &stream->relayd_stream_id, - stream->chan->tracefile_size, stream->chan->tracefile_count); + stream->chan->tracefile_size, stream->chan->tracefile_count, + stream->trace_archive_id); pthread_mutex_unlock(&relayd->ctrl_sock_mutex); if (ret < 0) { goto end; @@ -2339,7 +2340,6 @@ int consumer_post_rotation(struct lttng_consumer_stream *stream, stream->chan->name); ret = rotate_notify_sessiond(ctx, stream->chan->key); } - assert(stream->chan->nr_stream_rotate_pending >= 0); pthread_mutex_unlock(&stream->chan->lock); return ret; @@ -2576,7 +2576,9 @@ void *consumer_thread_data_poll(void *data) /* local view of the streams */ struct lttng_consumer_stream **local_stream = NULL, *new_stream = NULL; /* local view of consumer_data.fds_count */ - int nb_fd = 0, nb_pipes_fd; + int nb_fd = 0; + /* 2 for the consumer_data_pipe and wake up pipe */ + const int nb_pipes_fd = 2; /* Number of FDs with CONSUMER_ENDPOINT_INACTIVE but still open. */ int nb_inactive_fd = 0; struct lttng_consumer_local_data *ctx = data; @@ -2616,12 +2618,7 @@ void *consumer_thread_data_poll(void *data) free(local_stream); local_stream = NULL; - /* - * Allocate for all fds + 2: - * +1 for the consumer_data_pipe - * +1 for wake up pipe - */ - nb_pipes_fd = 2; + /* Allocate for all fds */ pollfd = zmalloc((consumer_data.stream_count + nb_pipes_fd) * sizeof(struct pollfd)); if (pollfd == NULL) { PERROR("pollfd malloc");