diff options
author | Namhyung Kim <namhyung@kernel.org> | 2013-10-30 03:15:23 -0400 |
---|---|---|
committer | Jiri Olsa <jolsa@kernel.org> | 2014-06-01 08:35:02 -0400 |
commit | b09955b2a3d5fd02ed31d279f8c0ac29b32abe83 (patch) | |
tree | c48ca49f86bd7e1d07e7145461e83ac0f5b8bf98 /tools | |
parent | 0434ddd21466a61cfc539ffc3a4cb3bdc67d82ec (diff) |
perf ui/gtk: Add support to accumulated hist stat
Print accumulated stat of a hist entry if requested.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arun Sharma <asharma@fb.com>
Tested-by: Rodrigo Campos <rodrigo@sdfg.com.ar>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Link: http://lkml.kernel.org/r/1401335910-16832-13-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/ui/gtk/hists.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c index 9d90683914d4..7e5da4af98d8 100644 --- a/tools/perf/ui/gtk/hists.c +++ b/tools/perf/ui/gtk/hists.c | |||
@@ -47,11 +47,26 @@ static int perf_gtk__hpp_color_##_type(struct perf_hpp_fmt *fmt __maybe_unused, | |||
47 | __percent_color_snprintf, true); \ | 47 | __percent_color_snprintf, true); \ |
48 | } | 48 | } |
49 | 49 | ||
50 | #define __HPP_COLOR_ACC_PERCENT_FN(_type, _field) \ | ||
51 | static u64 he_get_acc_##_field(struct hist_entry *he) \ | ||
52 | { \ | ||
53 | return he->stat_acc->_field; \ | ||
54 | } \ | ||
55 | \ | ||
56 | static int perf_gtk__hpp_color_##_type(struct perf_hpp_fmt *fmt __maybe_unused, \ | ||
57 | struct perf_hpp *hpp, \ | ||
58 | struct hist_entry *he) \ | ||
59 | { \ | ||
60 | return __hpp__fmt_acc(hpp, he, he_get_acc_##_field, " %6.2f%%", \ | ||
61 | __percent_color_snprintf, true); \ | ||
62 | } | ||
63 | |||
50 | __HPP_COLOR_PERCENT_FN(overhead, period) | 64 | __HPP_COLOR_PERCENT_FN(overhead, period) |
51 | __HPP_COLOR_PERCENT_FN(overhead_sys, period_sys) | 65 | __HPP_COLOR_PERCENT_FN(overhead_sys, period_sys) |
52 | __HPP_COLOR_PERCENT_FN(overhead_us, period_us) | 66 | __HPP_COLOR_PERCENT_FN(overhead_us, period_us) |
53 | __HPP_COLOR_PERCENT_FN(overhead_guest_sys, period_guest_sys) | 67 | __HPP_COLOR_PERCENT_FN(overhead_guest_sys, period_guest_sys) |
54 | __HPP_COLOR_PERCENT_FN(overhead_guest_us, period_guest_us) | 68 | __HPP_COLOR_PERCENT_FN(overhead_guest_us, period_guest_us) |
69 | __HPP_COLOR_ACC_PERCENT_FN(overhead_acc, period) | ||
55 | 70 | ||
56 | #undef __HPP_COLOR_PERCENT_FN | 71 | #undef __HPP_COLOR_PERCENT_FN |
57 | 72 | ||
@@ -68,6 +83,8 @@ void perf_gtk__init_hpp(void) | |||
68 | perf_gtk__hpp_color_overhead_guest_sys; | 83 | perf_gtk__hpp_color_overhead_guest_sys; |
69 | perf_hpp__format[PERF_HPP__OVERHEAD_GUEST_US].color = | 84 | perf_hpp__format[PERF_HPP__OVERHEAD_GUEST_US].color = |
70 | perf_gtk__hpp_color_overhead_guest_us; | 85 | perf_gtk__hpp_color_overhead_guest_us; |
86 | perf_hpp__format[PERF_HPP__OVERHEAD_ACC].color = | ||
87 | perf_gtk__hpp_color_overhead_acc; | ||
71 | } | 88 | } |
72 | 89 | ||
73 | static void callchain_list__sym_name(struct callchain_list *cl, | 90 | static void callchain_list__sym_name(struct callchain_list *cl, |