git-svn-id: http://ltt.polymtl.ca/svn@123 04897980-b3bd-0310-b5e0-8ef037075253
[lttv.git] / ltt / branches / yangxx / convert / convert.c
index b16e8fe353d52185ae40c6f26576645f5b957cce..52c9bb1b5a045bf3963a0701e6d0315fec73153b 100644 (file)
@@ -291,7 +291,11 @@ int main(int argc, char ** argv){
     size_lost = *(uint32_t*)(end_pos - sizeof(uint32_t));
 
     end_pos = buffer + block_size - size_lost ; //buffer_end event
-    tBufEnd = (trace_buffer_end*)(end_pos+sizeof(uint8_t)+sizeof(uint32_t));
+    if(ltt_log_cpu){
+      tBufEnd = (trace_buffer_end*)(end_pos + 2 * sizeof(uint8_t)+sizeof(uint32_t));
+    }else{
+      tBufEnd = (trace_buffer_end*)(end_pos+sizeof(uint8_t)+sizeof(uint32_t));
+    }
     end.seconds = tBufEnd->Time.tv_sec;
     end.nanoseconds = tBufEnd->Time.tv_usec;
     end.cycle_count = tBufEnd->TSC;
@@ -501,7 +505,7 @@ int main(int argc, char ** argv){
        }else nbBytes = 0;
 
        if(ltt_log_cpu){
-         size_count[cpu_id] += nbBytes + sizeof(uint16_t) + sizeof(uint32_t);
+         size_count[cpu_id] += nbBytes + sizeof(uint16_t) + sizeof(uint32_t)+ event_size;
          if(size_count[cpu_id] > block_size - reserve_size){
            printf("size count exceeds the limit of the buffer\n");
            exit(1);
@@ -514,7 +518,7 @@ int main(int argc, char ** argv){
            write_to_buffer(write_pos[cpu_id], (void*)&c, 1);
          }
        }else{
-         size_count[0] += nbBytes + sizeof(uint16_t) + sizeof(uint32_t);
+         size_count[0] += nbBytes + sizeof(uint16_t) + sizeof(uint32_t)+event_size;
          if(size_count[0] > block_size - reserve_size){
            printf("size count exceeds the limit of the buffer\n");
            exit(1);
This page took 0.023074 seconds and 4 git commands to generate.