X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fust-consumer%2Fust-consumer.c;h=7ce03ad87dde9b442015f3dc5af9b05697e2d8a5;hp=4cd6972125dccba26fcfadee133b7438d91c5eeb;hb=f64161251bd649abe5b6a473531adfa3af9bd6b6;hpb=b0b335c8c5a963f24dbedb4e597f23ed66c5b915 diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c index 4cd697212..7ce03ad87 100644 --- a/src/common/ust-consumer/ust-consumer.c +++ b/src/common/ust-consumer/ust-consumer.c @@ -63,7 +63,8 @@ ssize_t lttng_ustconsumer_on_read_subbuffer_mmap( if (stream->net_seq_idx != -1) { relayd = consumer_find_relayd(stream->net_seq_idx); if (relayd == NULL) { - ERR("Cannot find relay for network stream\n"); + ERR("UST consumer mmap(), unable to find relay for index %d", + stream->net_seq_idx); goto end; } } @@ -80,12 +81,15 @@ ssize_t lttng_ustconsumer_on_read_subbuffer_mmap( /* Handle stream on the relayd if the output is on the network */ if (relayd) { + unsigned long netlen = len; + if (stream->metadata_flag) { /* Only lock if metadata since we use the control socket. */ pthread_mutex_lock(&relayd->ctrl_sock_mutex); + netlen += sizeof(stream->relayd_stream_id); } - ret = consumer_handle_stream_before_relayd(stream, len); + ret = consumer_handle_stream_before_relayd(stream, netlen); if (ret >= 0) { outfd = ret;