[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1453643615-1616-13-git-send-email-namhyung@kernel.org>
Date: Sun, 24 Jan 2016 22:53:35 +0900
From: Namhyung Kim <namhyung@...nel.org>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Jiri Olsa <jolsa@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
Andi Kleen <andi@...stfloor.org>,
David Ahern <dsahern@...il.com>,
Frederic Weisbecker <fweisbec@...il.com>,
Wang Nan <wangnan0@...wei.com>
Subject: [PATCH 12/12] perf report: Fix callchain percent limit on --gtk
When a percent limit is given, it should take callchains into account.
Signed-off-by: Namhyung Kim <namhyung@...nel.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
Powered by blists - more mailing lists