perf tools: Fix build errors with O and DESTDIR make vars set
PATCH 1/1 perf tools: Fix build errors with O and DESTDIR make vars set
From: Robert Richter <[email protected]>
Fixing build errors with O and DESTDIR make vars set:
$ make prefix=/usr/local O=$builddir DESTDIR=$destdir -C tools/ perf
...
make[1]: Entering directory `.../.source/perf/tools/perf'
CC .../.build/perf/perf/util/parse-events.o
util/parse-events.c:14:32: fatal error: parse-events-bison.h: No such file or directory
compilation terminated.
make[1]: *** [.../.build/perf/perf/util/parse-events.o] Error 1
...and:
LINK /.../.build/perf/perf/perf
gcc: error: /.../.build/perf/perf//.../.source/perf/tools/lib/lk/liblk.a: No such file or directory
--- tools/perf/Makefile | 5 ++--- tools/perf/config/Makefile | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-)
tools/perf/Makefile +2 -3
@@ -121,17 +121,16 @@ SCRIPT_SH += perf-archive.sh grep-libs = $(filter -l%,$(1)) strip-libs = $(filter-out -l%,$(1)) -LK_PATH=$(LK_DIR) - ifneq ($(OUTPUT),) TE_PATH=$(OUTPUT) ifneq ($(subdir),) - LK_PATH=$(OUTPUT)$(LK_DIR) + LK_PATH=$(objtree)/lib/lk/ else LK_PATH=$(OUTPUT) endif else TE_PATH=$(TRACE_EVENT_DIR) + LK_PATH=$(LK_DIR) endif LIBTRACEEVENT = $(TE_PATH)libtraceevent.a
tools/perf/config/Makefile +1 -1
@@ -39,7 +39,7 @@ src-perf := $(srctree)/tools/perf endif ifeq ($(obj-perf),) -obj-perf := $(objtree) +obj-perf := $(OUTPUT) endif ifneq ($(obj-perf),)
Signature · 1 line
1.8.1.1
tip-bot for Robert Richter
merge botperf tools: Fix build errors with O and DESTDIR make vars set
Commit-ID: 107de3724eff5a6fa6474a4d2aa5460b63749ebf Gitweb: http://git.kernel.org/tip/107de3724eff5a6fa6474a4d2aa5460b63749ebf Author: Robert Richter <[email protected]> AuthorDate: Tue, 11 Jun 2013 17:22:38 +0200 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 8 Jul 2013 17:34:00 -0300
perf tools: Fix build errors with O and DESTDIR make vars set
Fixing build errors with O and DESTDIR make vars set:
$ make prefix=/usr/local O=$builddir DESTDIR=$destdir -C tools/ perf
...
make[1]: Entering directory `.../.source/perf/tools/perf'
CC .../.build/perf/perf/util/parse-events.o
util/parse-events.c:14:32: fatal error: parse-events-bison.h: No such file or directory
compilation terminated.
make[1]: *** [.../.build/perf/perf/util/parse-events.o] Error 1
...and:
LINK /.../.build/perf/perf/perf
gcc: error: /.../.build/perf/perf//.../.source/perf/tools/lib/lk/liblk.a: No such file or directory
--- tools/perf/Makefile | 5 ++--- tools/perf/config/Makefile | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-)
tools/perf/Makefile +2 -3
@@ -121,17 +121,16 @@ SCRIPT_SH += perf-archive.sh grep-libs = $(filter -l%,$(1)) strip-libs = $(filter-out -l%,$(1)) -LK_PATH=$(LK_DIR) - ifneq ($(OUTPUT),) TE_PATH=$(OUTPUT) ifneq ($(subdir),) - LK_PATH=$(OUTPUT)$(LK_DIR) + LK_PATH=$(objtree)/lib/lk/ else LK_PATH=$(OUTPUT) endif else TE_PATH=$(TRACE_EVENT_DIR) + LK_PATH=$(LK_DIR) endif LIBTRACEEVENT = $(TE_PATH)libtraceevent.a
tools/perf/config/Makefile +1 -1
@@ -39,7 +39,7 @@ src-perf := $(srctree)/tools/perf endif ifeq ($(obj-perf),) -obj-perf := $(objtree) +obj-perf := $(OUTPUT) endif ifneq ($(obj-perf),)
Quoted 11 lines · tip-bot for Robert Richter
Commit-ID: 107de3724eff5a6fa6474a4d2aa5460b63749ebf Gitweb: http://git.kernel.org/tip/107de3724eff5a6fa6474a4d2aa5460b63749ebf Author: Robert Richter <[email protected]> AuthorDate: Tue, 11 Jun 2013 17:22:38 +0200 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 8 Jul 2013 17:34:00 -0300perf tools: Fix build errors with O and DESTDIR make vars set
Fixing build errors with O and DESTDIR make vars set:
Quoted 8 lines
$ make prefix=/usr/local O=$builddir DESTDIR=$destdir -C tools/ perf
...
make[1]: Entering directory `.../.source/perf/tools/perf'
CC .../.build/perf/perf/util/parse-events.o
util/parse-events.c:14:32: fatal error: parse-events-bison.h: No such file or directory
compilation terminated.
make[1]: *** [.../.build/perf/perf/util/parse-events.o] Error 1
...Boris just raised another variant of building perf tools, which unfortunately is broken now:
$ make tools/perf
LINK /home/robert/cx/linux/tools/perf/perf
gcc: error: ../linux/tools/lib/lk/liblk.a: No such file or directoryThere is also
$ make -C tools perf $ make -C tools/perf
Plus variants with O= and DESTDIR set.
Looking how to fix this...
-Robert
PATCH 1/1 perf tools: Fix 'make tools/perf'
Quoted 8 lines · Robert Richter
Quoted 7 lines · tip-bot for Robert Richter
Commit-ID: 107de3724eff5a6fa6474a4d2aa5460b63749ebf Gitweb: http://git.kernel.org/tip/107de3724eff5a6fa6474a4d2aa5460b63749ebf Author: Robert Richter <[email protected]> AuthorDate: Tue, 11 Jun 2013 17:22:38 +0200 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 8 Jul 2013 17:34:00 -0300
Quoted 5 lines
Quoted 1 line
perf tools: Fix build errors with O and DESTDIR make vars set
$ make tools/perf LINK /home/robert/cx/linux/tools/perf/perf gcc: error: ../linux/tools/lib/lk/liblk.a: No such file or directory
Fix below.
-Robert
Quoted 1 line
From
ff89180092114191b1871eaa2b6f18d17124b21eMon Sep 17 00:00:00 2001
From: Robert Richter <[email protected]>
Date: Tue, 16 Jul 2013 15:46:27 +0200
Subject: [PATCH] perf tools: Fix 'make tools/perf'
Boris just raised another variant of building perf tools which is broken:
$ make tools/perf
...
LINK /home/robert/cx/linux/tools/perf/perf
gcc: error: ../linux/tools/lib/lk/liblk.a: No such file or directoryThe variant wasn't considered by:
107de37 perf tools: Fix build errors with O and DESTDIR make vars set
There are other variant of building perf too:
$ make -C tools perf $ make -C tools/perf
Plus variants with O= and DESTDIR set.
This patch fixes the above and was tested with the following:
$ make O=... DESTDIR=... tools/perf $ make O=... DESTDIR=... -C tools/ perf $ make O=... DESTDIR=... -C tools/perf $ make tools/perf $ make -C tools/ perf $ make -C tools/perf
--- tools/perf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/Makefile +1 -1
@@ -124,7 +124,7 @@ strip-libs = $(filter-out -l%,$(1)) ifneq ($(OUTPUT),) TE_PATH=$(OUTPUT) ifneq ($(subdir),) - LK_PATH=$(objtree)/lib/lk/ + LK_PATH=$(OUTPUT)/../lib/lk/ else LK_PATH=$(OUTPUT) endif
Signature · 1 line
1.8.3.2
Re: [PATCH] perf tools: Fix 'make tools/perf'
Em Tue, Jul 16, 2013 at 04:50:36PM +0200, Robert Richter escreveu:
Quoted 7 lines
There are other variant of building perf too:
$ make -C tools perf $ make -C tools/perfPlus variants with O= and DESTDIR set.
Quoted 8 lines
This patch fixes the above and was tested with the following:
$ make O=... DESTDIR=... tools/perf $ make O=... DESTDIR=... -C tools/ perf $ make O=... DESTDIR=... -C tools/perf $ make tools/perf $ make -C tools/ perf $ make -C tools/perf
Thanks, those work now, applied, but can you check all those with actual targets at the end, i.e. like:
make tools/perf install
Humm, probably it will look at the top level 'install' target? There was some discussion about this, right? Can you refresh my mind?
- Arnaldo
Re: [PATCH] perf tools: Fix 'make tools/perf'
Quoted 2 lines · Arnaldo Carvalho de Melo
Humm, probably it will look at the top level 'install' target? There was some discussion about this, right? Can you refresh my mind?
that's
make tools/perf_install.
which goes to the target in tools/Makefile as the rest of the tools there.
Signature · 5 lines
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--Re: [PATCH] perf tools: Fix 'make tools/perf'
Quoted 3 lines · Borislav Petkov
Quoted 2 lines · Arnaldo Carvalho de Melo
Humm, probably it will look at the top level 'install' target? There was some discussion about this, right? Can you refresh my mind?
Yeah, this
make tools/perf install
does 2 different things and not what you want.
Quoted 7 lines
that's
make
tools/perf_install.which goes to the target in
tools/Makefileas the rest of the tools there.
But Boris' one should work.
Thanks,
-Robert
Re: [PATCH] perf tools: Fix 'make tools/perf'
Arnaldo,
I noticed you applied the patch to acme/perf/core, but it should be instead in urgent since mainline is broken.
Quoted 4 lines · Robert Richter
Quoted 3 lines · Borislav Petkov
Quoted 2 lines · Arnaldo Carvalho de Melo
Humm, probably it will look at the top level 'install' target? There was some discussion about this, right? Can you refresh my mind?
Now tested with:
make O=... DESTDIR=... tools/perf
make O=... DESTDIR=... tools/perf_install
make O=... DESTDIR=... -C tools/ perf
make O=... DESTDIR=... -C tools/ perf_install
make O=... DESTDIR=... -C tools/perf
make O=... DESTDIR=... -C tools/perf install
make tools/perf
make DESTDIR=... tools/perf_install
make -C tools/ perf
make -C tools/ DESTDIR=... perf_install
make -C tools/perf
make -C tools/perf DESTDIR=... install
No issues noticed, accept that doc is built when running the 'install' target, not 'all'.
Will look at this.
We also should remove dependencies from install targets that trigger a rebuild since 'make install' is run as root. I had a conversation with Linus about this for building the arm kernel, but the same applies also for perf tools. I don't have the time for changing this now, but maybe in some weeks or so.
Thanks,
-Robert
Re: [PATCH] perf tools: Fix 'make tools/perf'
Em Thu, Jul 18, 2013 at 02:19:24PM +0200, Robert Richter escreveu:
Quoted 4 lines
Arnaldo,
I noticed you applied the patch to acme/perf/core, but it should be instead in urgent since mainline is broken.
I did it because there are alternative ways to build the tools that don't require this fix, i.e. this is not _strictly_ needed to build the tools.
What do you guys think: a case like this always needs to go to the current release candidate? Ingo?
- Arnaldo
Quoted 35 lines · Robert Richter
Quoted 4 lines · Borislav Petkov
Quoted 3 lines · Arnaldo Carvalho de Melo
Quoted 2 lines
Humm, probably it will look at the top level 'install' target? There was some discussion about this, right? Can you refresh my mind?
Now tested with:
make O=... DESTDIR=...
tools/perf
make O=... DESTDIR=...tools/perf_install
make O=... DESTDIR=... -Ctools/perf
make O=... DESTDIR=... -Ctools/perf_install
make O=... DESTDIR=... -Ctools/perf
make O=... DESTDIR=... -Ctools/perfinstall
maketools/perf
make DESTDIR=...tools/perf_install
make -Ctools/perf
make -Ctools/DESTDIR=...perf_install
make -Ctools/perf
make -Ctools/perfDESTDIR=... installNo issues noticed, accept that doc is built when running the 'install' target, not 'all'.
Will look at this.
We also should remove dependencies from install targets that trigger a rebuild since 'make install' is run as root. I had a conversation with Linus about this for building the arm kernel, but the same applies also for perf tools. I don't have the time for changing this now, but maybe in some weeks or so.
Thanks,
-Robert
Re: [PATCH] perf tools: Fix 'make tools/perf'
Quoted 10 lines · Arnaldo Carvalho de Melo
Em Thu, Jul 18, 2013 at 02:19:24PM +0200, Robert Richter escreveu:
Quoted 2 lines
I noticed you applied the patch to acme/perf/core, but it should be instead in urgent since mainline is broken.
I did it because there are alternative ways to build the tools that don't require this fix, i.e. this is not _strictly_ needed to build the tools.
What do you guys think: a case like this always needs to go to the current release candidate? Ingo?
Since it worked before with v3.10 this is a regression in v3.11.
Quoted 2 lines
Quoted 2 lines
No issues noticed, accept that doc is built when running the 'install' target, not 'all'.
There is another problem building the doc with xmlto. I noticed odd timestamps leading *.1 files to be rebuilt (note that the .xml file is newer than *.1):
-rw-r--r-- 1 robert robert 5049 2013-07-18 14:57:27.000000000 +0200 perf-diff.1 -rw-r--r-- 1 robert robert 6771 2013-07-18 14:57:27.000207803 +0200 perf-diff.xml
The reason is that xmlto builds the files in /tmp. In my system /tmp is ext3 while /home is ext4. Only ext4 supports nanosecond timestamps. Thus, timestamps are not quite comparable and make is confused a bit.
This would fix this, but I am not sure if we really want this change:
tools/perf/Documentation/Makefile +2 -1
@@ -273,7 +273,8 @@ $(MAN_HTML): $(OUTPUT)%.html : %.txt $(OUTPUT)%.1 $(OUTPUT)%.5 $(OUTPUT)%.7 : $(OUTPUT)%.xml $(QUIET_XMLTO)$(RM) $@ && \ - $(XMLTO) -o $(OUTPUT). -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $< + $(XMLTO) -o $(OUTPUT). -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $< && \ + touch $@ $(OUTPUT)%.xml : %.txt $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
If so, I will send a patch.
Thanks,
-Robert
PATCH 1/1 perf tools: Build docs with 'make all'
In reply to Robert RichterArnaldo,
Quoted 4 lines · Robert Richter
No issues noticed, accept that doc is built when running the 'install' target, not 'all'.
Will look at this.
see patch below that fixes the above.
-Robert
Quoted 1 line
From
3bf424ea33526fefbce9f95d4ccfaffd36016a21Mon Sep 17 00:00:00 2001
From: Robert Richter <[email protected]>
Date: Thu, 18 Jul 2013 17:57:20 +0200
Subject: [PATCH] perf tools: Build docs with 'make all'
Build documentation with 'make all', not 'make install'. We use the new target try-man for this which is similar implemented as try-install-man. Thus, building the doc is skipped if tools for this are missing.
--- tools/perf/Documentation/Makefile | 6 ++++-- tools/perf/Makefile | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-)
tools/perf/Documentation/Makefile +4 -2
@@ -182,6 +182,8 @@ ifdef missing_tools $(error "You need to install $(missing_tools) for man pages") endif +do-man: man + do-install-man: man $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir) # $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir)
@@ -192,11 +194,11 @@ do-install-man: man install-man: check-man-tools man -try-install-man: +try-install-man try-man: ifdef missing_tools $(warning Please install $(missing_tools) to have the man pages installed) else - $(MAKE) do-install-man + $(MAKE) $(patsubst try-%,do-%,$@) endif install-info: info
tools/perf/Makefile +5 -2
@@ -522,7 +522,7 @@ export INSTALL SHELL_PATH SHELL = $(SHELL_PATH) -all: shell_compatibility_test $(ALL_PROGRAMS) $(LANG_BINDINGS) $(OTHER_PROGRAMS) +all: shell_compatibility_test $(ALL_PROGRAMS) $(LANG_BINDINGS) $(OTHER_PROGRAMS) try-man please_set_SHELL_PATH_to_a_more_modern_shell: @$$(:)
@@ -710,9 +710,12 @@ endif DOC_TARGETS := doc man html info pdf -INSTALL_DOC_TARGETS := $(patsubst %,install-%,$(DOC_TARGETS)) try-install-man +INSTALL_DOC_TARGETS := $(patsubst %,install-%,$(DOC_TARGETS)) INSTALL_DOC_TARGETS += quick-install-doc quick-install-man quick-install-html +DOC_TARGETS += try-man +INSTALL_DOC_TARGETS += try-install-man + # 'make doc' should call 'make -C Documentation all' $(DOC_TARGETS): $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) $(@:doc=all)
Signature · 1 line
1.8.3.2
tip-bot for Robert Richter
merge bot[tip:perf/core] perf tools: Fix 'make tools/perf'
In reply to Robert Richterperf tools: Fix 'make tools/perf'
Commit-ID: ab4ecda5205b56cb3b8b44f2c18ffdefb24313a2 Gitweb: http://git.kernel.org/tip/ab4ecda5205b56cb3b8b44f2c18ffdefb24313a2 Author: Robert Richter <[email protected]> AuthorDate: Tue, 16 Jul 2013 16:50:36 +0200 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 17 Jul 2013 10:40:02 -0300
perf tools: Fix 'make tools/perf'
Boris just raised another variant of building perf tools which is broken:
$ make tools/perf
...
LINK /home/robert/cx/linux/tools/perf/perf
gcc: error: ../linux/tools/lib/lk/liblk.a: No such file or directoryThe variant wasn't considered by:
107de37 perf tools: Fix build errors with O and DESTDIR make vars set
There are other variant of building perf too:
$ make -C tools perf $ make -C tools/perf
Plus variants with O= and DESTDIR set.
This patch fixes the above and was tested with the following:
$ make O=... DESTDIR=... tools/perf $ make O=... DESTDIR=... -C tools/ perf $ make O=... DESTDIR=... -C tools/perf $ make tools/perf $ make -C tools/ perf $ make -C tools/perf
--- tools/perf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/Makefile +1 -1
@@ -124,7 +124,7 @@ strip-libs = $(filter-out -l%,$(1)) ifneq ($(OUTPUT),) TE_PATH=$(OUTPUT) ifneq ($(subdir),) - LK_PATH=$(objtree)/lib/lk/ + LK_PATH=$(OUTPUT)/../lib/lk/ else LK_PATH=$(OUTPUT) endif