X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Fltt%2Ftracefile.c;h=00ffc9bf71a6a403ea9c5ee18f875e9291e18151;hb=21ff84a0d872ff069d4ec62d0a5bed21bcfeeac5;hp=cc953d8d8709cb1d1e41a190ffccbeaa014b4df9;hpb=1c736ed5fd25e728fa1df0899be03c4853c556d8;p=lttv.git diff --git a/ltt/branches/poly/ltt/tracefile.c b/ltt/branches/poly/ltt/tracefile.c index cc953d8d..00ffc9bf 100644 --- a/ltt/branches/poly/ltt/tracefile.c +++ b/ltt/branches/poly/ltt/tracefile.c @@ -1200,9 +1200,9 @@ int readBlock(LttTracefile * tf, int whichBlock) getCyclePerNsec(tf); - tf->overflow_nsec = round( + tf->overflow_nsec = (-((double)(tf->a_block_start->cycle_count&0xFFFFFFFF)) - * tf->nsec_per_cycle)); + * tf->nsec_per_cycle); tf->current_event_time = getEventTime(tf); @@ -1228,8 +1228,8 @@ void updateTracefile(LttTracefile * tf) tf->prev_event_time.tv_nsec = 0; tf->count = 0; - tf->overflow_nsec = round((-((double)tf->a_block_start->cycle_count) - * tf->nsec_per_cycle)); + tf->overflow_nsec = (-((double)tf->a_block_start->cycle_count) + * tf->nsec_per_cycle); } @@ -1310,7 +1310,7 @@ void getCyclePerNsec(LttTracefile * t) t->nsec_per_cycle = (double)lBufTotalNSec / (double)lBufTotalCycle; /* Pre-multiply one overflow (2^32 cycles) by nsec_per_cycle */ - t->one_overflow_nsec = round(t->nsec_per_cycle * (double)0x100000000ULL); + t->one_overflow_nsec = t->nsec_per_cycle * (double)0x100000000ULL; } @@ -1350,9 +1350,9 @@ static inline LttTime getEventTime(LttTracefile * tf) if(unlikely(evId == TRACE_BLOCK_START)) { lEventNSec = 0; } else if(unlikely(evId == TRACE_BLOCK_END)) { - lEventNSec = round(((double) + lEventNSec = ((double) (tf->a_block_end->cycle_count - tf->a_block_start->cycle_count) - * tf->nsec_per_cycle)); + * tf->nsec_per_cycle); } #if 0 /* If you want to make heart beat a special case and use their own 64 bits @@ -1367,7 +1367,7 @@ static inline LttTime getEventTime(LttTracefile * tf) } #endif //0 else { - lEventNSec = (gint64)round(((double)cycle_count * tf->nsec_per_cycle)) + lEventNSec = (gint64)((double)cycle_count * tf->nsec_per_cycle) +tf->overflow_nsec; }