text module
[lttv.git] / ltt / branches / poly / lttv / modules / text / batchAnalysis.c
index 1d1ac2348f2234c9d8a49ca7b27c4542ec18fd83..4482a35ccf565a12a701a42880dca21f5baaec92 100644 (file)
@@ -28,6 +28,7 @@
 #include <lttv/tracecontext.h>
 #include <lttv/state.h>
 #include <lttv/stats.h>
+#include <lttv/filter.h>
 #include <ltt/trace.h>
 
 static LttvTraceset *traceset;
@@ -46,6 +47,10 @@ static char *a_trace;
 
 static gboolean a_stats;
 
+static LttvFilter *a_lttv_filter;
+
+extern GString *a_filter_string;
+
 void lttv_trace_option(void *hook_data)
 { 
   LttTrace *trace;
@@ -75,6 +80,9 @@ static gboolean process_traceset(void *hook_data, void *call_data)
   lttv_state_add_event_hooks(&tscs->parent);
   if(a_stats) lttv_stats_add_event_hooks(tscs);
 
+  a_lttv_filter = lttv_filter_new();
+  lttv_filter_append_expression(a_lttv_filter,a_filter_string->str);
+  
   //lttv_traceset_context_add_hooks(tc,
   //before_traceset, after_traceset, NULL, before_trace, after_trace,
   //NULL, before_tracefile, after_tracefile, NULL, before_event, after_event);
@@ -110,12 +118,14 @@ static gboolean process_traceset(void *hook_data, void *call_data)
                             event_hook,
                             NULL);
 
+  lttv_filter_destroy(a_lttv_filter);
   lttv_state_remove_event_hooks(&tscs->parent);
   if(a_stats) lttv_stats_remove_event_hooks(tscs);
   lttv_context_fini(tc);
   g_object_unref(tscs);
 
   g_info("BatchAnalysis end process traceset");
+  return FALSE;
 }
 
 
@@ -212,7 +222,8 @@ static void destroy()
   for(i = 0 ; i < nb ; i++) {
     trace = lttv_traceset_get(traceset, i);
     ltt_trace_close(lttv_trace(trace));
-    lttv_trace_destroy(trace);
+    /* This will be done by lttv_traceset_destroy */
+    //lttv_trace_destroy(trace);
   }
 
   lttv_traceset_destroy(traceset); 
@@ -221,4 +232,4 @@ static void destroy()
 
 LTTV_MODULE("batchAnalysis", "Batch processing of a trace", \
     "Run through a trace calling all the registered hooks", \
-    init, destroy, "state", "stats", "option")
+    init, destroy, "state", "stats", "option","textFilter")
This page took 0.023836 seconds and 4 git commands to generate.