Changes on the overall structure of the filter
[lttv.git] / ltt / branches / poly / lttv / modules / text / batchAnalysis.c
index df17c092b87384d12fbdd88d899ee4061f793ee9..a57f0aac5211f7ed4f26d3a524af9cc837c0848c 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 lttv_filter *a_lttv_filter;
+
+extern GString *a_filter_string;
+
 void lttv_trace_option(void *hook_data)
 { 
   LttTrace *trace;
@@ -75,6 +80,8 @@ 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(a_filter_string,(LttvTraceState*)tscs);
+  
   //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,6 +117,7 @@ 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);
@@ -223,4 +231,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","filter")
This page took 0.028815 seconds and 4 git commands to generate.