LttvTracesetContextPosition *saved_pos =
lttv_traceset_context_position_new(self);
LttTime time;
+ LttTime asked_time;
LttTime time_offset;
- LttTime last_time = ltt_time_infinite;
struct seek_back_data sd;
LttvHooks *hooks = lttv_hooks_new();
if(ltt_time_compare(time, self->time_span.end_time) > 0) {
time = self->time_span.end_time;
}
+ asked_time = time;
time_offset = first_offset;
lttv_hooks_add(hooks, seek_back_event_hook, &sd, LTTV_PRIO_DEFAULT);
while(1) {
/* stop criteria : - n events found
- * - time < beginning of trace */
- if(ltt_time_compare(time, self->time_span.start_time) < 0) break;
+ * - asked_time < beginning of trace */
+ if(ltt_time_compare(asked_time, self->time_span.start_time) < 0) break;
lttv_traceset_context_position_copy(end_pos, next_iter_end_pos);
/* We must seek the traceset back to time - time_offset */
/* this time becomes the new reference time */
time = ltt_time_sub(time, time_offset);
+ asked_time = time;
time_seeker(self, time);
lttv_traceset_context_position_save(self, next_iter_end_pos);
if(ltt_time_compare(time, self->time_span.end_time) > 0) {
time = self->time_span.end_time;
}
- /* if we have the same time twice, it means we are at the beginning of the
- * trace, and we seek back at the same position */
- if(ltt_time_compare(last_time, time) == 0
- && ltt_time_compare(time, self->time_span.start_time) == 0) break;
- last_time = time;
/* Process the traceset, calling a hook which adds events
* to the array, overwriting the tail. It changes first_event and