- LttTime lBufTotalTime; /* Total time for this buffer */
- double lBufTotalNSec; /* Total time for this buffer in nsecs */
- LttCycleCount lBufTotalCycle;/* Total cycles for this buffer */
-
- /* Calculate the total time for this buffer */
- lBufTotalTime = ltt_time_sub(tf->buffer.end.timestamp,
- tf->buffer.begin.timestamp);
-
- /* Calculate the total cycles for this bufffer */
- lBufTotalCycle = tf->buffer.end.cycle_count;
- lBufTotalCycle -= tf->buffer.begin.cycle_count;
-
- /* Convert the total time to double */
- lBufTotalNSec = ltt_time_to_double(lBufTotalTime);
+ //return 1e6 / (double)tf->buffer.freq;
+ guint64 cpu_mhz = tf->buffer.freq / 1000;
+ guint64 cyc2ns_scale = (1000 << CYC2NS_SCALE_FACTOR)/cpu_mhz;