From b4aeb12d2c3a48e62c1fde1762a8a628f6bcafce Mon Sep 17 00:00:00 2001 From: compudj Date: Thu, 1 Sep 2005 18:24:06 +0000 Subject: [PATCH] tracecontext position compare bugfix git-svn-id: http://ltt.polymtl.ca/svn@1107 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/lttv/lttv/tracecontext.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ltt/branches/poly/lttv/lttv/tracecontext.c b/ltt/branches/poly/lttv/lttv/tracecontext.c index 1aaccb5f..ea7cdf62 100644 --- a/ltt/branches/poly/lttv/lttv/tracecontext.c +++ b/ltt/branches/poly/lttv/lttv/tracecontext.c @@ -1248,7 +1248,7 @@ gint lttv_traceset_context_pos_pos_compare( const LttvTracesetContextPosition *pos2) { int i, j; - int ret; + int ret = 0; if(pos1->tfcp->len == 0) { if(pos2->tfcp->len == 0) return 0; @@ -1410,6 +1410,7 @@ guint lttv_process_traceset_seek_n_backward(LttvTracesetContext *self, lttv_traceset_context_position_new(self); LttTime time; LttTime time_offset; + LttTime last_time = ltt_time_infinite; struct seek_back_data sd; LttvHooks *hooks = lttv_hooks_new(); @@ -1455,6 +1456,10 @@ guint lttv_process_traceset_seek_n_backward(LttvTracesetContext *self, 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) break; + last_time = time; /* Process the traceset, calling a hook which adds events * to the array, overwriting the tail. It changes first_event and -- 2.34.1