X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Fltt%2Fconvert%2Fconvert.c;h=b996b8b2bffc914e9e3997a2fc2145a45922fd56;hb=e4eced0fb7cd23ba2b16eff08f2185bed49ab5e5;hp=e319b420147d1bc9bbe0fcfdb1379a5b08912c43;hpb=1812dbb9f10d3bd6325ef03d46249935a480560b;p=lttv.git diff --git a/ltt/branches/poly/ltt/convert/convert.c b/ltt/branches/poly/ltt/convert/convert.c index e319b420..b996b8b2 100644 --- a/ltt/branches/poly/ltt/convert/convert.c +++ b/ltt/branches/poly/ltt/convert/convert.c @@ -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; @@ -378,13 +379,13 @@ int main(int argc, char ** argv){ write_to_buffer(write_pos_intr,(void*)&startId, sizeof(uint16_t)); write_to_buffer(write_pos_intr,(void*)&startTimeDelta, sizeof(uint32_t)); start_intr = start; - start_intr.nanoseconds -= 40; + start_intr.nanoseconds -= 20; write_to_buffer(write_pos_intr,(void*)&start_intr, sizeof(buffer_start)); write_to_buffer(write_pos_proc,(void*)&startId, sizeof(uint16_t)); write_to_buffer(write_pos_proc,(void*)&startTimeDelta, sizeof(uint32_t)); start_proc = start; - start_proc.nanoseconds -= 20; + start_proc.nanoseconds -= 40; write_to_buffer(write_pos_proc,(void*)&start_proc, sizeof(buffer_start)); //parse *.proc file to get process and irq info @@ -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)); @@ -484,13 +490,13 @@ int main(int argc, char ** argv){ write_to_buffer(write_pos_intr,(void*)&newId,sizeof(uint16_t)); write_to_buffer(write_pos_intr,(void*)&time_delta, sizeof(uint32_t)); end_intr = end; - end_intr.nanoseconds += 20; + end_intr.nanoseconds -= 20; write_to_buffer(write_pos_intr,(void*)&end_intr,sizeof(buffer_start)); write_to_buffer(write_pos_proc,(void*)&newId,sizeof(uint16_t)); write_to_buffer(write_pos_proc,(void*)&time_delta, sizeof(uint32_t)); end_proc = end; - end_proc.nanoseconds += 40; + end_proc.nanoseconds -= 40; write_to_buffer(write_pos_proc,(void*)&end_proc,sizeof(buffer_start)); write_pos_intr = buf_intr + block_size - 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));