convert from svn repository: remove tags directory
[lttv.git] / trunk / lttv / lttv / modules / text / textDump.c
index c23232935bb82b76e345312753cfd643ef8bcbc8..ddee070b119e78bcfc40b29610152b483aa22988 100644 (file)
@@ -38,6 +38,7 @@
 #include <ltt/event.h>
 #include <ltt/trace.h>
 #include <stdio.h>
+#include <inttypes.h>
 
 static gboolean
   a_noevent,
@@ -79,7 +80,7 @@ print_path_tree(FILE *fp, GString *indent, LttvAttribute *tree)
     if(is_named) {
       g_string_sprintfa(indent, "/%s", g_quark_to_string(name));
     } else {
-      g_string_sprintfa(indent, "/%s", name);
+           g_string_sprintfa(indent, "/%" PRIu32, (guint32) name);
     }
 
     switch(type) {
@@ -146,7 +147,8 @@ print_tree(FILE *fp, GString *indent, LttvAttribute *tree)
                if(is_named)
            fprintf(fp, "%s%s: ", indent->str, g_quark_to_string(name));
                else
-           fprintf(fp, "%s%lu: ", indent->str, name);
+                       fprintf(fp, "%s%" PRIu32 ": ", indent->str,
+                               (guint32) name);
 
     switch(type) {
       case LTTV_INT:
@@ -205,8 +207,6 @@ print_stats(FILE *fp, LttvTracesetStats *tscs)
 
   GString *indent;
 
-  LttSystemDescription *desc;
-
   if(tscs->stats == NULL) return;
   indent = g_string_new("");
   fprintf(fp, "Traceset statistics:\n\n");
@@ -222,6 +222,7 @@ print_stats(FILE *fp, LttvTracesetStats *tscs)
   for(i = 0 ; i < nb ; i++) {
     tcs = (LttvTraceStats *)(LTTV_TRACESET_CONTEXT(tscs)->traces[i]);
 #if 0 //FIXME
+    LttSystemDescription *desc;
     desc = ltt_trace_system_description(tcs->parent.parent.t);
     LttTime start_time = ltt_trace_system_description_trace_start_time(desc);
     fprintf(fp, "Trace on system %s at time %lu.%09lu :\n", 
@@ -289,8 +290,8 @@ static gboolean write_traceset_footer(void *hook_data, void *call_data)
 
 static gboolean write_trace_header(void *hook_data, void *call_data)
 {
-  LttvTraceContext *tc = (LttvTraceContext *)call_data;
 #if 0 //FIXME
+  LttvTraceContext *tc = (LttvTraceContext *)call_data;
   LttSystemDescription *system = ltt_trace_system_description(tc->t);
 
   fprintf(a_file,"  Trace from %s in %s\n%s\n\n", 
@@ -322,6 +323,9 @@ static int write_event_content(void *hook_data, void *call_data)
   LttvTraceState *ts = (LttvTraceState*)tfc->t_context;
   LttvProcessState *process = ts->running_process[cpu];
 
+  if (a_noevent)
+    return FALSE;
+
   e = ltt_tracefile_get_event(tfc->tf);
 
   result = lttv_iattribute_find_by_path(attributes, "filter/lttv_filter",
@@ -405,14 +409,12 @@ static void init()
       "",
       LTTV_OPT_NONE, &a_path_output, NULL, NULL);
 
-  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/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);
@@ -458,8 +460,7 @@ static void destroy()
 
   g_string_free(a_string, TRUE);
 
-  if (!a_noevent)
-    lttv_hooks_remove_data(event_hook, 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.024568 seconds and 4 git commands to generate.