case LTT_ENUM:
g_string_append_printf(s, " %s", ltt_enum_string_get(type,
- event_get_unsigned(e,f)));
+ ltt_event_get_unsigned(e,f)-1));
break;
case LTT_ARRAY:
nb = ltt_type_member_number(type);
for(i = 0 ; i < nb ; i++) {
element = ltt_field_member(f,i);
- if(name) {
+ if(field_names) {
ltt_type_member_type(type, i, &name);
- g_string_append_printf(s, " %s = ", field_names);
+ g_string_append_printf(s, " %s = ", name);
}
print_field(e, element, s, field_names);
}
g_string_append_printf(s,"%s.%s: %ld.%ld (%s)",ltt_facility_name(facility),
ltt_eventtype_name(event_type), (long)time.tv_sec, time.tv_nsec,
ltt_tracefile_name(tf));
+ /* 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",
}
-void init(int argc, char **argv)
+//void init(int argc, char **argv)
+G_MODULE_EXPORT void init(LttvModule *self, int argc, char **argv)
{
LttvAttributeValue value;
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",
}
-void destroy()
+G_MODULE_EXPORT void destroy()
{
lttv_option_remove("output");
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);