seek backward beginning of trace fix
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 1 Sep 2005 23:53:08 +0000 (23:53 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 1 Sep 2005 23:53:08 +0000 (23:53 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1112 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/lttv/lttv/tracecontext.c
ltt/branches/poly/lttv/lttv/tracecontext.h

index 98ffffa7f29aea1d066c4174886bb8c0f101ddb9..73096b3d0e4dceeeb145abb949f038f41e470749 100644 (file)
@@ -1409,8 +1409,8 @@ guint lttv_process_traceset_seek_n_backward(LttvTracesetContext *self,
   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();
   
@@ -1432,6 +1432,7 @@ 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;
   }
+  asked_time = time;
   time_offset = first_offset;
  
   lttv_hooks_add(hooks, seek_back_event_hook, &sd, LTTV_PRIO_DEFAULT);
@@ -1440,14 +1441,15 @@ guint lttv_process_traceset_seek_n_backward(LttvTracesetContext *self,
 
   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);
@@ -1456,11 +1458,6 @@ 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 
-        && 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
index df78677cc3c8f41afa79067a36c10047a27a7ed3..37c4ba17884b6b615b1df3a4a0369b950a8d59d2 100644 (file)
@@ -348,7 +348,7 @@ void lttv_process_traceset_get_sync_data(LttvTracesetContext *tsc);
 #define BACKWARD_SEEK_MUL 2 /* Multiplication factor of time_offset between
                                backward seek iterations */
 
-static const LttTime seek_back_default_offset = { 0, 1000000 };
+static const LttTime seek_back_default_offset = { 1, 0 };
 
 guint lttv_process_traceset_seek_n_forward(LttvTracesetContext *self,
                                            guint n,
This page took 0.028231 seconds and 4 git commands to generate.