text modules modified to fit tracecontext mods
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Wed, 26 May 2004 21:16:17 +0000 (21:16 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Wed, 26 May 2004 21:16:17 +0000 (21:16 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@563 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/lttv/modules/text/batchAnalysis.c
ltt/branches/poly/lttv/modules/text/textDump.c

index 1c69df33fc8eedf802c848cdff1c361733dd90ba..1d1ac2348f2234c9d8a49ca7b27c4542ec18fd83 100644 (file)
@@ -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);
index cc400d9299ffb8a5ca748e84a14d7000006bdd49..51e6994a23dc337fe29de37bd5f66aa871bbfebe 100644 (file)
@@ -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);
 
This page took 0.025923 seconds and 4 git commands to generate.