linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mathias Krause <minipli@googlemail.com>
To: linux-kernel@vger.kernel.org
Cc: Mathias Krause <minipli@googlemail.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Ingo Molnar <mingo@redhat.com>, Jiri Olsa <jolsa@redhat.com>,
	Paul Mackerras <paulus@samba.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: [PATCH] perf: Ensure symbols for plugins are exported
Date: Sun, 12 Apr 2015 18:00:51 +0200	[thread overview]
Message-ID: <1428854451-28361-1-git-send-email-minipli@googlemail.com> (raw)

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/plugin_xen.so'
  /home/minipli/.traceevent/plugins/plugin_xen.so: undefined symbol: trace_seq_printf
  Warning: could not load plugin '/home/minipli/.traceevent/plugins/plugin_function.so'
  /home/minipli/.traceevent/plugins/plugin_function.so: undefined symbol: warning
  Warning: could not load plugin '/home/minipli/.traceevent/plugins/plugin_sched_switch.so'
  /home/minipli/.traceevent/plugins/plugin_sched_switch.so: undefined symbol: pevent_unregister_event_handler
  [...]

Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Mathias Krause <minipli@googlemail.com>
---
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
 endif
 
-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
 
 export INSTALL SHELL_PATH
 
-- 
1.7.10.4


             reply	other threads:[~2015-04-12 16:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-12 16:00 Mathias Krause [this message]
2015-04-17 15:34 ` [PATCH] perf: Ensure symbols for plugins are exported Jiri Olsa
2015-04-17 21:01   ` Mathias Krause
2015-04-18 15:46     ` Jiri Olsa
2015-04-22 20:12       ` Mathias Krause

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1428854451-28361-1-git-send-email-minipli@googlemail.com \
    --to=minipli@googlemail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).