When seeking by timestamp, we assumed that the timestamp passed as an
argument was a real timestamp from the trace. However LTTV uses
timestamp 0 to refer to the beginning of the trace. This fix ensures
that we read at least the first event after the seek.
Signed-off-by: Julien Desfossez <julien.desfossez@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
continue;
stream_pos->packet_seek(&stream_pos->parent, i, SEEK_SET);
- while (cfs->parent.timestamp < timestamp) {
+ do {
ret = stream_read_event(cfs);
- if (ret < 0)
- break;
- }
+ } while (cfs->parent.timestamp < timestamp && ret >= 0);
+
return 0;
}
return EOF;