Fix: client_packet_header() uses wrong packet
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 30 Nov 2013 10:46:10 +0000 (11:46 +0100)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 30 Nov 2013 10:46:10 +0000 (11:46 +0100)
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 <mathieu.desnoyers@efficios.com>
lttng-ring-buffer-client.h

index 50c47b3bf49f6c2dd24e250cf1a9b97808cd8e27..c97793d2061a784b9ea68014a0c12cc9349c8bf6 100644 (file)
@@ -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,
This page took 0.027783 seconds and 4 git commands to generate.