fix back textcontree tree compare function : was allright before
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Wed, 24 Aug 2005 15:23:41 +0000 (15:23 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Wed, 24 Aug 2005 15:23:41 +0000 (15:23 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1071 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/lttv/lttv/batchtest.c
ltt/branches/poly/lttv/lttv/tracecontext.c

index bacca9ba31a804146a5f4e407b4f1091c556782c..a7de1fd71aee30f0c18d3c68cd5569d6d2f39d8e 100644 (file)
@@ -176,12 +176,38 @@ gboolean trace_event(void __UNUSED__ *hook_data, void *call_data)
   return FALSE;
 }
 
+static LttTime count_previous_time = { 0, 0 };
 
 gboolean count_event(void *hook_data, void __UNUSED__ *call_data)
 {
+  LttvTracefileState *tfs = (LttvTracefileState *)call_data;
+  LttTracefile *tracefile = tfs->parent.tf;
+  guint nb_block, offset;
+  LttTracefile *tf_pos;
+  guint64 tsc;
+  LttEvent * event = ltt_tracefile_get_event(tracefile);
+  LttTime time;
   guint *pcount = (guint *)hook_data;
 
   (*pcount)++;
+  
+  time = ltt_event_time(event);
+  ltt_event_position(event, a_event_position);
+  ltt_event_position_get(a_event_position, &tf_pos, &nb_block, &offset, &tsc);
+  
+  if(ltt_time_compare(time, count_previous_time) < 0) {
+    g_warning("Time decreasing trace %s tracefile %s cpu %u position %u/%u",
+  g_quark_to_string(ltt_trace_name(ltt_tracefile_get_trace(tracefile))),
+  g_quark_to_string(ltt_tracefile_name(tracefile)), 
+  ltt_tracefile_num(tracefile), nb_block, offset);
+    g_warning("last time %lu.%lu vs current %lu.%lu",
+  count_previous_time.tv_sec, count_previous_time.tv_nsec,
+  time.tv_sec, time.tv_nsec);
+  } 
+  count_previous_time = time;
+
+
+
   return FALSE;
 }
 
index 5c2a17cb33b1ac349a1a609fe88d7098104b5494..03cee2cca190717b05e880ddcaf1d73e0f1e59db 100644 (file)
@@ -39,7 +39,7 @@ gint compare_tracefile(gconstpointer a, gconstpointer b)
   const LttvTracefileContext *trace_b = (const LttvTracefileContext *)b;
 
   if(likely(trace_a != trace_b)) {
-    comparison = ltt_time_compare(trace_b->timestamp, trace_a->timestamp);
+    comparison = ltt_time_compare(trace_a->timestamp, trace_b->timestamp);
     if(unlikely(comparison == 0)) {
       if(trace_a->index < trace_b->index) comparison = -1;
       else if(trace_a->index > trace_b->index) comparison = 1;
This page took 0.025126 seconds and 4 git commands to generate.