/* Make start time more precise */
/* Start overflow_nsec to a negative value : takes account of the
* start of block cycle counter */
- tf->overflow_nsec = (-((double)tf->a_block_start->cycle_count)
+ tf->overflow_nsec = (-((double)(tf->a_block_start->cycle_count&0xFFFFFFFF))
* tf->nsec_per_cycle);
tf->a_block_start->time = getEventTime(tf);
-
{
guint64 lEventNSec;
LttTime lTimeOffset;
/* recalculate the cycles per nsec, with now more precise start and end time
*/
getCyclePerNsec(tf);
- tf->overflow_nsec = (-((double)tf->a_block_start->cycle_count)
- * tf->nsec_per_cycle);
-
+ tf->overflow_nsec = (-((double)(tf->a_block_start->cycle_count&0xFFFFFFFF))
+ * tf->nsec_per_cycle);
tf->current_event_time = getEventTime(tf);
{
LttTime lBufTotalTime; /* Total time for this buffer */
double lBufTotalNSec; /* Total time for this buffer in nsecs */
- double lBufTotalCycle;/* Total cycles for this buffer */
+ LttCycleCount lBufTotalCycle;/* Total cycles for this buffer */
/* Calculate the total time for this buffer */
lBufTotalTime = ltt_time_sub(t->a_block_end->time, t->a_block_start->time);
lBufTotalCycle = t->a_block_end->cycle_count;
lBufTotalCycle -= t->a_block_start->cycle_count;
- /* Convert the total time to nsecs */
+ /* Convert the total time to double */
lBufTotalNSec = ltt_time_to_double(lBufTotalTime);
t->nsec_per_cycle = (double)lBufTotalNSec / (double)lBufTotalCycle;
+
/* Pre-multiply one overflow (2^32 cycles) by nsec_per_cycle */
t->one_overflow_nsec = t->nsec_per_cycle * (double)0x100000000ULL;
lEventNSec = ((double)
(tf->a_block_end->cycle_count - tf->a_block_start->cycle_count)
* tf->nsec_per_cycle);
+#if 0
g_printf("CYCLES COUNTED : %llu",
(gint64)((double)cycle_count * tf->nsec_per_cycle)
+tf->overflow_nsec
+tf->a_block_start->cycle_count);
-
+#endif //0
}
- /* heartbeat cycle counter is only numheartbeat<<32, not meaningful
- */
#if 0
else if(unlikely(evId == TRACE_TIME_HEARTBEAT)) {
}
#endif //0
else {
-
lEventNSec = (gint64)((double)cycle_count * tf->nsec_per_cycle)
+tf->overflow_nsec;
}