diff options
author | Jiri Olsa <jolsa@redhat.com> | 2013-12-03 08:09:25 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-12-04 13:23:55 -0500 |
commit | f772abc63462a48df605259fbe1af3fe9b223926 (patch) | |
tree | 55eec975486ccbce629943c6beb4d5b6549e02f6 /tools/perf | |
parent | 97978b3e30a512beba43720365f53fea8d432c97 (diff) |
perf tools: Overload pr_stat traceevent print function
The traceevent lib uses pr_stat to display all standard info. It's
defined as __weak. Overloading it with perf version plugged into perf
output system logic.
Displaying the pr_stat stuff under '-v' option.
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/1386076182-14484-12-git-send-email-jolsa@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/util/debug.c | 30 | ||||
-rw-r--r-- | tools/perf/util/debug.h | 2 |
2 files changed, 29 insertions, 3 deletions
diff --git a/tools/perf/util/debug.c b/tools/perf/util/debug.c index 399e74c34c1a..8640a9121e72 100644 --- a/tools/perf/util/debug.c +++ b/tools/perf/util/debug.c | |||
@@ -16,13 +16,11 @@ | |||
16 | int verbose; | 16 | int verbose; |
17 | bool dump_trace = false, quiet = false; | 17 | bool dump_trace = false, quiet = false; |
18 | 18 | ||
19 | int eprintf(int level, const char *fmt, ...) | 19 | static int _eprintf(int level, const char *fmt, va_list args) |
20 | { | 20 | { |
21 | va_list args; | ||
22 | int ret = 0; | 21 | int ret = 0; |
23 | 22 | ||
24 | if (verbose >= level) { | 23 | if (verbose >= level) { |
25 | va_start(args, fmt); | ||
26 | if (use_browser >= 1) | 24 | if (use_browser >= 1) |
27 | ui_helpline__vshow(fmt, args); | 25 | ui_helpline__vshow(fmt, args); |
28 | else | 26 | else |
@@ -33,6 +31,32 @@ int eprintf(int level, const char *fmt, ...) | |||
33 | return ret; | 31 | return ret; |
34 | } | 32 | } |
35 | 33 | ||
34 | int eprintf(int level, const char *fmt, ...) | ||
35 | { | ||
36 | va_list args; | ||
37 | int ret; | ||
38 | |||
39 | va_start(args, fmt); | ||
40 | ret = _eprintf(level, fmt, args); | ||
41 | va_end(args); | ||
42 | |||
43 | return ret; | ||
44 | } | ||
45 | |||
46 | /* | ||
47 | * Overloading libtraceevent standard info print | ||
48 | * function, display with -v in perf. | ||
49 | */ | ||
50 | void pr_stat(const char *fmt, ...) | ||
51 | { | ||
52 | va_list args; | ||
53 | |||
54 | va_start(args, fmt); | ||
55 | _eprintf(1, fmt, args); | ||
56 | va_end(args); | ||
57 | eprintf(1, "\n"); | ||
58 | } | ||
59 | |||
36 | int dump_printf(const char *fmt, ...) | 60 | int dump_printf(const char *fmt, ...) |
37 | { | 61 | { |
38 | va_list args; | 62 | va_list args; |
diff --git a/tools/perf/util/debug.h b/tools/perf/util/debug.h index efbd98805ad0..443694c36b03 100644 --- a/tools/perf/util/debug.h +++ b/tools/perf/util/debug.h | |||
@@ -17,4 +17,6 @@ void trace_event(union perf_event *event); | |||
17 | int ui__error(const char *format, ...) __attribute__((format(printf, 1, 2))); | 17 | int ui__error(const char *format, ...) __attribute__((format(printf, 1, 2))); |
18 | int ui__warning(const char *format, ...) __attribute__((format(printf, 1, 2))); | 18 | int ui__warning(const char *format, ...) __attribute__((format(printf, 1, 2))); |
19 | 19 | ||
20 | void pr_stat(const char *fmt, ...); | ||
21 | |||
20 | #endif /* __PERF_DEBUG_H */ | 22 | #endif /* __PERF_DEBUG_H */ |