From: Namhyung Kim <namhyung....@lge.com>

Print accumulated stat of a hist entry if requested.

Cc: Arun Sharma <asha...@fb.com>
Cc: Frederic Weisbecker <fweis...@gmail.com>
Signed-off-by: Namhyung Kim <namhy...@kernel.org>
---
 tools/perf/ui/browsers/hists.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index b9b1b173637c..1dcdccf2edac 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -570,6 +570,10 @@ static int hist_browser__hpp_color_ ## _name(struct 
perf_hpp *hpp, \
                                             struct hist_entry *he)     \
 {                                                                      \
        double percent = 100.0 * he->stat._field / hpp->total_period;   \
+                                                                       \
+       if (symbol_conf.cumulate_callchain)                             \
+               percent = 100.0 * he->stat_acc->_field / hpp->total_period; \
+                                                                       \
        *(double *)hpp->ptr = percent;                                  \
        return scnprintf(hpp->buf, hpp->size, "%6.2f%%", percent);      \
 }
-- 
1.7.11.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to