git-svn-id: http://ltt.polymtl.ca/svn@243 04897980-b3bd-0310-b5e0-8ef037075253
authoryangxx <yangxx@04897980-b3bd-0310-b5e0-8ef037075253>
Wed, 24 Sep 2003 19:07:51 +0000 (19:07 +0000)
committeryangxx <yangxx@04897980-b3bd-0310-b5e0-8ef037075253>
Wed, 24 Sep 2003 19:07:51 +0000 (19:07 +0000)
ltt/branches/poly/include/ltt/ltt-private.h
ltt/branches/poly/ltt/tracefile.c

index 62f2383a5328869fe5f8409996375b2861c4a2b8..c516bb49e56d4c40c4d129ec5b35000f6d988c0f 100644 (file)
@@ -135,6 +135,7 @@ struct _LttTracefile{
   double cycle_per_nsec;             //Cycles per nsec
   unsigned cur_heart_beat_number;    //current number of heart beat in the buf
   LttCycleCount cur_cycle_count;     //current cycle count of the event
+  void * last_event_pos;
 
   LttTime prev_block_end_time;       //the end time of previous block
   LttTime prev_event_time;           //the time of the previous event
index 2ffa20be0e1f9dda3ad2daf005cdfb1939ec9065..1bcc111afde24f76d5eec72eadd1c7df1a01d653 100644 (file)
@@ -769,7 +769,7 @@ void ltt_tracefile_seek_time(LttTracefile *t, LttTime time)
       updateTracefile(t);
       return ltt_tracefile_seek_time(t, time);      
     }
-  }else if(headTime > 0){
+  }else if(headTime >= 0){
     if(t->which_block == 1){
       updateTracefile(t);      
     }else{
@@ -790,10 +790,8 @@ void ltt_tracefile_seek_time(LttTracefile *t, LttTime time)
       return;      
     }    
     if(tailTime < 0) return ltt_tracefile_seek_time(t, time);
-  }else if(headTime == 0){
-    updateTracefile(t);
   }else if(tailTime == 0){
-    t->cur_event_pos = t->a_block_end - EVENT_HEADER_SIZE;
+    t->cur_event_pos = t->last_event_pos;
     t->current_event_time = time;  
     t->cur_heart_beat_number = 0;
     t->prev_event_time.tv_sec = 0;
@@ -935,6 +933,7 @@ int readBlock(LttTracefile * tf, int whichBlock)
   lostSize = *(uint32_t*)(tf->buffer + tf->block_size - sizeof(uint32_t));
   tf->a_block_end=(BlockEnd *)(tf->buffer + tf->block_size - 
                                lostSize + EVENT_HEADER_SIZE); 
+  tf->last_event_pos = tf->buffer + tf->block_size - lostSize;
 
   tf->which_block = whichBlock;
   tf->which_event = 1;
This page took 0.025718 seconds and 4 git commands to generate.