lkml.org 
[lkml]   [2016]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 12/12] perf report: Fix callchain percent limit on --gtk
Date
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
\
 
 \ /
  Last update: 2016-01-24 15:21    [W:0.101 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site