git-svn-id: http://ltt.polymtl.ca/svn@179 04897980-b3bd-0310-b5e0-8ef037075253
authoryangxx <yangxx@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 18 Aug 2003 16:10:35 +0000 (16:10 +0000)
committeryangxx <yangxx@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 18 Aug 2003 16:10:35 +0000 (16:10 +0000)
ltt/branches/poly/lttv/attribute.c
ltt/branches/poly/lttv/batchAnalysis.c
ltt/branches/poly/lttv/processTrace.c
ltt/branches/poly/lttv/state.c
ltt/branches/poly/lttv/textDump.c

index d06958972474cbd89909dca23ebe738a0de258e1..176772dee2e77e35e29d7225fde9dd9cf9d2ff89 100644 (file)
@@ -151,8 +151,10 @@ lttv_attribute_remove(LttvAttribute *self, unsigned i)
   /* The element used to replace the removed element has its index entry
      all wrong now. Reinsert it with its new position. */
 
-  g_hash_table_remove(self->names, GUINT_TO_POINTER(a->name));
-  g_hash_table_insert(self->names, GUINT_TO_POINTER(a->name), GUINT_TO_POINTER(i + 1));
+  if(self->attributes->len != i){
+    g_hash_table_remove(self->names, GUINT_TO_POINTER(a->name));
+    g_hash_table_insert(self->names, GUINT_TO_POINTER(a->name), GUINT_TO_POINTER(i + 1));
+  }
 }
 
 void 
index 0a7d9dd10b50af66ab65759539eae129b6abda64..6f499ce1d394868fb2d0ae9d8d8f7e6987d1db60 100644 (file)
@@ -141,5 +141,7 @@ G_MODULE_EXPORT void destroy()
   for(i = 0 ; i < nb ; i++) {
     ltt_trace_close(lttv_traceset_get(traceset, i));
   }
+
+  lttv_traceset_destroy(traceset); 
 }
 
index 94b5e2d90f37685abb688f70784f7e3ddcb3389b..550b9c4295d694bda999f5bde4ea8d4ef2b0b7d8 100644 (file)
@@ -33,7 +33,7 @@ lttv_context_new_trace_context(LttvTracesetContext *self)
 LttvTracefileContext *
 lttv_context_new_tracefile_context(LttvTracesetContext *self)
 {
-  LTTV_TRACESET_CONTEXT_GET_CLASS(self)->new_tracefile_context(self);
+  return LTTV_TRACESET_CONTEXT_GET_CLASS(self)->new_tracefile_context(self);
 }
 
 
@@ -365,7 +365,7 @@ lttv_trace_context_get_type(void)
       (GClassInitFunc) trace_context_class_init,   /* class_init */
       NULL,   /* class_finalize */
       NULL,   /* class_data */
-      sizeof (LttvTracesetContext),
+      sizeof (LttvTraceContext),
       0,      /* n_preallocs */
       (GInstanceInitFunc) trace_context_instance_init    /* instance_init */
     };
index 6f6dc9addf10c6d38371583e73074a5c1a8409aa..bb221a77f99c49523164310bee3c0ddbbd159b40 100644 (file)
@@ -106,9 +106,9 @@ traceset_state_instance_init (GTypeInstance *instance, gpointer g_class)
 
 
 static void
-traceset_state_finalize (LttvTracesetContext *self)
+traceset_state_finalize (LttvTracesetState *self)
 {
-  G_OBJECT_CLASS(g_type_class_peek_parent(LTTV_TRACESET_STATE_GET_CLASS(self)))->finalize(G_OBJECT(self));
+  G_OBJECT_CLASS(g_type_class_peek_parent(g_type_class_peek_parent(LTTV_TRACESET_STATE_GET_CLASS(self))))->finalize(G_OBJECT(self));
 }
 
 
@@ -157,9 +157,9 @@ trace_state_instance_init (GTypeInstance *instance, gpointer g_class)
 
 
 static void
-trace_state_finalize (LttvTraceContext *self)
+trace_state_finalize (LttvTraceState *self)
 {
-  G_OBJECT_CLASS(g_type_class_peek_parent(LTTV_TRACE_STATE_GET_CLASS(self)))->finalize(G_OBJECT(self));
+  G_OBJECT_CLASS(g_type_class_peek_parent(g_type_class_peek_parent(LTTV_TRACE_STATE_GET_CLASS(self))))->finalize(G_OBJECT(self));
 }
 
 
@@ -184,7 +184,7 @@ lttv_trace_state_get_type(void)
       (GClassInitFunc) trace_state_class_init,   /* class_init */
       NULL,   /* class_finalize */
       NULL,   /* class_data */
-      sizeof (LttvTracesetState),
+      sizeof (LttvTraceState),
       0,      /* n_preallocs */
       (GInstanceInitFunc) trace_state_instance_init    /* instance_init */
     };
@@ -205,7 +205,7 @@ tracefile_state_instance_init (GTypeInstance *instance, gpointer g_class)
 static void
 tracefile_state_finalize (LttvTracefileState *self)
 {
-  G_OBJECT_CLASS(g_type_class_peek_parent(LTTV_TRACEFILE_STATE_GET_CLASS(self)))->finalize(G_OBJECT(self));
+  G_OBJECT_CLASS(g_type_class_peek_parent(g_type_class_peek_parent(LTTV_TRACEFILE_STATE_GET_CLASS(self))))->finalize(G_OBJECT(self));
 }
 
 
index acf06e4e3cf3f449904098b4759cb3a35d3ade1d..2734e3beea9266c7873345007435c6bbbf0c1b7c 100644 (file)
@@ -59,7 +59,7 @@ void print_field(LttEvent *e, LttField *f, GString *s, gboolean field_names) {
 
     case LTT_ENUM:
       g_string_append_printf(s, " %s", ltt_enum_string_get(type,
-          ltt_event_get_unsigned(e,f)));
+          ltt_event_get_unsigned(e,f)-1));
       break;
 
     case LTT_ARRAY:
@@ -118,7 +118,8 @@ void lttv_event_to_string(LttEvent *e, LttTracefile *tf, GString *s,
     /* Print the process id and the state/interrupt type of the process */
   }
 
-  print_field(e, field, s, field_names);
+  if(field)
+    print_field(e, field, s, field_names);
 } 
 
 
@@ -181,6 +182,7 @@ static int write_event_content(void *hook_data, void *call_data)
   e = tfc->e;
 
   lttv_event_to_string(e, tfc->tf, a_string, TRUE, a_field_names);
+  g_string_append_printf(a_string,"\n");  
 
   if(a_state) {
     g_string_append_printf(a_string, " %s",
@@ -199,6 +201,8 @@ G_MODULE_EXPORT void init(LttvModule *self, int argc, char **argv)
 
   LttvIAttribute *attributes = LTTV_IATTRIBUTE(lttv_global_attributes());
 
+  a_string = g_string_new("");
+
   a_file_name = NULL;
   lttv_option_add("output", 'o', 
       "output file where the text is written", 
@@ -247,6 +251,8 @@ G_MODULE_EXPORT void destroy()
 
   lttv_option_remove("process_state");
 
+  g_string_free(a_string, TRUE);
+
   lttv_hooks_remove_data(before_event, write_event_content, NULL);
 
   lttv_hooks_remove_data(before_trace, write_trace_header, NULL);
This page took 0.028623 seconds and 4 git commands to generate.