diff options
Diffstat (limited to 'tools/perf/ui')
-rw-r--r-- | tools/perf/ui/browsers/hists.c | 25 |
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) \ | ||
655 | static u64 __hpp_get_acc_##_field(struct hist_entry *he) \ | ||
656 | { \ | ||
657 | return he->stat_acc->_field; \ | ||
658 | } \ | ||
659 | \ | ||
660 | static int \ | ||
661 | hist_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 | ||
662 | void hist_browser__init_hpp(void) | 685 | void 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 | ||
676 | static int hist_browser__show_entry(struct hist_browser *browser, | 701 | static int hist_browser__show_entry(struct hist_browser *browser, |