Make use of the ltt_time_zero
[lttv.git] / lttv / lttv / traceset.c
index b40ca4e7a50434b0baac0537b2bf5c2002237c60..af65190e0c1e069f67840e0a2dabe4b3cb0d8a60 100644 (file)
@@ -70,8 +70,8 @@ LttvTraceset *lttv_traceset_new(void)
        ts->state_trace_handle_index = g_ptr_array_new();
        ts->has_precomputed_states = FALSE;
 
-       ts->time_span.start_time = ltt_time_from_uint64(0);
-       ts->time_span.end_time = ltt_time_from_uint64(0);
+       ts->time_span.start_time = ltt_time_zero;
+        ts->time_span.end_time = ltt_time_zero;
 
        return ts;
 }
@@ -520,11 +520,11 @@ guint64 lttv_traceset_get_timestamp_last_event(LttvTraceset *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);
 }
 
@@ -597,14 +597,19 @@ guint64 lttv_traceset_get_timestamp_end(LttvTraceset *traceset)
  */
 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_from_uint64(0)) == 0 && ts->traces->len > 0){
+                               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));
        }
         return ts->time_span;
+#else
+       return lttv_traceset_get_time_span(ts);
+#endif
 }
 
 /*
@@ -614,7 +619,7 @@ TimeInterval lttv_traceset_get_time_span_real(LttvTraceset *ts)
  */
 TimeInterval lttv_traceset_get_time_span(LttvTraceset *ts)
 {
-       if(ltt_time_compare(ts->time_span.start_time, ltt_time_from_uint64(0)) == 0){
+       if(ltt_time_compare(ts->time_span.start_time, ltt_time_zero) == 0){
                ts->time_span.start_time =ltt_time_from_uint64(
                                        lttv_traceset_get_timestamp_begin(ts));
                ts->time_span.end_time = ltt_time_from_uint64(
This page took 0.023848 seconds and 4 git commands to generate.