From: Mathieu Desnoyers Date: Sat, 30 Nov 2013 10:46:10 +0000 (+0100) Subject: Fix: client_packet_header() uses wrong packet X-Git-Tag: v2.4.0-rc2~1 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=537001624550a6e6c77d0e535b42d52a5e7c6719;p=lttng-modules.git 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 --- 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,