summaryrefslogtreecommitdiffstats
path: root/tools/perf/ui/gtk/hists.c
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2015-11-09 14:45:39 +0900
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-11-19 13:19:22 -0300
commit5ab250cafcd884a2638b102239870bddca42ff88 (patch)
tree5c7732bf6ee5db4aadeeba2377fdde6a8d7927f0 /tools/perf/ui/gtk/hists.c
parent26e779245dd6f5270c0696860438e5c03d0780fd (diff)
downloadlinux-5ab250cafcd884a2638b102239870bddca42ff88.tar.gz
linux-5ab250cafcd884a2638b102239870bddca42ff88.tar.bz2
linux-5ab250cafcd884a2638b102239870bddca42ff88.zip
perf callchain: Abstract callchain print function
This is a preparation to support for printing other type of callchain value like count or period. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Tested-by: Brendan Gregg <brendan.d.gregg@gmail.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Kan Liang <kan.liang@intel.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1447047946-1691-4-git-send-email-namhyung@kernel.org [ renamed new _sprintf_ operation to _scnprintf_ ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/ui/gtk/hists.c')
-rw-r--r--tools/perf/ui/gtk/hists.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c
index 4b3585eed1e8..cff7bb9d9632 100644
--- a/tools/perf/ui/gtk/hists.c
+++ b/tools/perf/ui/gtk/hists.c
@@ -100,14 +100,10 @@ static void perf_gtk__add_callchain(struct rb_root *root, GtkTreeStore *store,
struct callchain_list *chain;
GtkTreeIter iter, new_parent;
bool need_new_parent;
- double percent;
- u64 hits, child_total;
+ u64 child_total;
node = rb_entry(nd, struct callchain_node, rb_node);
- hits = callchain_cumul_hits(node);
- percent = 100.0 * hits / total;
-
new_parent = *parent;
need_new_parent = !has_single_node && (node->val_nr > 1);
@@ -116,7 +112,7 @@ static void perf_gtk__add_callchain(struct rb_root *root, GtkTreeStore *store,
gtk_tree_store_append(store, &iter, &new_parent);
- scnprintf(buf, sizeof(buf), "%5.2f%%", percent);
+ callchain_node__scnprintf_value(node, buf, sizeof(buf), total);
gtk_tree_store_set(store, &iter, 0, buf, -1);
callchain_list__sym_name(chain, buf, sizeof(buf), false);