From: Jiri Olsa <jolsa@redhat.com>
To: He Kuang <hekuang@huawei.com>
Cc: jolsa@kernel.org, a.p.zijlstra@chello.nl, acme@kernel.org,
mingo@redhat.com, wangnan0@huawei.com,
linux-kernel@vger.kernel.org,
Mathias Krause <minipli@googlemail.com>
Subject: Re: [PATCH 1/2] tools lib traceevent: Export dynamic symbols used by traceevent plugins
Date: Mon, 11 May 2015 16:33:09 +0200 [thread overview]
Message-ID: <20150511143309.GA22341@krava.redhat.com> (raw)
In-Reply-To: <1431336927-17202-1-git-send-email-hekuang@huawei.com>
On Mon, May 11, 2015 at 09:35:26AM +0000, He Kuang wrote:
> Traceevent plugins need dynamic symbols exported from libtraceevent.a,
> otherwise a dlopen error will occur during plugins loading.
>
> This patch uses dynamic-list-file to export dynamic symbols which will
> be used in plugins to perf executable.
>
> The problem is covered up if feature-libpython is enabled, because
> PYTHON_EMBED_LDOPTS contains '-Xlinker --export-dynamic' which adds all
> symbols to the dynamic symbol table. So we should reproduce the problem
> by setting NO_LIBPYTHON=1.
there's was another patch taking the shortcut:
http://marc.info/?l=linux-kernel&m=142885447432384&w=2
it seems it's not merged yet, but I like this one better
SNIP
> diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
> index 03409cc..19c61e0 100644
> --- a/tools/perf/Makefile.perf
> +++ b/tools/perf/Makefile.perf
> @@ -172,6 +172,7 @@ endif
>
> LIBTRACEEVENT = $(TE_PATH)libtraceevent.a
> export LIBTRACEEVENT
> +LIBTRACEEVENT_DYNAMIC_LIST = $(TE_PATH)libtraceevent-dynamic-list
>
> LIBAPI = $(LIB_PATH)libapi.a
> export LIBAPI
> @@ -278,8 +279,9 @@ build := -f $(srctree)/tools/build/Makefile.build dir=. obj
> $(PERF_IN): $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h FORCE
> $(Q)$(MAKE) $(build)=perf
>
> -$(OUTPUT)perf: $(PERFLIBS) $(PERF_IN)
> - $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(PERF_IN) $(LIBS) -o $@
> +LD_LIBTRACEEVENT_FLAGS += -Xlinker --dynamic-list=$(LIBTRACEEVENT_DYNAMIC_LIST)
> +$(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(LIBTRACEEVENT_DYNAMIC_LIST)
> + $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(LD_LIBTRACEEVENT_FLAGS) $(PERF_IN) $(LIBS) -o $@
>
> $(GTK_IN): FORCE
> $(Q)$(MAKE) $(build)=gtk
> @@ -375,6 +377,9 @@ LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ)
> $(LIBTRACEEVENT): FORCE
> $(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) $(OUTPUT)libtraceevent.a plugins
>
> +$(LIBTRACEEVENT_DYNAMIC_LIST): $(LIBTRACEEVENT)
> + $(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) $(OUTPUT)libtraceevent-dynamic-list
hum, do we need extra target in Makefile.perf, it could be rebuilt any time
'plugins:' target in lib/tracevent/Makefile is called
jirka
next prev parent reply other threads:[~2015-05-11 14:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-11 9:35 [PATCH 1/2] tools lib traceevent: Export dynamic symbols used by traceevent plugins He Kuang
2015-05-11 9:35 ` [PATCH 2/2] tools lib traceevent: Ignore libtrace-dynamic-list file He Kuang
2015-05-11 14:33 ` Jiri Olsa [this message]
2015-05-11 14:50 ` [PATCH 1/2] tools lib traceevent: Export dynamic symbols used by traceevent plugins Arnaldo Carvalho de Melo
2015-05-12 6:40 ` Mathias Krause
2015-05-12 6:42 ` He Kuang
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=20150511143309.GA22341@krava.redhat.com \
--to=jolsa@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=hekuang@huawei.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=minipli@googlemail.com \
--cc=wangnan0@huawei.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.