text module
authorsiboud <siboud@04897980-b3bd-0310-b5e0-8ef037075253>
Sat, 26 Mar 2005 21:32:37 +0000 (21:32 +0000)
committersiboud <siboud@04897980-b3bd-0310-b5e0-8ef037075253>
Sat, 26 Mar 2005 21:32:37 +0000 (21:32 +0000)
- added link to the batchAnalysis module
- linked the textDump module to the actual filter core

git-svn-id: http://ltt.polymtl.ca/svn@906 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/lttv/lttv/filter.c
ltt/branches/poly/lttv/modules/text/batchAnalysis.c
ltt/branches/poly/lttv/modules/text/textDump.c
ltt/branches/poly/lttv/modules/text/textFilter.c

index b39b844c4392b6150ebfb3d7d8b0b9348e14d1ba..b5986c9aaf54eba18dcfb18ea821ec1d59da1bd0 100644 (file)
@@ -146,12 +146,12 @@ gboolean
 parse_field_path(GPtrArray* fp, LttvSimpleExpression* se) {
 
   GString* f = NULL;
-  g_print("fp->len:%i\n",fp->len);
-  int i;
-  for(i=0;i<fp->len;i++) { 
-      GString* f2 = g_ptr_array_index(fp,i);
-      g_print("%i=%s",i,f2->str); 
-  }
+//  g_print("fp->len:%i\n",fp->len);
+//  int i;
+//  for(i=0;i<fp->len;i++) { 
+//      GString* f2 = g_ptr_array_index(fp,i);
+//      g_print("%i=%s",i,f2->str); 
+//  }
   if(fp->len < 2) return FALSE;
   g_assert(f=g_ptr_array_index(fp,0)); //list_first(fp)->data; 
  
@@ -283,10 +283,10 @@ parse_field_path(GPtrArray* fp, LttvSimpleExpression* se) {
  */
 gboolean assign_operator(LttvSimpleExpression* se, LttvExpressionOp op) {
      
-  g_print("se->field = %i\n",se->field);
-  g_print("se->offset = %i\n",se->offset);
-  g_print("se->op = %p\n",se->op);
-  g_print("se->value = %s\n",se->value);
+//  g_print("se->field = %i\n",se->field);
+//  g_print("se->offset = %i\n",se->offset);
+//  g_print("se->op = %p\n",se->op);
+//  g_print("se->value = %s\n",se->value);
     
   switch(se->field) {
      /* char */
index ec68e7f1490b2deae76980673f29903c6224efd3..4482a35ccf565a12a701a42880dca21f5baaec92 100644 (file)
@@ -80,7 +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);
+  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,
@@ -231,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","filter")
+    init, destroy, "state", "stats", "option","textFilter")
index ded3c89744c3b3402c9e1ad6ee81e20dca80bd9e..fea42ef0800b49cbac826eeed1215099e9ada94f 100644 (file)
@@ -27,6 +27,7 @@
 #include <lttv/attribute.h>
 #include <lttv/iattribute.h>
 #include <lttv/stats.h>
+#include <lttv/filter.h>
 #include <ltt/ltt.h>
 #include <ltt/event.h>
 #include <ltt/type.h>
@@ -49,7 +50,6 @@ static LttvHooks
   *before_trace,
   *event_hook;
 
-
 void print_field(LttEvent *e, LttField *f, GString *s, gboolean field_names) {
 
   LttType *type;
@@ -335,6 +335,11 @@ static int write_event_content(void *hook_data, void *call_data)
 
   e = tfc->e;
 
+  /*
+   * call to the filter if available
+   */
+  //  lttv_filter_tree_parse(f->head,e,NULL,NULL,NULL);
+  
   lttv_event_to_string(e, a_string, TRUE, a_field_names, tfs);
   g_string_append_printf(a_string,"\n");  
 
index 83895e9263900f5adabcedd40ff6d3b20e4c8a5c..27b878a35da9ede685ddd63518cbfe83fed5666f 100644 (file)
@@ -56,14 +56,12 @@ static char
 GString
   *a_filter_string = NULL;
 
-
 static LttvHooks
   *before_traceset,
   *event_hook;
 
 static FILE *a_file;
 
-
 /**
  * filters the file input from user
  * @param hook_data the hook data
@@ -93,12 +91,14 @@ void filter_analyze_file(void *hook_data) {
   else {
     g_string_append(a_filter_string,"&"); /*conjonction between expression*/
   }
+
   while(!feof(a_file)) {
     getline(&line,&len,a_file);
     g_string_append(a_filter_string,line);
     line = NULL;
   }
+//  lttv_filter_append_expression(lttvfilter_t,a_filter_string->str);
   
   fclose(a_file);
 }
@@ -122,10 +122,12 @@ void filter_analyze_string(void *hook_data) {
     g_string_append(a_filter_string,a_string);
   }
   else {
-    g_string_append(a_filter_string,"&"); /*conjonction between expression*/
+    g_string_append(a_filter_string,"&"); 
     g_string_append(a_filter_string,a_string);
   }
 
+//  lttv_filter_append_expression(lttvfilter_t,a_string); 
+
 }
 
 /**
@@ -152,7 +154,7 @@ static void init() {
   LttvIAttribute *attributes = LTTV_IATTRIBUTE(lttv_global_attributes());
 
   g_info("Init textFilter.c");
-  
   a_string = NULL;
   lttv_option_add("string", 's', 
       "filters a string issued by the user on the command line", 
This page took 0.028407 seconds and 4 git commands to generate.