aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/ui
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/ui')
-rw-r--r--tools/perf/ui/browsers/hists.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index 1c331b934ffc..2dcbe3d15a5f 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -651,13 +651,36 @@ hist_browser__hpp_color_##_type(struct perf_hpp_fmt *fmt __maybe_unused,\
651 __hpp__slsmg_color_printf, true); \ 651 __hpp__slsmg_color_printf, true); \
652} 652}
653 653
654#define __HPP_COLOR_ACC_PERCENT_FN(_type, _field) \
655static u64 __hpp_get_acc_##_field(struct hist_entry *he) \
656{ \
657 return he->stat_acc->_field; \
658} \
659 \
660static int \
661hist_browser__hpp_color_##_type(struct perf_hpp_fmt *fmt __maybe_unused,\
662 struct perf_hpp *hpp, \
663 struct hist_entry *he) \
664{ \
665 if (!symbol_conf.cumulate_callchain) { \
666 int ret = scnprintf(hpp->buf, hpp->size, "%8s", "N/A"); \
667 slsmg_printf("%s", hpp->buf); \
668 \
669 return ret; \
670 } \
671 return __hpp__fmt(hpp, he, __hpp_get_acc_##_field, " %6.2f%%", \
672 __hpp__slsmg_color_printf, true); \
673}
674
654__HPP_COLOR_PERCENT_FN(overhead, period) 675__HPP_COLOR_PERCENT_FN(overhead, period)
655__HPP_COLOR_PERCENT_FN(overhead_sys, period_sys) 676__HPP_COLOR_PERCENT_FN(overhead_sys, period_sys)
656__HPP_COLOR_PERCENT_FN(overhead_us, period_us) 677__HPP_COLOR_PERCENT_FN(overhead_us, period_us)
657__HPP_COLOR_PERCENT_FN(overhead_guest_sys, period_guest_sys) 678__HPP_COLOR_PERCENT_FN(overhead_guest_sys, period_guest_sys)
658__HPP_COLOR_PERCENT_FN(overhead_guest_us, period_guest_us) 679__HPP_COLOR_PERCENT_FN(overhead_guest_us, period_guest_us)
680__HPP_COLOR_ACC_PERCENT_FN(overhead_acc, period)
659 681
660#undef __HPP_COLOR_PERCENT_FN 682#undef __HPP_COLOR_PERCENT_FN
683#undef __HPP_COLOR_ACC_PERCENT_FN
661 684
662void hist_browser__init_hpp(void) 685void hist_browser__init_hpp(void)
663{ 686{
@@ -671,6 +694,8 @@ void hist_browser__init_hpp(void)
671 hist_browser__hpp_color_overhead_guest_sys; 694 hist_browser__hpp_color_overhead_guest_sys;
672 perf_hpp__format[PERF_HPP__OVERHEAD_GUEST_US].color = 695 perf_hpp__format[PERF_HPP__OVERHEAD_GUEST_US].color =
673 hist_browser__hpp_color_overhead_guest_us; 696 hist_browser__hpp_color_overhead_guest_us;
697 perf_hpp__format[PERF_HPP__OVERHEAD_ACC].color =
698 hist_browser__hpp_color_overhead_acc;
674} 699}
675 700
676static int hist_browser__show_entry(struct hist_browser *browser, 701static int hist_browser__show_entry(struct hist_browser *browser,