aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-annotate.c
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2013-09-13 02:27:43 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-10-09 14:55:25 -0400
commitfc67297b16da335d610af2fac96233d51146300a (patch)
treef015cca3a70970e48b69b8fbb5c98a75c8911eca /tools/perf/builtin-annotate.c
parentfc2be6968e99b5314f20e938a547d44dcb1c40eb (diff)
perf tools: Separate out GTK codes to libperf-gtk.so
Separate out GTK codes to a shared object called libperf-gtk.so. This time only GTK codes are built with -fPIC and libperf remains as is. Now run GTK hist and annotation browser using libdl. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Reviewed-by: Pekka Enberg <penberg@kernel.org> Cc: Andi Kleen <ak@linux.intel.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Pekka Enberg <penberg@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1379053663-13706-1-git-send-email-namhyung@kernel.org [ Fix it up wrt Ingo's tools/perf build speedups ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-annotate.c')
-rw-r--r--tools/perf/builtin-annotate.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 0393d9800516..94f9a8e78117 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -30,6 +30,7 @@
30#include "util/tool.h" 30#include "util/tool.h"
31#include "arch/common.h" 31#include "arch/common.h"
32 32
33#include <dlfcn.h>
33#include <linux/bitmap.h> 34#include <linux/bitmap.h>
34 35
35struct perf_annotate { 36struct perf_annotate {
@@ -142,8 +143,18 @@ find_next:
142 143
143 if (use_browser == 2) { 144 if (use_browser == 2) {
144 int ret; 145 int ret;
146 int (*annotate)(struct hist_entry *he,
147 struct perf_evsel *evsel,
148 struct hist_browser_timer *hbt);
149
150 annotate = dlsym(perf_gtk_handle,
151 "hist_entry__gtk_annotate");
152 if (annotate == NULL) {
153 ui__error("GTK browser not found!\n");
154 return;
155 }
145 156
146 ret = hist_entry__gtk_annotate(he, evsel, NULL); 157 ret = annotate(he, evsel, NULL);
147 if (!ret || !ann->skip_missing) 158 if (!ret || !ann->skip_missing)
148 return; 159 return;
149 160
@@ -247,8 +258,17 @@ static int __cmd_annotate(struct perf_annotate *ann)
247 goto out_delete; 258 goto out_delete;
248 } 259 }
249 260
250 if (use_browser == 2) 261 if (use_browser == 2) {
251 perf_gtk__show_annotations(); 262 void (*show_annotations)(void);
263
264 show_annotations = dlsym(perf_gtk_handle,
265 "perf_gtk__show_annotations");
266 if (show_annotations == NULL) {
267 ui__error("GTK browser not found!\n");
268 goto out_delete;
269 }
270 show_annotations();
271 }
252 272
253out_delete: 273out_delete:
254 /* 274 /*