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;
*end = ltt_time_zero;
} else
*end = tf->buffer.end.timestamp;
+
+ g_assert(end->tv_sec <= G_MAXUINT);
}
struct tracefile_time_span_get_args {
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. */