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=a57bf15987d28061bf56a994dfacc0ad882c6ecd;hb=f64161251bd649abe5b6a473531adfa3af9bd6b6;hpb=87c1611dab332f28b4b72c6ed96cb2a2ef31d5f7 diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c index a57bf1598..7ce03ad87 100644 --- a/src/common/ust-consumer/ust-consumer.c +++ b/src/common/ust-consumer/ust-consumer.c @@ -81,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;