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


Groups > linux.kernel > #1315908

[PATCH 12/12] perf report: Fix callchain percent limit on --gtk

From Namhyung Kim <namhyung@kernel.org>
Newsgroups linux.kernel
Subject [PATCH 12/12] perf report: Fix callchain percent limit on --gtk
Date 2016-01-24 15:00 +0100
Message-ID <qUtmX-5A8-35@gated-at.bofh.it> (permalink)
References <qUtmW-5A8-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


When a percent limit is given, it should take callchains into account.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/ui/gtk/hists.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c
index 0f8dcfdfb10f..8652c3c967b9 100644
--- a/tools/perf/ui/gtk/hists.c
+++ b/tools/perf/ui/gtk/hists.c
@@ -100,9 +100,14 @@ static void perf_gtk__add_callchain_flat(struct rb_root *root, GtkTreeStore *sto
 		struct callchain_list *chain;
 		GtkTreeIter iter, new_parent;
 		bool need_new_parent;
+		double percent;
 
 		node = rb_entry(nd, struct callchain_node, rb_node);
 
+		percent = 100.0 * callchain_cumul_hits(node) / total;
+		if (percent < callchain_param.min_percent)
+			continue;
+
 		new_parent = *parent;
 		need_new_parent = !has_single_node;
 
@@ -164,9 +169,14 @@ static void perf_gtk__add_callchain_folded(struct rb_root *root, GtkTreeStore *s
 		char buf[64];
 		char *str, *str_alloc = NULL;
 		bool first = true;
+		double percent;
 
 		node = rb_entry(nd, struct callchain_node, rb_node);
 
+		percent = 100.0 * callchain_cumul_hits(node) / total;
+		if (percent < callchain_param.min_percent)
+			continue;
+
 		callchain_node__make_parent_list(node);
 
 		list_for_each_entry(chain, &node->parent_val, list) {
@@ -224,9 +234,14 @@ static void perf_gtk__add_callchain_graph(struct rb_root *root, GtkTreeStore *st
 		GtkTreeIter iter, new_parent;
 		bool need_new_parent;
 		u64 child_total;
+		double percent;
 
 		node = rb_entry(nd, struct callchain_node, rb_node);
 
+		percent = 100.0 * callchain_cumul_hits(node) / total;
+		if (percent < callchain_param.min_percent)
+			continue;
+
 		new_parent = *parent;
 		need_new_parent = !has_single_node && (node->val_nr > 1);
 
-- 
2.6.4

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 12/12] perf report: Fix callchain percent limit on --gtk Namhyung Kim <namhyung@kernel.org> - 2016-01-24 15:00 +0100

csiph-web