X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2Ftext%2FtextDump.c;h=1f27e0f757e7c7036e2e7406a389a810e329db92;hb=b5ad5a5d43826a9799f057aa0b414b90456863fd;hp=befcbcc4f80bcb7e795fdffae10d3d0b66cefeeb;hpb=7a36589d73dc1d5bccb8a991fb1800d42ee34c90;p=lttv.git diff --git a/ltt/branches/poly/lttv/modules/text/textDump.c b/ltt/branches/poly/lttv/modules/text/textDump.c index befcbcc4..1f27e0f7 100644 --- a/ltt/branches/poly/lttv/modules/text/textDump.c +++ b/ltt/branches/poly/lttv/modules/text/textDump.c @@ -36,13 +36,11 @@ #include #include #include -#include #include -#include #include static gboolean - a_field_names, + a_no_field_names, a_state, a_cpu_stats, a_process_stats, @@ -278,7 +276,7 @@ static gboolean write_traceset_footer(void *hook_data, void *call_data) fprintf(a_file,"End trace set\n\n"); if(LTTV_IS_TRACESET_STATS(tc)) { - lttv_stats_sum_traceset((LttvTracesetStats *)tc); + lttv_stats_sum_traceset((LttvTracesetStats *)tc, ltt_time_infinite); print_stats(a_file, (LttvTracesetStats *)tc); } @@ -332,17 +330,18 @@ static int write_event_content(void *hook_data, void *call_data) */ if(filter->head != NULL) if(!lttv_filter_tree_parse(filter->head,e,tfc->tf, - tfc->t_context->t,tfc)) + tfc->t_context->t,tfc,NULL,NULL)) return FALSE; - lttv_event_to_string(e, a_string, TRUE, a_field_names, tfs); - g_string_append_printf(a_string,"\n"); + lttv_event_to_string(e, a_string, TRUE, !a_no_field_names, tfs); if(a_state) { g_string_append_printf(a_string, " %s ", g_quark_to_string(process->state->s)); } + g_string_append_printf(a_string,"\n"); + fputs(a_string->str, a_file); return FALSE; } @@ -364,14 +363,14 @@ static void init() "file name", LTTV_OPT_STRING, &a_file_name, NULL, NULL); - a_field_names = FALSE; - lttv_option_add("field_names", 'l', - "write the field names for each event", + a_no_field_names = FALSE; + lttv_option_add("field_names", 's', + "do not write the field names for each event", "", - LTTV_OPT_NONE, &a_field_names, NULL, NULL); + LTTV_OPT_NONE, &a_no_field_names, NULL, NULL); a_state = FALSE; - lttv_option_add("process_state", 's', + lttv_option_add("process_state", 'r', "write the pid and state for each event", "", LTTV_OPT_NONE, &a_state, NULL, NULL); @@ -431,6 +430,8 @@ static void destroy() lttv_option_remove("process_stats"); + lttv_option_remove("path_output"); + g_string_free(a_string, TRUE); lttv_hooks_remove_data(event_hook, write_event_content, NULL);