[lttng-dev] [LTTNG-TOOLS PATCH] Fix: get the stream_id when generating live beacons

Julien Desfossez jdesfossez at efficios.com
Tue Jul 1 12:10:52 EDT 2014


When we send an empty index (beacon), we need to extract the stream_id
to avoid stalling the client on inactive streams on startup.

This patch should also be backported to 2.4.x.

Signed-off-by: Julien Desfossez <jdesfossez at efficios.com>
---
 src/common/consumer-timer.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/common/consumer-timer.c b/src/common/consumer-timer.c
index c659bf6..c13577f 100644
--- a/src/common/consumer-timer.c
+++ b/src/common/consumer-timer.c
@@ -118,8 +118,16 @@ static int send_empty_index(struct lttng_consumer_stream *stream, uint64_t ts)
 {
 	int ret;
 	struct ctf_packet_index index;
+	uint64_t stream_id;
+
+	ret = kernctl_get_stream_id(stream->wait_fd, &stream_id);
+	if (ret < 0) {
+		PERROR("kernctl_get_stream_id");
+		goto error;
+	}
 
 	memset(&index, 0, sizeof(index));
+	index.stream_id = htobe64(stream_id);
 	index.timestamp_end = htobe64(ts);
 	ret = consumer_stream_write_index(stream, &index);
 	if (ret < 0) {
-- 
1.9.1




More information about the lttng-dev mailing list