[lttng-dev] [UST PATCH 1/3] Add stream instance id to the packet header

Julien Desfossez jdesfossez at efficios.com
Mon Jul 13 11:12:07 EDT 2015


This new field allows the viewer to distinguish between trace files
belonging to the same packet stream (in LTTng: the same CPU in the same
channel).

This is a locked-step with the corresponding commit in lttng-tools.

Signed-off-by: Julien Desfossez <jdesfossez at efficios.com>
---
 liblttng-ust/lttng-ring-buffer-client.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/liblttng-ust/lttng-ring-buffer-client.h b/liblttng-ust/lttng-ring-buffer-client.h
index c0ae0c8..41baab0 100644
--- a/liblttng-ust/lttng-ring-buffer-client.h
+++ b/liblttng-ust/lttng-ring-buffer-client.h
@@ -45,6 +45,7 @@ struct packet_header {
 					 */
 	uint8_t uuid[LTTNG_UST_UUID_LEN];
 	uint32_t stream_id;
+	uint64_t stream_instance_id;
 
 	struct {
 		/* Stream packet context */
@@ -342,6 +343,7 @@ static void client_buffer_begin(struct lttng_ust_lib_ring_buffer *buf, uint64_t
 	header->magic = CTF_MAGIC_NUMBER;
 	memcpy(header->uuid, lttng_chan->uuid, sizeof(lttng_chan->uuid));
 	header->stream_id = lttng_chan->id;
+	header->stream_instance_id = buf->backend.cpu;
 	header->ctx.timestamp_begin = tsc;
 	header->ctx.timestamp_end = 0;
 	header->ctx.content_size = ~0ULL; /* for debugging */
-- 
1.9.1




More information about the lttng-dev mailing list