add noevent option to text dump
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 27 Oct 2008 16:38:22 +0000 (16:38 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 27 Oct 2008 16:38:22 +0000 (16:38 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@3127 04897980-b3bd-0310-b5e0-8ef037075253

trunk/lttv/lttv/modules/text/textDump.c

index 4fcd5b5c49abd779a51c962b19cddf55c705541a..c23232935bb82b76e345312753cfd643ef8bcbc8 100644 (file)
@@ -40,6 +40,7 @@
 #include <stdio.h>
 
 static gboolean
+  a_noevent,
   a_no_field_names,
   a_state,
   a_cpu_stats,
@@ -368,6 +369,12 @@ static void init()
       "file name", 
       LTTV_OPT_STRING, &a_file_name, NULL, NULL);
 
+  a_noevent = FALSE;
+  lttv_option_add("noevent", 'n', 
+      "disable event printout", 
+      "", 
+      LTTV_OPT_NONE, &a_noevent, NULL, NULL);
+
   a_no_field_names = FALSE;
   lttv_option_add("field_names", 's', 
       "do not write the field names for each event", 
@@ -398,12 +405,14 @@ static void init()
       "",
       LTTV_OPT_NONE, &a_path_output, NULL, NULL);
 
-  result = lttv_iattribute_find_by_path(attributes, "hooks/event",
-      LTTV_POINTER, &value);
-  g_assert(result);
-  event_hook = *(value.v_pointer);
-  g_assert(event_hook);
-  lttv_hooks_add(event_hook, write_event_content, NULL, LTTV_PRIO_DEFAULT);
+  if (!a_noevent) {
+    result = lttv_iattribute_find_by_path(attributes, "hooks/event",
+        LTTV_POINTER, &value);
+    g_assert(result);
+    event_hook = *(value.v_pointer);
+    g_assert(event_hook);
+    lttv_hooks_add(event_hook, write_event_content, NULL, LTTV_PRIO_DEFAULT);
+  }
 
   result = lttv_iattribute_find_by_path(attributes, "hooks/trace/before",
       LTTV_POINTER, &value);
@@ -433,6 +442,8 @@ static void destroy()
 {
   g_info("Destroy textDump");
 
+  lttv_option_remove("noevent");
+
   lttv_option_remove("output");
 
   lttv_option_remove("field_names");
@@ -447,7 +458,8 @@ static void destroy()
 
   g_string_free(a_string, TRUE);
 
-  lttv_hooks_remove_data(event_hook, write_event_content, NULL);
+  if (!a_noevent)
+    lttv_hooks_remove_data(event_hook, write_event_content, NULL);
 
   lttv_hooks_remove_data(before_trace, write_trace_header, NULL);
 
This page took 0.024825 seconds and 4 git commands to generate.