fix note reserving byte order in calc_nsec_per_cycle
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Sun, 21 Aug 2005 15:45:40 +0000 (15:45 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Sun, 21 Aug 2005 15:45:40 +0000 (15:45 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1041 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/ltt/tracefile.c

index 995119db1a7a3cc4d2e8b22e8e4ca591cb5aae75..d7b72d62e9049dabe579d5b305cba008513d8304 100644 (file)
@@ -1423,7 +1423,8 @@ LttEvent *ltt_tracefile_get_event(LttTracefile *tf)
  *Return value
  *
  *    Returns 0 if an event can be used in tf->event.
- *    Returns ERANGE on end of trace. The event in tf->event still can be used.
+ *    Returns ERANGE on end of trace. The event in tf->event still can be used
+ *    (if the last block was not empty).
  *    Returns EPERM on error.
  *
  *    This function does make the tracefile event structure point to the event
@@ -1813,14 +1814,12 @@ static double calc_nsecs_per_cycle(LttTracefile * tf)
   LttCycleCount     lBufTotalCycle;/* Total cycles for this buffer */
 
   /* Calculate the total time for this buffer */
-  lBufTotalTime = ltt_time_sub(
-       ltt_get_time(LTT_GET_BO(tf), &tf->buffer.end.timestamp),
-       ltt_get_time(LTT_GET_BO(tf), &tf->buffer.begin.timestamp));
+  lBufTotalTime = ltt_time_sub(tf->buffer.end.timestamp,
+                               tf->buffer.begin.timestamp);
 
   /* Calculate the total cycles for this bufffer */
-  lBufTotalCycle  = ltt_get_uint64(LTT_GET_BO(tf), &tf->buffer.end.cycle_count);
-  lBufTotalCycle -= ltt_get_uint64(LTT_GET_BO(tf),
-                     &tf->buffer.begin.cycle_count);
+  lBufTotalCycle  = tf->buffer.end.cycle_count;
+  lBufTotalCycle -= tf->buffer.begin.cycle_count;
 
   /* Convert the total time to double */
   lBufTotalNSec  = ltt_time_to_double(lBufTotalTime);
This page took 0.025334 seconds and 4 git commands to generate.