All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf tools: Move libtraceevent dynamic list to separated LDFLAGS variable
@ 2015-06-17 14:46 Wang Nan
  2015-06-17 18:28 ` Jiri Olsa
  2015-06-18  8:16 ` [tip:perf/core] " tip-bot for Wang Nan
  0 siblings, 2 replies; 3+ messages in thread
From: Wang Nan @ 2015-06-17 14:46 UTC (permalink / raw)
  To: acme, namhyung, masami.hiramatsu.pt, a.p.zijlstra, mingo, jolsa
  Cc: linux-kernel, pi3orama, lizefan, hekuang

Commit e3d09ec8126fe2c9a3ade661e2126e215ca27a80 ("tools lib traceevent:
Export dynamic symbols used by traceevent plugins") adds libtraceevent
dynamic list directly into LDFLAGS, which makes all targets depend on
that list through LDFLAGS. This is not good since some of targets like
libgtk.so doesn't use plugin at all, but require the existance of that
list because of linker options.

This patch isolates the -Xlink option into LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS,
makes only perf and perf.so use it.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
---
 tools/perf/Makefile.perf | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index ec2ed6e..5f453a8 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -177,7 +177,7 @@ LIBTRACEEVENT = $(TE_PATH)libtraceevent.a
 export LIBTRACEEVENT
 
 LIBTRACEEVENT_DYNAMIC_LIST = $(TE_PATH)libtraceevent-dynamic-list
-LDFLAGS += -Xlinker --dynamic-list=$(LIBTRACEEVENT_DYNAMIC_LIST)
+LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS = -Xlinker --dynamic-list=$(LIBTRACEEVENT_DYNAMIC_LIST)
 
 LIBAPI = $(LIB_PATH)libapi.a
 export LIBAPI
@@ -196,7 +196,8 @@ PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources)
 PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py $(LIBTRACEEVENT) $(LIBAPI)
 
 $(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS) $(LIBTRACEEVENT_DYNAMIC_LIST)
-	$(QUIET_GEN)CFLAGS='$(CFLAGS)' $(PYTHON_WORD) util/setup.py \
+	$(QUIET_GEN)CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS) $(LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS)' \
+	  $(PYTHON_WORD) util/setup.py \
 	  --quiet build_ext; \
 	mkdir -p $(OUTPUT)python && \
 	cp $(PYTHON_EXTBUILD_LIB)perf.so $(OUTPUT)python/
@@ -290,7 +291,8 @@ $(PERF_IN): $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h FORCE
 	$(Q)$(MAKE) $(build)=perf
 
 $(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(LIBTRACEEVENT_DYNAMIC_LIST)
-	$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(PERF_IN) $(LIBS) -o $@
+	$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS) \
+		$(PERF_IN) $(LIBS) -o $@
 
 $(GTK_IN): FORCE
 	$(Q)$(MAKE) $(build)=gtk
-- 
1.8.3.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf tools: Move libtraceevent dynamic list to separated LDFLAGS variable
  2015-06-17 14:46 [PATCH] perf tools: Move libtraceevent dynamic list to separated LDFLAGS variable Wang Nan
@ 2015-06-17 18:28 ` Jiri Olsa
  2015-06-18  8:16 ` [tip:perf/core] " tip-bot for Wang Nan
  1 sibling, 0 replies; 3+ messages in thread
From: Jiri Olsa @ 2015-06-17 18:28 UTC (permalink / raw)
  To: Wang Nan
  Cc: acme, namhyung, masami.hiramatsu.pt, a.p.zijlstra, mingo, jolsa,
	linux-kernel, pi3orama, lizefan, hekuang

On Wed, Jun 17, 2015 at 02:46:29PM +0000, Wang Nan wrote:
> Commit e3d09ec8126fe2c9a3ade661e2126e215ca27a80 ("tools lib traceevent:
> Export dynamic symbols used by traceevent plugins") adds libtraceevent
> dynamic list directly into LDFLAGS, which makes all targets depend on
> that list through LDFLAGS. This is not good since some of targets like
> libgtk.so doesn't use plugin at all, but require the existance of that
> list because of linker options.
> 
> This patch isolates the -Xlink option into LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS,
> makes only perf and perf.so use it.
> 
> Signed-off-by: Wang Nan <wangnan0@huawei.com>

Acked-by: Jiri Olsa <jolsa@kernel.org>

thanks,
jirka

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:perf/core] perf tools: Move libtraceevent dynamic list to separated LDFLAGS variable
  2015-06-17 14:46 [PATCH] perf tools: Move libtraceevent dynamic list to separated LDFLAGS variable Wang Nan
  2015-06-17 18:28 ` Jiri Olsa
@ 2015-06-18  8:16 ` tip-bot for Wang Nan
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Wang Nan @ 2015-06-18  8:16 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: wangnan0, lizefan, linux-kernel, acme, a.p.zijlstra, mingo, jolsa,
	masami.hiramatsu.pt, hpa, hekuang, tglx, namhyung

Commit-ID:  5d618324dd4442d20dbdb039176787199ba2f12b
Gitweb:     http://git.kernel.org/tip/5d618324dd4442d20dbdb039176787199ba2f12b
Author:     Wang Nan <wangnan0@huawei.com>
AuthorDate: Wed, 17 Jun 2015 14:46:29 +0000
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 17 Jun 2015 16:29:25 -0300

perf tools: Move libtraceevent dynamic list to separated LDFLAGS variable

Commit e3d09ec8126fe2c9a3ade661e2126e215ca27a80 ("tools lib traceevent:
Export dynamic symbols used by traceevent plugins") adds libtraceevent
dynamic list directly into LDFLAGS, which makes all targets depend on
that list through LDFLAGS.

This is not good since some of targets like libgtk.so doesn't use plugin
at all, but require the existance of that list because of linker
options.

This patch isolates the -Xlink option into LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS,
makes only perf and perf.so use it.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: He Kuang <hekuang@huawei.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1434552389-89144-1-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Makefile.perf | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 3743783..1af0cfe 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -174,7 +174,7 @@ LIBTRACEEVENT = $(TE_PATH)libtraceevent.a
 export LIBTRACEEVENT
 
 LIBTRACEEVENT_DYNAMIC_LIST = $(TE_PATH)libtraceevent-dynamic-list
-LDFLAGS += -Xlinker --dynamic-list=$(LIBTRACEEVENT_DYNAMIC_LIST)
+LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS = -Xlinker --dynamic-list=$(LIBTRACEEVENT_DYNAMIC_LIST)
 
 LIBAPI = $(LIB_PATH)libapi.a
 export LIBAPI
@@ -191,7 +191,8 @@ PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources)
 PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py $(LIBTRACEEVENT) $(LIBAPI)
 
 $(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS) $(LIBTRACEEVENT_DYNAMIC_LIST)
-	$(QUIET_GEN)CFLAGS='$(CFLAGS)' $(PYTHON_WORD) util/setup.py \
+	$(QUIET_GEN)CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS) $(LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS)' \
+	  $(PYTHON_WORD) util/setup.py \
 	  --quiet build_ext; \
 	mkdir -p $(OUTPUT)python && \
 	cp $(PYTHON_EXTBUILD_LIB)perf.so $(OUTPUT)python/
@@ -282,7 +283,8 @@ $(PERF_IN): $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h FORCE
 	$(Q)$(MAKE) $(build)=perf
 
 $(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(LIBTRACEEVENT_DYNAMIC_LIST)
-	$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(PERF_IN) $(LIBS) -o $@
+	$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS) \
+		$(PERF_IN) $(LIBS) -o $@
 
 $(GTK_IN): FORCE
 	$(Q)$(MAKE) $(build)=gtk

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-06-18  8:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-17 14:46 [PATCH] perf tools: Move libtraceevent dynamic list to separated LDFLAGS variable Wang Nan
2015-06-17 18:28 ` Jiri Olsa
2015-06-18  8:16 ` [tip:perf/core] " tip-bot for Wang Nan

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.