[lkml]   [2015]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] perf: Ensure symbols for plugins are exported
When building perf with perl or python support it implicitly gets linked
with the -export-dynamic linker option through the additional linker
flags, namely with -Wl,-E via perl or -Xlinker -export-dynamic via
python. That flag is essential for the traceevent plugin support so we
shouldn't rely on adding it implicitly.

Ensure perf's exported symbols can be used by dlopen()ed plugins by
unconditionally adding this flag when linking perf. Otherwise plugins
won't be able to access symbols in the perf binary.

This fixes the following warning / bug when trying to load plugins:

Warning: could not load plugin '/home/minipli/.traceevent/plugins/'
/home/minipli/.traceevent/plugins/ undefined symbol: trace_seq_printf
Warning: could not load plugin '/home/minipli/.traceevent/plugins/'
/home/minipli/.traceevent/plugins/ undefined symbol: warning
Warning: could not load plugin '/home/minipli/.traceevent/plugins/'
/home/minipli/.traceevent/plugins/ undefined symbol: pevent_unregister_event_handler

Cc: Arnaldo Carvalho de Melo <>
Cc: Ingo Molnar <>
Cc: Jiri Olsa <>
Cc: Paul Mackerras <>
Cc: Peter Zijlstra <>
Signed-off-by: Mathias Krause <>
This patch should go on top of tip.git#perf/core

tools/perf/Makefile.perf | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index c43a20517591..2ab8525f366b 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -250,7 +250,8 @@ ifdef ASCIIDOC8
export ASCIIDOC8

-LIBS = -Wl,--whole-archive $(PERFLIBS) -Wl,--no-whole-archive -Wl,--start-group $(EXTLIBS) -Wl,--end-group
+LIBS = -Wl,--export-dynamic -Wl,--whole-archive $(PERFLIBS) -Wl,--no-whole-archive
+LIBS += -Wl,--start-group $(EXTLIBS) -Wl,--end-group



 \ /
  Last update: 2015-04-12 18:41    [W:0.096 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site