freq scale is now a divisor
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 13 Nov 2008 17:04:43 +0000 (17:04 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 13 Nov 2008 17:04:43 +0000 (17:04 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@3150 04897980-b3bd-0310-b5e0-8ef037075253

trunk/lttv/ltt/ltt-private.h
trunk/lttv/ltt/tracefile.c

index 357a4cc713512f5f55fa239759811088c0b20de1..ec3592dd8aaa0f73a31f265874ecb8945656141c 100644 (file)
@@ -83,7 +83,7 @@ struct ltt_subbuffer_header_2_2 {
                                         * Frequency at trace start,
                                         * used all along the trace.
                                         */
-       uint32_t freq_scale;            /* Frequency scaling */
+       uint32_t freq_scale;            /* Frequency scaling (divide freq) */
        uint32_t lost_size;             /* Size unused at end of subbuffer */
        uint32_t buf_size;              /* Size of this subbuffer */
        uint32_t events_lost;           /*
index 24722d29808aaadce2fc9d845f66133df083be1a..58b2a48319789a3543240f9fe34d9d90f191ce0c 100644 (file)
@@ -183,7 +183,7 @@ static int parse_trace_header(ltt_subbuffer_header_t *header,
 
           t->start_time_from_tsc = ltt_time_from_uint64(
               (double)t->start_tsc
-              * (1000000000.0 / tf->trace->freq_scale)
+              * 1000000000.0 * tf->trace->freq_scale
               / (double)t->start_freq);
         }
       }
@@ -1078,13 +1078,13 @@ LttTime ltt_interpolate_time_from_tsc(LttTracefile *tf, guint64 tsc)
   if(tsc > tf->trace->start_tsc) {
     time = ltt_time_from_uint64(
         (double)(tsc - tf->trace->start_tsc) 
-                                    * (1000000000.0 / tf->trace->freq_scale)
+                                    * 1000000000.0 * tf->trace->freq_scale
                                     / (double)tf->trace->start_freq);
     time = ltt_time_add(tf->trace->start_time_from_tsc, time);
   } else {
     time = ltt_time_from_uint64(
         (double)(tf->trace->start_tsc - tsc)
-                                    * (1000000000.0 / tf->trace->freq_scale)
+                                    * 1000000000.0 * tf->trace->freq_scale
                                     / (double)tf->trace->start_freq);
     time = ltt_time_sub(tf->trace->start_time_from_tsc, time);
   }
This page took 0.02667 seconds and 4 git commands to generate.