git-svn-id: http://ltt.polymtl.ca/svn@240 04897980-b3bd-0310-b5e0-8ef037075253
[lttv.git] / ltt / branches / poly / ltt / convert / convert.c
index 60dc3a6031498a751fcb14726df56d5577a8a0cb..b996b8b2bffc914e9e3997a2fc2145a45922fd56 100644 (file)
@@ -124,7 +124,7 @@ int main(int argc, char ** argv){
   trace_file_system * tFileSys;
   uint16_t newId, startId, tmpId;
   uint8_t  evId;
-  uint32_t time_delta, startTimeDelta;
+  uint32_t time_delta, startTimeDelta, previous_time_delta;
   void * cur_pos, *end_pos;
   buffer_start start, start_proc, start_intr;
   buffer_start end, end_proc, end_intr;
@@ -344,6 +344,7 @@ int main(int argc, char ** argv){
 
     startId = newId;
     startTimeDelta = time_delta;
+    previous_time_delta = time_delta;
     start.seconds = tBufStart->Time.tv_sec;
     start.nanoseconds = tBufStart->Time.tv_usec;
     start.cycle_count = tBufStart->TSC;
@@ -448,6 +449,11 @@ int main(int argc, char ** argv){
       time_delta = *(uint32_t*)cur_pos;
       cur_pos += sizeof(uint32_t); 
 
+      if(time_delta < previous_time_delta){
+       end.cycle_count += OVERFLOW_FIGURE;
+      }
+      previous_time_delta = time_delta;
+
       if(ltt_log_cpu){
        write_to_buffer(write_pos[cpu_id],(void*)&newId,sizeof(uint16_t));
        write_to_buffer(write_pos[cpu_id],(void*)&time_delta, sizeof(uint32_t));        
@@ -582,7 +588,7 @@ int main(int argc, char ** argv){
          beat.cycle_count = start.cycle_count + beat_count * OVERFLOW_FIGURE;
          event_size = 0;
 
-         end.cycle_count += OVERFLOW_FIGURE;
+         //      end.cycle_count += OVERFLOW_FIGURE;
 
          write_to_buffer(write_pos_intr,(void*)&newId, sizeof(uint16_t));
          write_to_buffer(write_pos_intr,(void*)&timeDelta, sizeof(uint32_t));
This page took 0.023785 seconds and 4 git commands to generate.