Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1315905 > unrolled thread

[PATCH 08/12] perf hists browser: Apply callchain percent limit

Started byNamhyung Kim <namhyung@kernel.org>
First post2016-01-24 15:00 +0100
Last post2016-01-24 15:00 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 08/12] perf hists browser: Apply callchain percent limit Namhyung Kim <namhyung@kernel.org> - 2016-01-24 15:00 +0100

#1315905 — [PATCH 08/12] perf hists browser: Apply callchain percent limit

FromNamhyung Kim <namhyung@kernel.org>
Date2016-01-24 15:00 +0100
Subject[PATCH 08/12] perf hists browser: Apply callchain percent limit
Message-ID<qUtmX-5A8-27@gated-at.bofh.it>
Currently 'perf report --tui' misses to check percent limit on
callchains.  Fix it.

Reported-by: Andi Kleen <andi@firstfloor.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/ui/browsers/hists.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index c7ca36dae89f..3d64a6573d0c 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -681,6 +681,14 @@ static int hist_browser__show_callchain_flat(struct hist_browser *browser,
 		char folded_sign = ' ';
 		int first = true;
 		int extra_offset = 0;
+		double percent;
+		u64 hits;
+
+		hits = callchain_cumul_hits(child);
+		percent = 100.0 * hits / total;
+
+		if (percent < callchain_param.min_percent)
+			goto next;
 
 		list_for_each_entry(chain, &child->parent_val, list) {
 			bool was_first = first;
@@ -784,12 +792,20 @@ static int hist_browser__show_callchain_folded(struct hist_browser *browser,
 		int first = true;
 		char *value_str = NULL, *value_str_alloc = NULL;
 		char *chain_str = NULL, *chain_str_alloc = NULL;
+		double percent;
+		u64 hits;
 
 		if (arg->row_offset != 0) {
 			arg->row_offset--;
 			goto next;
 		}
 
+		hits = callchain_cumul_hits(child);
+		percent = 100.0 * hits / total;
+
+		if (percent < callchain_param.min_percent)
+			goto next;
+
 		if (need_percent) {
 			char buf[64];
 
@@ -869,6 +885,14 @@ static int hist_browser__show_callchain_graph(struct hist_browser *browser,
 		char folded_sign = ' ';
 		int first = true;
 		int extra_offset = 0;
+		double percent;
+		u64 hits;
+
+		hits = callchain_cumul_hits(child);
+		percent = 100.0 * hits / total;
+
+		if (percent < callchain_param.min_percent)
+			goto next;
 
 		list_for_each_entry(chain, &child->val, list) {
 			bool was_first = first;
@@ -905,6 +929,7 @@ static int hist_browser__show_callchain_graph(struct hist_browser *browser,
 							    new_level, row, new_total,
 							    print, arg, is_output_full);
 		}
+next:
 		if (is_output_full(browser, row))
 			break;
 		node = next;
-- 
2.6.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web