trace-cmd report: Update tep_func_repeat_format to match ts
PATCH 1/1 trace-cmd report: Update tep_func_repeat_format to match ts
From: Steven Rostedt (VMware) <[email protected]>
With the new func_repeats event coming to the kernel, libtraceevent is adding a way to process that event, and will display the timestamp of the last function that repeated.
To make sure the displaying of that format matches the displaying of the timestamps generated, update the tep_func_repeat_format variable to keep it the same.
As the tep_func_repeat_format is a weak variable in the function plugin of libtraceevent, it only needs to be defined to update it. Defining the variable will not limit trace-cmd from using older libtraceevent libraries that do not yet have this support.
---
This time with "[PATCH]" in the subject :-p
tracecmd/trace-read.c +12 -0
@@ -26,6 +26,14 @@#include "kbuffer.h" #include "list.h" +/* +* tep_func_repeat_format is defined as a weak variable in the +* libtraceevent library function plugin, to allow applications +* to override the format of the timestamp it prints for the +* last function that repeated. +*/ +const char *tep_func_repeat_format; + static struct filter_str { struct filter_str *next; char *filter;
@@ -1875,6 +1883,18 @@ void trace_report (int argc, char **argv) otype =OUTPUT_NORMAL ; +if (tracecmd_get_flags (handle) &TRACECMD_FL_RAW_TS ) { + tep_func_repeat_format ="%d" ; + }else if (tracecmd_get_flags (handle) &TRACECMD_FL_IN_USECS ) { + if (tep_test_flag(tracecmd_get_tep(handle),
TEP_NSEC_OUTPUT))
+ tep_func_repeat_format = "%9.1d";
+ else
+ tep_func_repeat_format = "%6.1000d";
+ } else {
+ tep_func_repeat_format = "%12d";
+ }
+
+
if (show_stat)
otype = OUTPUT_STAT_ONLY;
/* yeah yeah, uname overrides stat */