From: compudj Date: Thu, 13 Nov 2008 17:04:43 +0000 (+0000) Subject: freq scale is now a divisor X-Git-Tag: v0.12.20~339 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=d0e3122a96f5ed9a131172bb592ae4b496ce790b;p=lttv.git freq scale is now a divisor git-svn-id: http://ltt.polymtl.ca/svn@3150 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/trunk/lttv/ltt/ltt-private.h b/trunk/lttv/ltt/ltt-private.h index 357a4cc7..ec3592dd 100644 --- a/trunk/lttv/ltt/ltt-private.h +++ b/trunk/lttv/ltt/ltt-private.h @@ -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; /* diff --git a/trunk/lttv/ltt/tracefile.c b/trunk/lttv/ltt/tracefile.c index 24722d29..58b2a483 100644 --- a/trunk/lttv/ltt/tracefile.c +++ b/trunk/lttv/ltt/tracefile.c @@ -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); }