starting to work on lttv filter
authorsiboud <siboud@04897980-b3bd-0310-b5e0-8ef037075253>
Fri, 4 Feb 2005 02:49:02 +0000 (02:49 +0000)
committersiboud <siboud@04897980-b3bd-0310-b5e0-8ef037075253>
Fri, 4 Feb 2005 02:49:02 +0000 (02:49 +0000)
modified filter.c and filter.h
modified Makefile.am lttv/lttv/Makefile.am lttv/modules/text/Makefile.am

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

ltt/branches/poly/Makefile.am
ltt/branches/poly/lttv/lttv/Makefile.am
ltt/branches/poly/lttv/lttv/filter.c
ltt/branches/poly/lttv/lttv/filter.h
ltt/branches/poly/lttv/modules/text/Makefile.am

index 9b5e422fec6a65c807d2f257be1f69d2a7074725..1fc073f17181cc5d3e067ec4f791f886c18ee7d3 100644 (file)
@@ -1,6 +1,6 @@
 # WARNING : ltt must come before lttv, so that the traceread library is
 # up to date
 
-SUBDIRS = ltt lttv lttd doc
+SUBDIRS = ltt lttv lttd
 
 
index 3ccb55c3a4becce38f0e7c4ce28dc6ac729b9cc2..f54180408f664a93d6283a4196df6b2dfc5a5356 100644 (file)
@@ -20,15 +20,16 @@ lttvinclude_HEADERS = \
        state.h\
        stats.h\
        tracecontext.h\
-       traceset.h
-
-noinst_HEADERS = \
+       traceset.h\
        filter.h
 
+#noinst_HEADERS = \
+#      filter.h
+
 lttv_SOURCES = batchtest.c main.c module.c option.c \
                hook.c attribute.c \
                iattribute.c state.c stats.c \
-              tracecontext.c traceset.c
+              tracecontext.c traceset.c filter.c
 
 if LTTVSTATIC
   lttv_LDFLAGS = -profile -static
index 74cd30e15a9cb0664e987522d8aa152d0a4e7a8c..a5185ae489db1dab2c0da1fb67db733db4920f75 100644 (file)
  * MA 02111-1307, USA.
  */
 
-
+/*
    consist in AND, OR and NOT nested expressions, forming a tree with 
    simple relations as leaves. The simple relations test is a field
    in an event is equal, not equal, smaller, smaller or equal, larger, or
    larger or equal to a specified value. */
 
+#include <lttv/filter.h>
+
 typedef enum _lttv_expression_op
 { LTTV_FIELD_EQ,
   LTTV_FIELD_NE,
@@ -31,46 +33,80 @@ typedef enum _lttv_expression_op
   LTTV_FIELD_GE
 } lttv_expression_op;
 
-typedef _lttv_simple_expression
-{ lttv_expression_op op;
+typedef enum _lttv_expression_type
+{ 
+  LTTV_EXPRESSION,
+  LTTV_SIMPLE_EXPRESSION
+} lttv_expression_type;
+
+typedef struct _lttv_simple_expression
+{ 
+  lttv_expression_op op;
   char *field_name;
   char *value;
 } lttv_simple_expression;
 
-typedef _lttv_expression_type
-{ LTTV_EXPRESSION,
-  LTTV_SIMPLE_EXPRESSION
-
-}
 typedef struct _lttv_expression 
-{ bool or;
-  bool not;
-  bool simple_expression;
-  union 
-  { lttv_expression *e;
-    lttv_field_relation *se;
-  } e;
+{ 
+  gboolean or;
+  gboolean not;
+  gboolean simple_expression;
+//  union e 
+//  { 
+//     lttv_expression *e;
+//     lttv_field_relation *se;
+//  };
 } lttv_expression;
 
-read_token
+/*
+       read_token
 
-read_expression
-  ( read expr )
-  simple expr [ op expr ]
+       read_expression
+         ( read expr )
+         simple expr [ op expr ]
 
-read_simple_expression
-  read_field_path [ rel value ]
+       read_simple_expression
+         read_field_path [ rel value ]
 
-read_field_path
-  read_field_component [. field path]
+       read_field_path
+         read_field_component [. field path]
 
-read_field_component
-  name [ \[ value \] ]
+       read_field_component
+         name [ \[ value \] ]
 
-data struct:
-and/or(left/right)
-not(child)
-op(left/right)
-path(component...) -> field
+       data struct:
+       and/or(left/right)
+       not(child)
+       op(left/right)
+       path(component...) -> field
+*/
+
+/**
+ *     create a new lttv_filter
+ *     @param expression filtering options string
+ *     @param t pointer to the current LttvTrace
+ *     @return the current lttv_filter
+ */
+lttv_filter*
+lttv_filter_new(char *expression, LttvTrace *t) {
 
+       g_print("filter::lttv_filter_new()\n");         /* debug */
 
+       /*
+        *      1. parse expression
+        *      2. construct binary tree
+        *      3. return corresponding filter
+        */
+
+       
+}
+
+gboolean
+lttv_filter_tracefile(lttv_filter *filter, void *tracefile) {
+
+}
+
+gboolean
+lttv_filter_event(lttv_filter *filter, void *event) {
+
+}
index 560c45d1b80b174a22027e58c0723eb31034bbe9..c6a53e58cef9472a7937f5e2e86f6bb585bf4708 100644 (file)
@@ -19,6 +19,8 @@
 #ifndef FILTER_H
 #define FILTER_H
 
+#include <lttv/traceset.h>
+
 /* A filter expression consists in nested AND, OR and NOT expressions
    involving boolean relation (>, >=, =, !=, <, <=) between event fields and 
    specific values. It is compiled into an efficient data structure which
 
 */
 
-
+/**
+ * @struct lttv_filter
+ * ( will later contain a binary tree of filtering options )
+ */
 typedef struct _lttv_filter lttv_filter;
 
-
 /* Compile the filter expression into an efficient data structure */
 
-lttv_filter *lttv_filter_new(char *expression, lttv_trace *t);
+lttv_filter *lttv_filter_new(char *expression, LttvTrace *t);
 
 
 /* Check if the tracefile or event satisfies the filter. The arguments are
    declared as void * to allow these functions to be used as hooks. */
 
-bool lttv_filter_tracefile(void *filter, void *tracefile);
+gboolean lttv_filter_tracefile(lttv_filter *filter, void *tracefile);
 
-bool lttv_filter_event(void *filter, void *event);
+gboolean lttv_filter_event(lttv_filter *filter, void *event);
 
 #endif // FILTER_H
 
index 88f9235fc919e8d48d4afb726f9145965fb3f8ab..947ddd9bc912180cd7f3bed604e40d3985281ce2 100644 (file)
@@ -5,11 +5,13 @@ LIBS += $(GLIB_LIBS) -lgobject-2.0 -L$(top_srcdir)/ltt -ltraceread
 
 libdir = ${lttvplugindir}
 
-lib_LTLIBRARIES = libtextDump.la libbatchAnalysis.la
+lib_LTLIBRARIES = libtextDump.la libbatchAnalysis.la libtextFilter.la
 libtextDump_la_LDFLAGS = -module
 libtextDump_la_SOURCES = textDump.c
 libbatchAnalysis_la_LDFLAGS = -module
 libbatchAnalysis_la_SOURCES = batchAnalysis.c
+libtextFilter_la_LDFLAGS = -module
+libtextFilter_la_SOURCES = textFilter.c
 
 noinst_HEADERS = \
        batchanalysis.h
This page took 0.027825 seconds and 4 git commands to generate.