From: Mathieu Desnoyers Date: Thu, 11 Aug 2011 20:38:04 +0000 (-0400) Subject: Fix non-matching packet context wrt last packet event read X-Git-Tag: v0.5~2 X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=5f643ed7d0d2d21d3797938e34735ef8f1bd9186;hp=5f643ed7d0d2d21d3797938e34735ef8f1bd9186;p=babeltrace.git Fix non-matching packet context wrt last packet event read The last event in a packet is seen with the timestamp of the beginning of the next packet due to an incorrect handling of ctf_move_pos() : the "ctf_move_pos_slow" that switches between packets needs to be called at the next event, rather than at the end of the last event of the packet. When the position was getting to the end of the payload of the last event, it was immediately changing packet, which changed all packet context information, including the current timestamp. This is fixed by explicitely calling the ctf_move_pos_slow() on packet boundaries at the beginning of event read rather than at each ctf_move_pos call. We also fix handling of empty trace packets here: when an empty packet is detected, we need to move on to the next packet immediately within ctf_move_pos_slow() rather than let the caller think there is some event data in the empty packet. Signed-off-by: Mathieu Desnoyers ---