summaryrefslogtreecommitdiffstats
path: root/tools/perf/ui/gtk
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2014-11-12 18:05:23 -0800
committerArnaldo Carvalho de Melo <acme@redhat.com>2014-11-19 12:33:47 -0300
commit2989ccaac48f8c3da7f77101bbf98e0ea8773d83 (patch)
treec0484d0ac42808cd690432c4425f556be28b4383 /tools/perf/ui/gtk
parent5550171b2a9f8df26ff483051d060db06376b26d (diff)
downloadlinux-stable-2989ccaac48f8c3da7f77101bbf98e0ea8773d83.tar.gz
linux-stable-2989ccaac48f8c3da7f77101bbf98e0ea8773d83.tar.bz2
linux-stable-2989ccaac48f8c3da7f77101bbf98e0ea8773d83.zip
perf callchain: Use a common function to resolve symbol or name
Refactor the duplicated code to resolve the symbol name or the address of a symbol into a single function. Used in next patch to add common functionality. Signed-off-by: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1415844328-4884-6-git-send-email-andi@firstfloor.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/ui/gtk')
-rw-r--r--tools/perf/ui/gtk/hists.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c
index fc654fb77ace..4b3585eed1e8 100644
--- a/tools/perf/ui/gtk/hists.c
+++ b/tools/perf/ui/gtk/hists.c
@@ -89,15 +89,6 @@ void perf_gtk__init_hpp(void)
perf_gtk__hpp_color_overhead_acc;
}
-static void callchain_list__sym_name(struct callchain_list *cl,
- char *bf, size_t bfsize)
-{
- if (cl->ms.sym)
- scnprintf(bf, bfsize, "%s", cl->ms.sym->name);
- else
- scnprintf(bf, bfsize, "%#" PRIx64, cl->ip);
-}
-
static void perf_gtk__add_callchain(struct rb_root *root, GtkTreeStore *store,
GtkTreeIter *parent, int col, u64 total)
{
@@ -128,7 +119,7 @@ static void perf_gtk__add_callchain(struct rb_root *root, GtkTreeStore *store,
scnprintf(buf, sizeof(buf), "%5.2f%%", percent);
gtk_tree_store_set(store, &iter, 0, buf, -1);
- callchain_list__sym_name(chain, buf, sizeof(buf));
+ callchain_list__sym_name(chain, buf, sizeof(buf), false);
gtk_tree_store_set(store, &iter, col, buf, -1);
if (need_new_parent) {