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


Groups > linux.kernel > #1315908 > unrolled thread

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

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

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

FromNamhyung Kim <namhyung@kernel.org>
Date2016-01-24 15:00 +0100
Subject[PATCH 12/12] perf report: Fix callchain percent limit on --gtk
Message-ID<qUtmX-5A8-35@gated-at.bofh.it>
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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web