X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fyangxx%2Fconvert%2Fconvert.c;h=52c9bb1b5a045bf3963a0701e6d0315fec73153b;hb=34032154ec1e97470e904b086d0feda0aa70bf26;hp=b16e8fe353d52185ae40c6f26576645f5b957cce;hpb=5f126063fcc875c8f0e71c98d74f132a03351202;p=lttv.git diff --git a/ltt/branches/yangxx/convert/convert.c b/ltt/branches/yangxx/convert/convert.c index b16e8fe3..52c9bb1b 100644 --- a/ltt/branches/yangxx/convert/convert.c +++ b/ltt/branches/yangxx/convert/convert.c @@ -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);