state hooks bug fixed
[lttv.git] / ltt / branches / poly / lttv / lttv / batchtest.c
index 8bb3743836959902303bb1dd9dc1a52ea3d8b4d1..bacca9ba31a804146a5f4e407b4f1091c556782c 100644 (file)
@@ -99,8 +99,11 @@ static void lttv_trace_option(void __UNUSED__ *hook_data)
   LttTrace *trace;
 
   trace = ltt_trace_open(a_trace);
-  if(trace == NULL) g_critical("cannot open trace %s", a_trace);
-  lttv_traceset_add(traceset, lttv_trace_new(trace));
+  if(trace == NULL) {
+    g_critical("cannot open trace %s", a_trace);
+  } else {
+    lttv_traceset_add(traceset, lttv_trace_new(trace));
+  }
 }
 
 static double get_time() 
@@ -282,6 +285,7 @@ static void compute_tracefile(LttTracefile *tracefile, void *hook_data)
   
   sanitize_name(mod_name);
   
+  g_warning("test %s test", g_quark_to_string(ltt_tracefile_name(tracefile)));
   g_string_printf(filename, "%s.%s.%u.trace", a_dump_tracefiles,
       mod_name, ltt_tracefile_num(tracefile));
   fp = fopen(filename->str, "w");
@@ -310,9 +314,13 @@ static void compute_tracefile(LttTracefile *tracefile, void *hook_data)
         g_quark_to_string(ltt_tracefile_name(tracefile)));
 
     if(ltt_time_compare(time, previous_time) < 0) {
-      g_warning("Time decreasing trace %s tracefile %s position %u/%u",
+      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)), nb_block, offset);
+    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",
+    previous_time.tv_sec, previous_time.tv_nsec,
+    time.tv_sec, time.tv_nsec);
     }
 
 #if 0 //FIXME
@@ -418,7 +426,7 @@ static gboolean process_traceset(void __UNUSED__ *hook_data,
     lttv_hooks_add(event_hook, count_event, &count, LTTV_PRIO_DEFAULT);
     t = run_one_test(ts, ltt_time_zero, max_time);
     lttv_hooks_remove_data(event_hook, count_event, &count);
-    g_warning(
+    g_message(
         "Processing trace while counting events (%u events in %g seconds)",
        count, t);
   }
@@ -429,7 +437,7 @@ static gboolean process_traceset(void __UNUSED__ *hook_data,
     lttv_state_add_event_hooks(ts);
     t = run_one_test(ts, ltt_time_zero, max_time);
     lttv_state_remove_event_hooks(ts);
-    g_warning("Processing trace while updating state (%g seconds)", t);
+    g_message("Processing trace while updating state (%g seconds)", t);
   }
 
   /* Run through all events computing the state and writing it out 
@@ -469,7 +477,7 @@ static gboolean process_traceset(void __UNUSED__ *hook_data,
     lttv_stats_add_event_hooks(tscs);
     t = run_one_test(ts, ltt_time_zero, max_time);
     lttv_stats_remove_event_hooks(tscs);
-    g_warning("Processing trace while counting stats (%g seconds)", t);
+    g_message("Processing trace while counting stats (%g seconds)", t);
 
     if(lttv_profile_memory) {
       g_message("Memory summary after computing stats");
@@ -505,7 +513,7 @@ static gboolean process_traceset(void __UNUSED__ *hook_data,
     t = run_one_test(ts, ltt_time_zero, max_time);
     lttv_state_remove_event_hooks(ts);
     lttv_stats_remove_event_hooks(tscs);
-    g_warning(
+    g_message(
         "Processing trace while counting state and stats (%g seconds)", t);
 
     if(lttv_profile_memory) {
@@ -544,7 +552,7 @@ static gboolean process_traceset(void __UNUSED__ *hook_data,
     if(a_save_state_copy)
         lttv_hooks_remove_data(event_hook,save_state_copy_event, &save_state);
 
-    g_warning("Processing trace while updating/saving state (%g seconds)", t);
+    g_message("Processing trace while updating/saving state (%g seconds)", t);
 
     if(lttv_profile_memory) {
       g_message("Memory summary after computing/saving state");
@@ -564,7 +572,7 @@ static gboolean process_traceset(void __UNUSED__ *hook_data,
         t = run_one_test(ts, save_state.write_time[j], 
             save_state.write_time[j]);
         lttv_state_remove_event_hooks(ts);
-        g_warning("Seeking to %lu.%lu (%g seconds)", 
+        g_message("Seeking to %lu.%lu (%g seconds)", 
             save_state.write_time[j].tv_sec, save_state.write_time[j].tv_nsec,
             t);
 
This page took 0.023756 seconds and 4 git commands to generate.