2 typedef struct _text_hook_data
{
7 void *lttv_textDump_before(lttv_trace_set
*s
, FILE *fp
)
9 int i
, j
, nb_trace
, nb_tracefile
;
14 text_hook_data
*hook_data
;
16 hook_data
= g_new(ltt_hook_data
,1);
17 nb_trace
= lttv_trace_set_number(s
);
19 hook_data
->s
= lttv_string_new
;
21 for(i
= 0 ; i
< nb_trace
; i
++) {
22 t
= lttv_trace_set_get(s
,i
);
23 a
= lttv_trace_attributes(t
);
24 h
= (lttv_hooks
*)lttv_attributes_get_pointer_pathname(a
,"hooks/before");
25 lttv_hooks_add(h
, print_trace_title
, hook_data
);
26 nb_tracefile
= lttv_trace_number(t
);
28 for(j
= 0 ; j
< nb_tracefile
; j
++) {
29 h
= (lttv_hooks
*)lttv_attributes_get_pointer_pathname(a
,"hooks/before");
30 lttv_hooks_add(h
, print_tracefile_title
, hook_data
);
31 h
= (lttv_hooks
*)lttv_attributes_get_pointer_pathname(a
,"hooks/event");
32 lttv_hooks_add(h
, print_event
, hook_data
);
37 void lttv_textDump_after(lttv_trace_set
*ts
, void *hook_data
)
39 int i
, j
, nb_trace
, nb_tracefile
;
45 nb_trace
= lttv_trace_set_number(s
);
47 for(i
= 0 ; i
< nb_trace
; i
++) {
48 t
= lttv_trace_set_get(s
,i
);
49 a
= lttv_trace_attributes(t
);
50 h
= (lttv_hooks
*)lttv_attributes_get_pointer_pathname(a
,"hooks/before");
51 lttv_hooks_remove(h
, print_trace_title
, hook_data
);
52 nb_tracefile
= lttv_trace_number(t
);
54 for(j
= 0 ; j
< nb_tracefile
; j
++) {
55 h
= (lttv_hooks
*)lttv_attributes_get_pointer_pathname(a
,"hooks/before");
56 lttv_hooks_remove(h
, print_tracefile_title
, hook_data
);
57 h
= (lttv_hooks
*)lttv_attributes_get_pointer_pathname(a
,"hooks/event");
58 lttv_hooks_remove(h
, print_event
, hook_data
);
61 lttv_string_destroy(hook_data
->s
);
65 static void print_trace_title(void *hook_data
, void *call_data
)
70 fp
= ((text_hook_data
*)hook_data
)->fp
;
71 t
= (lttv_trace
*)call_data
;
72 fprintf(fp
,"\n\nTrace %s:\n\n" lttv_trace_name(t
));
75 static void print_trace(void *hook_data
, void *call_data
)
80 fp
= ((text_hook_data
*)hook_data
)->fp
;
81 tf
= (lttv_tracefile
*)call_data
;
82 fprintf(fp
,"\n\nTracefile %s:\n\n" lttv_tracefile_name(tf
));
85 static void print_event(void *hook_data
, void *call_data
)
91 d
= ((text_hook_data
*)hook_data
;
92 e
= (lttv_event
*)call_data
;
93 lttv_event_to_string(e
,d
->s
,TRUE
);
94 fprintf(fp
,"%s\n" d
->s
->str
);
This page took 0.030363 seconds and 4 git commands to generate.