/* 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
for(i = 0 ; i < nb ; i++) {
ltt_trace_close(lttv_traceset_get(traceset, i));
}
+
+ lttv_traceset_destroy(traceset);
}
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);
}
(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 */
};
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));
}
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));
}
(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 */
};
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));
}
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:
/* 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);
}
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",
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",
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);