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;
*/
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 */
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,
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")
#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>
*before_trace,
*event_hook;
-
void print_field(LttEvent *e, LttField *f, GString *s, gboolean field_names) {
LttType *type;
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");
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
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);
}
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);
+
}
/**
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",