From 537001624550a6e6c77d0e535b42d52a5e7c6719 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Sat, 30 Nov 2013 11:46:10 +0100 Subject: [PATCH] Fix: client_packet_header() uses wrong packet It should use lib_ring_buffer_read_offset_address() to get the packet being read, rather than lib_ring_buffer_offset_address(), which is only meant to be used when writing to the packet. Signed-off-by: Mathieu Desnoyers --- lttng-ring-buffer-client.h | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/lttng-ring-buffer-client.h b/lttng-ring-buffer-client.h index 50c47b3b..c97793d2 100644 --- a/lttng-ring-buffer-client.h +++ b/lttng-ring-buffer-client.h @@ -394,17 +394,7 @@ static struct packet_header *client_packet_header( const struct lib_ring_buffer_config *config, struct lib_ring_buffer *buf) { - struct lib_ring_buffer_backend *bufb; - unsigned long sb_bindex; - struct packet_header *header; - - bufb = &buf->backend; - sb_bindex = subbuffer_id_get_index(config, bufb->buf_rsb.id); - header = (struct packet_header *) - lib_ring_buffer_offset_address(bufb, - sb_bindex * bufb->chan->backend.subbuf_size); - - return header; + return lib_ring_buffer_read_offset_address(&buf->backend, 0); } static int client_timestamp_begin(const struct lib_ring_buffer_config *config, -- 2.34.1