ts->time_span.start_time = ltt_time_zero;
ts->time_span.end_time = ltt_time_zero;
-
+ lttv_traceset_get_time_span_real(ts);
return ts;
}
last_position.bt_pos = &pos;
last_position.timestamp = G_MAXUINT64;
last_position.cpu_id = INT_MAX;
-#ifdef BABEL_HAS_SEEK_LAST
+
/* Assign iterator to the last event of the traces */
last_position.bt_pos->type = BT_SEEK_LAST;
last_position.iter = ts->iter;
-#endif
+
return lttv_traceset_position_get_timestamp(&last_position);
}
{
currentTrace = g_ptr_array_index(traceset->traces,i);
timestamp_cur = bt_trace_handle_get_timestamp_begin(bt_ctx,
- currentTrace->id);
+ currentTrace->id,
+ BT_CLOCK_REAL);
if(timestamp_cur < timestamp_min)
timestamp_min = timestamp_cur;
}
{
currentTrace = g_ptr_array_index(traceset->traces,i);
timestamp_cur = bt_trace_handle_get_timestamp_end(bt_ctx,
- currentTrace->id);
+ currentTrace->id,
+ BT_CLOCK_REAL);
if(timestamp_cur > timestamp_max){
timestamp_max = timestamp_cur;
}
*/
TimeInterval lttv_traceset_get_time_span_real(LttvTraceset *ts)
{
-#ifdef BABEL_HAS_SEEK_LAST
+
if(ltt_time_compare(ts->time_span.start_time,
ltt_time_zero) == 0 && ts->traces->len > 0){
ts->time_span.start_time = ltt_time_from_uint64(
lttv_traceset_get_timestamp_first_event(ts));
ts->time_span.end_time = ltt_time_from_uint64(
- lttv_traceset_get_timestamp_last_event(ts));
+ lttv_traceset_get_timestamp_last_event(ts));
}
return ts->time_span;
-#else
- return lttv_traceset_get_time_span(ts);
-#endif
}
/*
struct bt_ctf_event *event = bt_ctf_iter_read_event(pos->iter);
if(event != NULL){
- ((LttvTracesetPosition *)pos)->timestamp = bt_ctf_get_timestamp_raw(event);
+ ((LttvTracesetPosition *)pos)->timestamp = bt_ctf_get_timestamp(event);
LttvEvent lttv_event;
lttv_event.bt_event = event;
lttv_traceset_seek_to_position(&previous_pos);
/*We must desallocate because the function bt_iter_get_pos() does a g_new */
bt_iter_free_pos(previous_pos.bt_pos);
+ return 1;
}
guint64 lttv_traceset_position_get_timestamp(const LttvTracesetPosition *pos)