Fix: Use the packet's final size when mmap-ing the next packet
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 15 Oct 2013 17:23:18 +0000 (13:23 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 31 Oct 2013 13:17:39 +0000 (09:17 -0400)
ctf_packet_seek() assumed that a packet would be of fixed size
"WRITE_PACKET_LEN" when seeking to the next packet in write mode.
This ensures that the real size used.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
formats/ctf/ctf.c

index 947b439d24349d9055459e3339eec03fc27a2f35..60d9c9f9459d159b7627c9e76927409eccd55272 100644 (file)
@@ -712,7 +712,7 @@ void ctf_packet_seek(struct bt_stream_pos *stream_pos, size_t index, int whence)
                switch (whence) {
                case SEEK_CUR:
                        /* The writer will add padding */
-                       pos->mmap_offset += WRITE_PACKET_LEN / CHAR_BIT;
+                       pos->mmap_offset += pos->packet_size / CHAR_BIT;
                        break;
                case SEEK_SET:
                        assert(index == 0);     /* only seek supported for now */
This page took 0.026131 seconds and 4 git commands to generate.