From b221eaef042bc0172958536cccf416519f059290 Mon Sep 17 00:00:00 2001 From: compudj Date: Thu, 29 Jan 2009 23:39:49 +0000 Subject: [PATCH] add kprobes support, don't print textDump stats if not required git-svn-id: http://ltt.polymtl.ca/svn@3302 04897980-b3bd-0310-b5e0-8ef037075253 --- trunk/lttv/lttv/modules/text/batchAnalysis.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/trunk/lttv/lttv/modules/text/batchAnalysis.c b/trunk/lttv/lttv/modules/text/batchAnalysis.c index 12dea8d5..f78f3774 100644 --- a/trunk/lttv/lttv/modules/text/batchAnalysis.c +++ b/trunk/lttv/lttv/modules/text/batchAnalysis.c @@ -69,19 +69,26 @@ static gboolean process_traceset(void *hook_data, void *call_data) LttvTracesetStats *tscs; + LttvTracesetState *tss; + LttvTracesetContext *tc; LttTime start, end; g_info("BatchAnalysis begin process traceset"); - tscs = g_object_new(LTTV_TRACESET_STATS_TYPE, NULL); - tc = &tscs->parent.parent; + if (a_stats) { + tscs = g_object_new(LTTV_TRACESET_STATS_TYPE, NULL); + tss = &tscs->parent; + } else { + tss = g_object_new(LTTV_TRACESET_STATE_TYPE, NULL); + } + tc = &tss->parent; g_info("BatchAnalysis initialize context"); lttv_context_init(tc, traceset); - lttv_state_add_event_hooks(&tscs->parent); + lttv_state_add_event_hooks(tc); if(a_stats) lttv_stats_add_event_hooks(tscs); g_assert(lttv_iattribute_find_by_path(attributes, "filter/expression", @@ -132,10 +139,13 @@ static gboolean process_traceset(void *hook_data, void *call_data) g_info("BatchAnalysis destroy context"); lttv_filter_destroy(*(value_filter.v_pointer)); - lttv_state_remove_event_hooks(&tscs->parent); + lttv_state_remove_event_hooks(tss); if(a_stats) lttv_stats_remove_event_hooks(tscs); lttv_context_fini(tc); - g_object_unref(tscs); + if (a_stats) + g_object_unref(tscs); + else + g_object_unref(tss); g_info("BatchAnalysis end process traceset"); return FALSE; -- 2.34.1