X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=ltt%2Ftracefile.c;h=1b6545514f95224fe3e3459299de7f5a93f82487;hb=3bc4047c7c8ba4a87bd8ff662840cb27e55861ba;hp=680bcc46d730a4f56dbfbb65b9067784dcbe5f16;hpb=f61f4dca50e13aa52b1ca3941c8f420848f4353f;p=lttv.git diff --git a/ltt/tracefile.c b/ltt/tracefile.c index 680bcc46..1b654551 100644 --- a/ltt/tracefile.c +++ b/ltt/tracefile.c @@ -785,6 +785,7 @@ LttTrace *ltt_trace_open(const gchar *pathname) closedir(dir); /* Open all the tracefiles */ + t->start_freq= 0; if(open_tracefiles(t, abs_path, "")) { g_warning("Error opening tracefile %s", abs_path); goto find_error; @@ -1384,22 +1385,24 @@ static gint map_block(LttTracefile * tf, guint block_num) tf->buffer.begin.cycle_count = ltt_get_uint64(LTT_GET_BO(tf), &header->cycle_count_begin); - tf->buffer.begin.freq = tf->trace->start_freq; - - tf->buffer.begin.timestamp = ltt_interpolate_time_from_tsc(tf, - tf->buffer.begin.cycle_count); tf->buffer.end.cycle_count = ltt_get_uint64(LTT_GET_BO(tf), &header->cycle_count_end); - tf->buffer.end.freq = tf->trace->start_freq; - tf->buffer.lost_size = ltt_get_uint32(LTT_GET_BO(tf), &header->lost_size); - tf->buffer.end.timestamp = ltt_interpolate_time_from_tsc(tf, - tf->buffer.end.cycle_count); tf->buffer.tsc = tf->buffer.begin.cycle_count; tf->event.tsc = tf->buffer.tsc; tf->buffer.freq = tf->buffer.begin.freq; + if (tf->trace->start_freq) + { + tf->buffer.begin.freq = tf->trace->start_freq; + tf->buffer.begin.timestamp = ltt_interpolate_time_from_tsc(tf, + tf->buffer.begin.cycle_count); + tf->buffer.end.freq = tf->trace->start_freq; + tf->buffer.end.timestamp = ltt_interpolate_time_from_tsc(tf, + tf->buffer.end.cycle_count); + } + /* FIXME * eventually support variable buffer size : will need a partial pre-read of * the headers to create an index when we open the trace... eventually. */