X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2Ftext%2FbatchAnalysis.c;h=4482a35ccf565a12a701a42880dca21f5baaec92;hb=cec3d7b0a4303198eb608ecccd44454d56ab7b04;hp=1d1ac2348f2234c9d8a49ca7b27c4542ec18fd83;hpb=12c59c3d7642704991efec208aff605b77fa32e5;p=lttv.git diff --git a/ltt/branches/poly/lttv/modules/text/batchAnalysis.c b/ltt/branches/poly/lttv/modules/text/batchAnalysis.c index 1d1ac234..4482a35c 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 LttvFilter *a_lttv_filter; + +extern GString *a_filter_string; + void lttv_trace_option(void *hook_data) { LttTrace *trace; @@ -75,6 +80,9 @@ 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(); + 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, //NULL, before_tracefile, after_tracefile, NULL, before_event, after_event); @@ -110,12 +118,14 @@ 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); g_object_unref(tscs); g_info("BatchAnalysis end process traceset"); + return FALSE; } @@ -212,7 +222,8 @@ static void destroy() for(i = 0 ; i < nb ; i++) { trace = lttv_traceset_get(traceset, i); ltt_trace_close(lttv_trace(trace)); - lttv_trace_destroy(trace); + /* This will be done by lttv_traceset_destroy */ + //lttv_trace_destroy(trace); } lttv_traceset_destroy(traceset); @@ -221,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") + init, destroy, "state", "stats", "option","textFilter")