projects
/
lttv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
control flow .c move
[lttv.git]
/
ltt
/
branches
/
poly
/
lttv
/
textDump.c
diff --git
a/ltt/branches/poly/lttv/textDump.c
b/ltt/branches/poly/lttv/textDump.c
index e4c8d5c736b2f7a22759e4946d69f97a162dc88e..797e7a12429e8d602257b3eeefffe80a1de8af43 100644
(file)
--- a/
ltt/branches/poly/lttv/textDump.c
+++ b/
ltt/branches/poly/lttv/textDump.c
@@
-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,
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:
break;
case LTT_ARRAY:
@@
-79,9
+79,9
@@
void print_field(LttEvent *e, LttField *f, GString *s, gboolean field_names) {
nb = ltt_type_member_number(type);
for(i = 0 ; i < nb ; i++) {
element = ltt_field_member(f,i);
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);
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);
}
}
print_field(e, element, s, field_names);
}
@@
-92,8
+92,8
@@
void print_field(LttEvent *e, LttField *f, GString *s, gboolean field_names) {
void lttv_event_to_string(LttEvent *e, LttTracefile *tf, GString *s,
void lttv_event_to_string(LttEvent *e, LttTracefile *tf, GString *s,
- gboolean mandatory_fields, gboolean field_names)
-{
+ gboolean mandatory_fields, gboolean field_names
, LttvTracefileState *tfs
)
+{
LttFacility *facility;
LttEventType *event_type;
LttFacility *facility;
LttEventType *event_type;
@@
-115,9
+115,13
@@
void lttv_event_to_string(LttEvent *e, LttTracefile *tf, GString *s,
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));
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 */
+ g_string_append_printf(s,", %d, %s", tfs->process->pid,
+ g_quark_to_string(tfs->process->state->t));
}
}
- print_field(e, field, s, field_names);
+ if(field)
+ print_field(e, field, s, field_names);
}
}
@@
-179,7
+183,8
@@
static int write_event_content(void *hook_data, void *call_data)
e = tfc->e;
e = tfc->e;
- lttv_event_to_string(e, tfc->tf, a_string, TRUE, a_field_names);
+ lttv_event_to_string(e, tfc->tf, a_string, TRUE, a_field_names, tfs);
+ g_string_append_printf(a_string,"\n");
if(a_state) {
g_string_append_printf(a_string, " %s",
if(a_state) {
g_string_append_printf(a_string, " %s",
@@
-191,12
+196,15
@@
static int write_event_content(void *hook_data, void *call_data)
}
}
-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());
{
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",
a_file_name = NULL;
lttv_option_add("output", 'o',
"output file where the text is written",
@@
-237,7
+245,7
@@
void init(int argc, char **argv)
}
}
-void destroy()
+
G_MODULE_EXPORT
void destroy()
{
lttv_option_remove("output");
{
lttv_option_remove("output");
@@
-245,6
+253,8
@@
void destroy()
lttv_option_remove("process_state");
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);
lttv_hooks_remove_data(before_event, write_event_content, NULL);
lttv_hooks_remove_data(before_trace, write_trace_header, NULL);
This page took
0.023107 seconds
and
4
git commands to generate.