X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fyangxx%2Fconvert%2Fconvert.c;h=52c9bb1b5a045bf3963a0701e6d0315fec73153b;hb=34032154ec1e97470e904b086d0feda0aa70bf26;hp=0aaa8f93f663dbf325f4cd2887e343c7d5832f28;hpb=fc032b6be7431e97c4ed51c672aa3ab8141df10d;p=lttv.git diff --git a/ltt/branches/yangxx/convert/convert.c b/ltt/branches/yangxx/convert/convert.c index 0aaa8f93..52c9bb1b 100644 --- a/ltt/branches/yangxx/convert/convert.c +++ b/ltt/branches/yangxx/convert/convert.c @@ -97,8 +97,8 @@ int main(int argc, char ** argv){ trace_buffer_start *tBufStart; trace_buffer_end *tBufEnd; trace_file_system * tFileSys; - uint16_t newId; - uint8_t evId, startId; + uint16_t newId, startId; + uint8_t evId; uint32_t time_delta, startTimeDelta; void * cur_pos, *end_pos; buffer_start start; @@ -212,7 +212,6 @@ int main(int argc, char ** argv){ evId = *(uint8_t *)cur_pos; cur_pos += sizeof(uint8_t); - time_delta = *(uint32_t*)cur_pos; cur_pos += sizeof(uint32_t); tStart = (trace_start*)cur_pos; @@ -262,6 +261,7 @@ int main(int argc, char ** argv){ int event_count = 0; beat_count = 0; + for(j=1;jTime.tv_sec; + start.nanoseconds = tBufStart->Time.tv_usec; + start.cycle_count = tBufStart->TSC; + start.block_id = tBufStart->ID; + end.block_id = start.block_id; + end_pos = buffer + block_size; //end of the buffer 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; @@ -483,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); @@ -496,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);