From: siboud Date: Tue, 15 Mar 2005 00:06:04 +0000 (+0000) Subject: Changes on the overall structure of the filter X-Git-Tag: v0.12.20~2602 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=1da1525dc4a987ee97bd025f96d2ee75804d2012;p=lttv.git Changes on the overall structure of the filter - text module - batchAnalysis -- added construction of tree - core filter - work on structure for tree parsing git-svn-id: http://ltt.polymtl.ca/svn@887 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/ltt/branches/poly/lttv/lttv/filter.c b/ltt/branches/poly/lttv/lttv/filter.c index 9669c649..8b03facf 100644 --- a/ltt/branches/poly/lttv/lttv/filter.c +++ b/ltt/branches/poly/lttv/lttv/filter.c @@ -500,6 +500,11 @@ lttv_filter_new(char *expression, LttvTraceState *tcs) { } +void +lttv_filter_destroy(lttv_filter* filter) { + +} + /** * Apply the filter to a specific trace * @param filter the current filter applied diff --git a/ltt/branches/poly/lttv/lttv/filter.h b/ltt/branches/poly/lttv/lttv/filter.h index 6c8d1404..a108fa8b 100644 --- a/ltt/branches/poly/lttv/lttv/filter.h +++ b/ltt/branches/poly/lttv/lttv/filter.h @@ -176,6 +176,8 @@ gboolean parse_simple_expression(GString* expression); /* Compile the filter expression into an efficient data structure */ lttv_filter_tree *lttv_filter_new(char *expression, LttvTraceState *tfs); +void lttv_filter_destroy(lttv_filter* filter); + /* Check if the tracefile or event satisfies the filter. The arguments are declared as void * to allow these functions to be used as hooks. */ diff --git a/ltt/branches/poly/lttv/modules/gui/filter/.deps/filter.Plo b/ltt/branches/poly/lttv/modules/gui/filter/.deps/filter.Plo index a78cdee5..e1957564 100644 --- a/ltt/branches/poly/lttv/modules/gui/filter/.deps/filter.Plo +++ b/ltt/branches/poly/lttv/modules/gui/filter/.deps/filter.Plo @@ -3,14 +3,14 @@ filter.lo filter.o: filter.c /usr/include/glib-2.0/glib.h \ /usr/include/glib-2.0/glib/gtypes.h \ /usr/lib/glib-2.0/include/glibconfig.h \ /usr/include/glib-2.0/glib/gmacros.h \ - /usr/lib/gcc-lib/i486-linux/3.3.5/include/stddef.h \ - /usr/lib/gcc-lib/i486-linux/3.3.5/include/limits.h \ - /usr/lib/gcc-lib/i486-linux/3.3.5/include/syslimits.h \ + /usr/lib/gcc/i386-redhat-linux/3.4.2/include/stddef.h \ + /usr/lib/gcc/i386-redhat-linux/3.4.2/include/limits.h \ + /usr/lib/gcc/i386-redhat-linux/3.4.2/include/syslimits.h \ /usr/include/limits.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/gnu/stubs.h /usr/include/bits/posix1_lim.h \ /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ /usr/include/bits/posix2_lim.h \ - /usr/lib/gcc-lib/i486-linux/3.3.5/include/float.h \ + /usr/lib/gcc/i386-redhat-linux/3.4.2/include/float.h \ /usr/include/glib-2.0/glib/garray.h \ /usr/include/glib-2.0/glib/gasyncqueue.h \ /usr/include/glib-2.0/glib/gthread.h \ @@ -30,7 +30,7 @@ filter.lo filter.o: filter.c /usr/include/glib-2.0/glib.h \ /usr/include/glib-2.0/glib/gstring.h \ /usr/include/glib-2.0/glib/gunicode.h \ /usr/include/glib-2.0/glib/gutils.h \ - /usr/lib/gcc-lib/i486-linux/3.3.5/include/stdarg.h \ + /usr/lib/gcc/i386-redhat-linux/3.4.2/include/stdarg.h \ /usr/include/glib-2.0/glib/gmarkup.h \ /usr/include/glib-2.0/glib/gmessages.h \ /usr/include/glib-2.0/glib/gnode.h \ @@ -143,6 +143,7 @@ filter.lo filter.o: filter.c /usr/include/glib-2.0/glib.h \ /usr/include/atk-1.0/atk/atknoopobjectfactory.h \ /usr/include/atk-1.0/atk/atkobjectfactory.h \ /usr/include/atk-1.0/atk/atkregistry.h \ + /usr/include/atk-1.0/atk/atkobjectfactory.h \ /usr/include/atk-1.0/atk/atkrelation.h \ /usr/include/atk-1.0/atk/atkrelationset.h \ /usr/include/atk-1.0/atk/atkselection.h \ @@ -269,7 +270,10 @@ filter.lo filter.o: filter.c /usr/include/glib-2.0/glib.h \ /usr/include/gtk-2.0/gtk/gtktextmark.h \ /usr/include/gtk-2.0/gtk/gtktextview.h \ /usr/include/gtk-2.0/gtk/gtktipsquery.h \ + /usr/include/gtk-2.0/gtk/gtktoggletoolbutton.h \ /usr/include/gtk-2.0/gtk/gtktoolbar.h \ + /usr/include/gtk-2.0/gtk/gtktoolbutton.h \ + /usr/include/gtk-2.0/gtk/gtktoolitem.h \ /usr/include/gtk-2.0/gtk/gtktree.h \ /usr/include/gtk-2.0/gtk/gtktreednd.h \ /usr/include/gtk-2.0/gtk/gtktreeitem.h \ @@ -312,11 +316,11 @@ filter.lo filter.o: filter.c /usr/include/glib-2.0/glib.h \ /usr/include/glib-2.0/glib/gmacros.h: -/usr/lib/gcc-lib/i486-linux/3.3.5/include/stddef.h: +/usr/lib/gcc/i386-redhat-linux/3.4.2/include/stddef.h: -/usr/lib/gcc-lib/i486-linux/3.3.5/include/limits.h: +/usr/lib/gcc/i386-redhat-linux/3.4.2/include/limits.h: -/usr/lib/gcc-lib/i486-linux/3.3.5/include/syslimits.h: +/usr/lib/gcc/i386-redhat-linux/3.4.2/include/syslimits.h: /usr/include/limits.h: @@ -334,7 +338,7 @@ filter.lo filter.o: filter.c /usr/include/glib-2.0/glib.h \ /usr/include/bits/posix2_lim.h: -/usr/lib/gcc-lib/i486-linux/3.3.5/include/float.h: +/usr/lib/gcc/i386-redhat-linux/3.4.2/include/float.h: /usr/include/glib-2.0/glib/garray.h: @@ -384,7 +388,7 @@ filter.lo filter.o: filter.c /usr/include/glib-2.0/glib.h \ /usr/include/glib-2.0/glib/gutils.h: -/usr/lib/gcc-lib/i486-linux/3.3.5/include/stdarg.h: +/usr/lib/gcc/i386-redhat-linux/3.4.2/include/stdarg.h: /usr/include/glib-2.0/glib/gmarkup.h: @@ -644,6 +648,8 @@ filter.lo filter.o: filter.c /usr/include/glib-2.0/glib.h \ /usr/include/atk-1.0/atk/atkregistry.h: +/usr/include/atk-1.0/atk/atkobjectfactory.h: + /usr/include/atk-1.0/atk/atkrelation.h: /usr/include/atk-1.0/atk/atkrelationset.h: @@ -914,8 +920,14 @@ filter.lo filter.o: filter.c /usr/include/glib-2.0/glib.h \ /usr/include/gtk-2.0/gtk/gtktipsquery.h: +/usr/include/gtk-2.0/gtk/gtktoggletoolbutton.h: + /usr/include/gtk-2.0/gtk/gtktoolbar.h: +/usr/include/gtk-2.0/gtk/gtktoolbutton.h: + +/usr/include/gtk-2.0/gtk/gtktoolitem.h: + /usr/include/gtk-2.0/gtk/gtktree.h: /usr/include/gtk-2.0/gtk/gtktreednd.h: diff --git a/ltt/branches/poly/lttv/modules/text/batchAnalysis.c b/ltt/branches/poly/lttv/modules/text/batchAnalysis.c index df17c092..a57f0aac 100644 --- a/ltt/branches/poly/lttv/modules/text/batchAnalysis.c +++ b/ltt/branches/poly/lttv/modules/text/batchAnalysis.c @@ -28,6 +28,7 @@ #include #include #include +#include #include 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") diff --git a/ltt/branches/poly/lttv/modules/text/textFilter.c b/ltt/branches/poly/lttv/modules/text/textFilter.c index 6013fea6..83895e92 100644 --- a/ltt/branches/poly/lttv/modules/text/textFilter.c +++ b/ltt/branches/poly/lttv/modules/text/textFilter.c @@ -53,7 +53,7 @@ static char *a_file_name = NULL, *a_string = NULL; -static GString +GString *a_filter_string = NULL; @@ -100,7 +100,6 @@ void filter_analyze_file(void *hook_data) { line = NULL; } - lttv_filter_new(a_filter_string->str,NULL); fclose(a_file); } @@ -181,7 +180,6 @@ static void init() { // LTTV_POINTER, &value)); // g_assert((before_traceset = *(value.v_pointer)) != NULL); // lttv_hooks_add(before_traceset, parse_filter_options, NULL, LTTV_PRIO_DEFAULT); - }