From 12c59c3d7642704991efec208aff605b77fa32e5 Mon Sep 17 00:00:00 2001 From: compudj Date: Wed, 26 May 2004 21:16:17 +0000 Subject: [PATCH] text modules modified to fit tracecontext mods git-svn-id: http://ltt.polymtl.ca/svn@563 04897980-b3bd-0310-b5e0-8ef037075253 --- .../poly/lttv/modules/text/batchAnalysis.c | 58 +++++++++++++------ .../poly/lttv/modules/text/textDump.c | 18 +++--- 2 files changed, 49 insertions(+), 27 deletions(-) diff --git a/ltt/branches/poly/lttv/modules/text/batchAnalysis.c b/ltt/branches/poly/lttv/modules/text/batchAnalysis.c index 1c69df33..1d1ac234 100644 --- a/ltt/branches/poly/lttv/modules/text/batchAnalysis.c +++ b/ltt/branches/poly/lttv/modules/text/batchAnalysis.c @@ -39,8 +39,7 @@ static LttvHooks *after_trace, *before_tracefile, *after_tracefile, - *before_event, - *after_event, + *event_hook, *main_hooks; static char *a_trace; @@ -76,9 +75,15 @@ 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); - 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); + //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); + lttv_process_traceset_begin(tc, + before_traceset, + before_trace, + before_tracefile, + event_hook, + NULL); start.tv_sec = 0; start.tv_nsec = 0; @@ -88,13 +93,23 @@ static gboolean process_traceset(void *hook_data, void *call_data) g_info("BatchAnalysis process traceset"); lttv_process_traceset_seek_time(tc, start); - lttv_process_traceset(tc, end, G_MAXULONG); + lttv_process_traceset_middle(tc, + end, + G_MAXULONG, + NULL); g_info("BatchAnalysis destroy context"); - lttv_traceset_context_remove_hooks(tc, - before_traceset, after_traceset, NULL, before_trace, after_trace, - NULL, before_tracefile, after_tracefile, NULL, before_event, after_event); + //lttv_traceset_context_remove_hooks(tc, + //before_traceset, after_traceset, NULL, before_trace, after_trace, + //NULL, before_tracefile, after_tracefile, NULL, before_event, after_event); + lttv_process_traceset_end(tc, + after_traceset, + after_trace, + after_tracefile, + event_hook, + NULL); + lttv_state_remove_event_hooks(&tscs->parent); if(a_stats) lttv_stats_remove_event_hooks(tscs); lttv_context_fini(tc); @@ -132,8 +147,9 @@ static void init() after_trace = lttv_hooks_new(); before_tracefile = lttv_hooks_new(); after_tracefile = lttv_hooks_new(); - before_event = lttv_hooks_new(); - after_event = lttv_hooks_new(); + //before_event = lttv_hooks_new(); + //after_event = lttv_hooks_new(); + event_hook = lttv_hooks_new(); g_assert(lttv_iattribute_find_by_path(attributes, "hooks/traceset/before", LTTV_POINTER, &value)); @@ -153,17 +169,20 @@ static void init() g_assert(lttv_iattribute_find_by_path(attributes, "hooks/tracefile/after", LTTV_POINTER, &value)); *(value.v_pointer) = after_tracefile; - g_assert(lttv_iattribute_find_by_path(attributes, "hooks/event/before", - LTTV_POINTER, &value)); - *(value.v_pointer) = before_event; - g_assert(lttv_iattribute_find_by_path(attributes, "hooks/event/after", + //g_assert(lttv_iattribute_find_by_path(attributes, "hooks/event/before", + // LTTV_POINTER, &value)); + //*(value.v_pointer) = before_event; + //g_assert(lttv_iattribute_find_by_path(attributes, "hooks/event/after", + // LTTV_POINTER, &value)); + //*(value.v_pointer) = after_event; + g_assert(lttv_iattribute_find_by_path(attributes, "hooks/event", LTTV_POINTER, &value)); - *(value.v_pointer) = after_event; + *(value.v_pointer) = event_hook; g_assert(lttv_iattribute_find_by_path(attributes, "hooks/main/before", LTTV_POINTER, &value)); g_assert((main_hooks = *(value.v_pointer)) != NULL); - lttv_hooks_add(main_hooks, process_traceset, NULL); + lttv_hooks_add(main_hooks, process_traceset, NULL, LTTV_PRIO_DEFAULT); } @@ -184,8 +203,9 @@ static void destroy() lttv_hooks_destroy(after_trace); lttv_hooks_destroy(before_tracefile); lttv_hooks_destroy(after_tracefile); - lttv_hooks_destroy(before_event); - lttv_hooks_destroy(after_event); + //lttv_hooks_destroy(before_event); + //lttv_hooks_destroy(after_event); + lttv_hooks_destroy(event_hook); lttv_hooks_remove_data(main_hooks, process_traceset, NULL); nb = lttv_traceset_number(traceset); diff --git a/ltt/branches/poly/lttv/modules/text/textDump.c b/ltt/branches/poly/lttv/modules/text/textDump.c index cc400d92..51e6994a 100644 --- a/ltt/branches/poly/lttv/modules/text/textDump.c +++ b/ltt/branches/poly/lttv/modules/text/textDump.c @@ -46,7 +46,7 @@ static LttvHooks *before_traceset, *after_traceset, *before_trace, - *before_event; + *event_hook; void print_field(LttEvent *e, LttField *f, GString *s, gboolean field_names) { @@ -370,25 +370,27 @@ static void init() "", LTTV_OPT_NONE, &a_process_stats, NULL, NULL); - g_assert(lttv_iattribute_find_by_path(attributes, "hooks/event/before", + g_assert(lttv_iattribute_find_by_path(attributes, "hooks/event", LTTV_POINTER, &value)); - g_assert((before_event = *(value.v_pointer)) != NULL); - lttv_hooks_add(before_event, write_event_content, NULL); + g_assert((event_hook = *(value.v_pointer)) != NULL); + lttv_hooks_add(event_hook, write_event_content, NULL, LTTV_PRIO_DEFAULT); g_assert(lttv_iattribute_find_by_path(attributes, "hooks/trace/before", LTTV_POINTER, &value)); g_assert((before_trace = *(value.v_pointer)) != NULL); - lttv_hooks_add(before_trace, write_trace_header, NULL); + lttv_hooks_add(before_trace, write_trace_header, NULL, LTTV_PRIO_DEFAULT); g_assert(lttv_iattribute_find_by_path(attributes, "hooks/traceset/before", LTTV_POINTER, &value)); g_assert((before_traceset = *(value.v_pointer)) != NULL); - lttv_hooks_add(before_traceset, write_traceset_header, NULL); + lttv_hooks_add(before_traceset, write_traceset_header, NULL, + LTTV_PRIO_DEFAULT); g_assert(lttv_iattribute_find_by_path(attributes, "hooks/traceset/after", LTTV_POINTER, &value)); g_assert((after_traceset = *(value.v_pointer)) != NULL); - lttv_hooks_add(after_traceset, write_traceset_footer, NULL); + lttv_hooks_add(after_traceset, write_traceset_footer, NULL, + LTTV_PRIO_DEFAULT); } @@ -408,7 +410,7 @@ static void destroy() g_string_free(a_string, TRUE); - lttv_hooks_remove_data(before_event, write_event_content, NULL); + lttv_hooks_remove_data(event_hook, write_event_content, NULL); lttv_hooks_remove_data(before_trace, write_trace_header, NULL); -- 2.34.1