Skip to contentSkip to conversation

Fix: Use the packet's final size when mmap-ing the next packet

PATCH Mathieu Desnoyers 1 participant 1 message Oct 31, 2013 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Mathieu Desnoyers

author Applied
#1 lore raw

Merged, thanks!

Mathieu

----- Original Message -----

Quoted 38 lines

From: "Jérémie Galarneau" <[email protected]>
To: [email protected]
Sent: Tuesday, October 15, 2013 1:23:18 PM
Subject: [lttng-dev] [PATCH babeltrace] Fix: Use the packet's final size when mmap-ing the next packet

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.

---
 formats/ctf/ctf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
formats/ctf/ctf.c +1 -1
index 947b439..60d9c9f 100644
@@ -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 */
--
1.8.4

_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

Signature · 8 lines
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev