perf: Let O= makes handle relative paths
PATCH 1/1 perf: Let O= makes handle relative paths
When I did a compile of perf using a relative path for the output directory, the build failed when it tried to compile libtraceevent. This is because it continues to use the same relative path when the new working directory is in a different path.
SUBDIR ../lib/traceevent//bin/sh: line 0: cd: ../../../nobackup/perf/: No such file or directory Makefile:74: *** output directory "../../../nobackup/perf/" does not exist. Stop.
make: *** [../../../nobackup/perf///libtraceevent.a] Error 2
Make the path used an absolute path when building perf with O=.
tools/scripts/Makefile.include +3 -2
@@ -1,6 +1,7 @@ ifeq ("$(origin O)", "command line") - OUTPUT := $(O)/ - COMMAND_O := O=$(O) + RAW_O := $(shell cd $(O) ; pwd) + OUTPUT := $(RAW_O)/ + COMMAND_O := O=$(RAW_O) endif ifneq ($(OUTPUT),)
Quoted 20 lines · Steven Rostedt
When I did a compile of perf using a relative path for the output directory, the build failed when it tried to compile libtraceevent. This is because it continues to use the same relative path when the new working directory is in a different path.
SUBDIR ../lib/traceevent/
/bin/sh: line 0: cd: ../../../nobackup/perf/: No such file or directory Makefile:74: *** output directory "../../../nobackup/perf/" does not exist. Stop.
make: *** [../../../nobackup/perf///libtraceevent.a] Error 2Make the path used an absolute path when building perf with O=.
Signed-off-by Steven Rostedt <[email protected]>tools/scripts/Makefile.include +0
-0
tools/scripts/Makefile.include line 4
Quoted 6 lines
tools/scripts/Makefile.include +3
-2@@ -1,6 +1,7 @@ ifeq ("$(origin O)", "command line") - OUTPUT := $(O)/ - COMMAND_O := O=$(O) + RAW_O := $(shell cd $(O) ; pwd) + OUTPUT := $(RAW_O)/ + COMMAND_O := O=$(RAW_O)
So wouldn't it make sense to call this ABSOLUTE_O or so then?
Thanks.
Signature · 8 lines
Regards/Gruss, Boris. Advanced Micro Devices GmbH Einsteinring 24, 85609 Dornach GM: Alberto Bozzo Reg: Dornach, Landkreis Muenchen HRB Nr. 43632 WEEE Registernr: 129 19551
Quoted 1 line · Borislav Petkov
So wouldn't it make sense to call this
ABSOLUTE_Oor so then?
That's just because you're russian, and are promoting Vodka! ;-)
Done...
----------
When I did a compile of perf using a relative path for the output directory, the build failed when it tried to compile libtraceevent. This is because it continues to use the same relative path when the new working directory is in a different path.
SUBDIR ../lib/traceevent//bin/sh: line 0: cd: ../../../nobackup/perf/: No such file or directory Makefile:74: *** output directory "../../../nobackup/perf/" does not exist. Stop.
make: *** [../../../nobackup/perf///libtraceevent.a] Error 2
Make the path used an absolute path when building perf with O=.
tools/scripts/Makefile.include +3 -2
@@ -1,6 +1,7 @@ ifeq ("$(origin O)", "command line") - OUTPUT := $(O)/ - COMMAND_O := O=$(O) + ABSOLUTE_O := $(shell cd $(O) ; pwd) + OUTPUT := $(ABSOLUTE_O)/ + COMMAND_O := O=$(ABSOLUTE_O) endif ifneq ($(OUTPUT),)
Borislav Petkov
Acked-by The Russian Vodka Promoter.Quoted 22 lines · Steven Rostedt
Quoted 1 line · Borislav Petkov
So wouldn't it make sense to call this
ABSOLUTE_Oor so then?That's just because you're russian, and are promoting Vodka! ;-)
Done...
----------
When I did a compile of perf using a relative path for the output directory, the build failed when it tried to compile libtraceevent. This is because it continues to use the same relative path when the new working directory is in a different path.
SUBDIR ../lib/traceevent/
/bin/sh: line 0: cd: ../../../nobackup/perf/: No such file or directory Makefile:74: *** output directory "../../../nobackup/perf/" does not exist. Stop.
make: *** [../../../nobackup/perf///libtraceevent.a] Error 2
Quoted 3 lines
Make the path used an absolute path when building perf with O=.
Signed-off-by Steven Rostedt <[email protected]>
8-).
Thanks and Na Zdorovia!
Signature · 8 lines
Regards/Gruss, Boris. Advanced Micro Devices GmbH Einsteinring 24, 85609 Dornach GM: Alberto Bozzo Reg: Dornach, Landkreis Muenchen HRB Nr. 43632 WEEE Registernr: 129 19551
Em Mon, Aug 13, 2012 at 04:29:09PM +0200, Borislav Petkov escreveu:
Quoted 6 lines · Steven Rostedt
Quoted 5 lines · Borislav Petkov
Quoted 2 lines
So wouldn't it make sense to call this
ABSOLUTE_Oor so then?That's just because you're russian, and are promoting Vodka! ;-)
Before:
[acme@sandy linux]$ rm -rf ../build/perf
[acme@sandy linux]$ make -j8 -C tools/perf/ LIBUNWIND_DIR=/opt/libunwind O=/home/acme/git/build/perf install /bin/sh: line 0: cd: /home/acme/git/build/perf/: No such file or directory
make: Entering directory `/home/git/linux/tools/perf'
../scripts/Makefile.include:9: *** output directory "/home/acme/git/build/perf/" does not exist. Stop.
make: Leaving directory `/home/git/linux/tools/perf'
[acme@sandy linux]$
Now:
[acme@sandy linux]$ rm -rf ../build/perf
[acme@sandy linux]$ make -j8 -C tools/perf/ LIBUNWIND_DIR=/opt/libunwind O=/home/acme/git/build/perf install /bin/sh: line 0: cd: /home/acme/git/build/perf: No such file or directory
make: Entering directory `/home/git/linux/tools/perf'
GEN perf-archive
GEN /home/git/linux/tools/perf/python/perf.so
make[1]: Entering directory `/home/git/linux/tools/lib/traceevent'
make[2]: warning: jobserver unavailable: using -j1. Add `+' to parent make rule.
* new build flags or cross compiler
CC /home/git/linux/tools/perf/perf.o
CC /home/git/linux/tools/perf/builtin-annotate.o
CC /home/git/linux/tools/perf/builtin-bench.o
CC /home/git/linux/tools/perf/bench/sched-messaging.o
CC /home/git/linux/tools/perf/bench/sched-pipe.o
I.e. it should stop if the O= provided directory is not there.
Can you fix this? Avoid vodka while doing it :-P
- Arnaldo
Quoted 15 lines · Arnaldo Carvalho de Melo
[acme@sandy linux]$ rm -rf ../build/perf
[acme@sandy linux]$ make -j8 -Ctools/perf/LIBUNWIND_DIR=/opt/libunwind O=/home/acme/git/build/perf install/bin/sh: line 0: cd:/home/acme/git/build/perf: No such file or directory
make: Entering directory `/home/git/linux/tools/perf'
GEN perf-archive
GEN/home/git/linux/tools/perf/python/perf.so
make[1]: Entering directory `/home/git/linux/tools/lib/traceevent'
make[2]: warning: jobserver unavailable: using -j1. Add `+' to parent make rule.
* new build flags or cross compiler
CC/home/git/linux/tools/perf/perf.o
CC/home/git/linux/tools/perf/builtin-annotate.o
CC/home/git/linux/tools/perf/builtin-bench.o
CC/home/git/linux/tools/perf/bench/sched-messaging.o
CC/home/git/linux/tools/perf/bench/sched-pipe.o
Quoted 1 line
I.e. it should stop if the O= provided directory is not there.
Why stop? Don't we want to make the directory instead and continue building in there?
Signature · 8 lines
Regards/Gruss, Boris. Advanced Micro Devices GmbH Einsteinring 24, 85609 Dornach GM: Alberto Bozzo Reg: Dornach, Landkreis Muenchen HRB Nr. 43632 WEEE Registernr: 129 19551
Em Wed, Aug 15, 2012 at 12:27:22PM +0200, Borislav Petkov escreveu:
Quoted 11 lines · Arnaldo Carvalho de Melo
Quoted 9 lines
[acme@sandy linux]$ rm -rf ../build/perf
[acme@sandy linux]$ make -j8 -Ctools/perf/LIBUNWIND_DIR=/opt/libunwind O=/home/acme/git/build/perf install/bin/sh: line 0: cd:/home/acme/git/build/perf: No such file or directory
make: Entering directory `/home/git/linux/tools/perf'
GEN perf-archive
GEN/home/git/linux/tools/perf/python/perf.so
make[1]: Entering directory `/home/git/linux/tools/lib/traceevent'
* new build flags or cross compiler
CC/home/git/linux/tools/perf/perf.o
Quoted 4 lines
Quoted 1 line
I.e. it should stop if the O= provided directory is not there.
Why stop? Don't we want to make the directory instead and continue building in there?
That was the case in the past, but IIRC PeterZ advocated not to and I agreed.
- Arnaldo
Quoted 2 lines · Arnaldo Carvalho de Melo
That was the case in the past, but IIRC PeterZ advocated not to and I agreed.
Maybe you guys need to explain yourselves :) I mean, the dir is not present so we're not overwriting anything. And since we say "O=..." on the command line, it is actually expected that we really mean it... why type it, otherwise?
Hmmm.
Signature · 8 lines
Regards/Gruss, Boris. Advanced Micro Devices GmbH Einsteinring 24, 85609 Dornach GM: Alberto Bozzo Reg: Dornach, Landkreis Muenchen HRB Nr. 43632 WEEE Registernr: 129 19551
Quoted 8 lines · Borislav Petkov
Quoted 2 lines · Arnaldo Carvalho de Melo
That was the case in the past, but IIRC PeterZ advocated not to and I agreed.
Maybe you guys need to explain yourselves :) I mean, the dir is not present so we're not overwriting anything. And since we say "O=..." on the command line, it is actually expected that we really mean it... why type it, otherwise?
Because you're an idiot and made a typo ;-) Happens to me all the time.
The regular kernel build doesn't create non-existent O= targets either iirc.
Quoted 1 line · Peter Zijlstra
Because you're an idiot and made a typo ;-) Happens to me all the time.
I'm not an idiot - I'm perfection at its purest! :-)
Quoted 2 lines
The regular kernel build doesn't create non-existent O= targets either iirc.
Ok, I see. The kernel needs to protect itself against the people who wrote it :-).
Signature · 8 lines
Regards/Gruss, Boris. Advanced Micro Devices GmbH Einsteinring 24, 85609 Dornach GM: Alberto Bozzo Reg: Dornach, Landkreis Muenchen HRB Nr. 43632 WEEE Registernr: 129 19551
Em Wed, Aug 15, 2012 at 04:42:55PM +0200, Borislav Petkov escreveu:
Quoted 10 lines · Peter Zijlstra
Quoted 1 line
Because you're an idiot and made a typo ;-) Happens to me all the time.
I'm not an idiot - I'm perfection at its purest! :-)
Quoted 2 lines
The regular kernel build doesn't create non-existent O= targets either iirc.
Ok, I see. The kernel needs to protect itself against the people who wrote it :-).
Of course! Those are the ultimate kernel killers!
- Arnaldo
Quoted 1 line · Arnaldo Carvalho de Melo
Of course! Those are the ultimate kernel killers!
Haha, this is what I'm answering next time I'm asked about what I do for a living :-).
How about this?
--
From: Steven Rostedt <[email protected]>
Date: Mon, 13 Aug 2012 10:23:02 -0400
Subject: [PATCH] perf: Let O= makes handle relative paths
When I did a compile of perf using a relative path for the output directory, the build failed when it tried to compile libtraceevent. This is because it continues to use the same relative path when the new working directory is in a different path.
SUBDIR ../lib/traceevent//bin/sh: line 0: cd: ../../../nobackup/perf/: No such file or directory Makefile:74: *** output directory "../../../nobackup/perf/" does not exist. Stop.
make: *** [../../../nobackup/perf///libtraceevent.a] Error 2
Make the path used an absolute path when building perf with O=.
Boris:
Teach Makefile to check whether the supplied O= directory exists and bail out if not. Reportedly, kernel dudes are idiots and need to be guarded so as not to shoot themselves in the foot when playing in the sandbox.
--- tools/scripts/Makefile.include | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
tools/scripts/Makefile.include +4 -2
@@ -1,6 +1,8 @@ ifeq ("$(origin O)", "command line") - OUTPUT := $(O)/ - COMMAND_O := O=$(O) + dummy := $(if $(shell test -d $(O) || echo $(O)),$(error O=$(O) does not exist),) + ABSOLUTE_O := $(shell cd $(O) ; pwd) + OUTPUT := $(ABSOLUTE_O)/ + COMMAND_O := O=$(ABSOLUTE_O) endif ifneq ($(OUTPUT),)
Signature · 11 lines
1.7.11.rc1 -- Regards/Gruss, Boris. Advanced Micro Devices GmbH Einsteinring 24, 85609 Dornach GM: Alberto Bozzo Reg: Dornach, Landkreis Muenchen HRB Nr. 43632 WEEE Registernr: 129 19551
Steven Rostedt
Acked-byQuoted 5 lines · Borislav Petkov
tools/scripts/Makefile.include +0
-0
tools/scripts/Makefile.include line 7
Quoted 9 lines
tools/scripts/Makefile.include +4
-2@@ -1,6 +1,8 @@ ifeq ("$(origin O)", "command line") - OUTPUT := $(O)/ - COMMAND_O := O=$(O) + dummy := $(if $(shell test -d $(O) || echo $(O)),$(error O=$(O) does not exist),) + ABSOLUTE_O := $(shell cd $(O) ; pwd) + OUTPUT := $(ABSOLUTE_O)/ + COMMAND_O := O=$(ABSOLUTE_O) endif
Arnaldo, can you pick this patch? Keep both the Signed-off-bys that Boris placed.
Thanks!
-- Steve
Em Thu, Aug 16, 2012 at 12:07:54PM -0400, Steven Rostedt escreveu:
Quoted 4 lines
Acked-by Steven Rostedt <[email protected]>Arnaldo, can you pick this patch? Keep both the Signed-off-bys that Boris placed.
ack, done,
- Arnaldo
[tip:perf/core] perf tools: Let O= makes handle relative paths
In reply to Borislav PetkovCommit-ID: c883122acc0d97648d8b8f4726709017674e4420 Gitweb: http://git.kernel.org/tip/c883122acc0d97648d8b8f4726709017674e4420 Author: Steven Rostedt <[email protected]> AuthorDate: Mon, 13 Aug 2012 10:23:02 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Thu, 16 Aug 2012 14:11:11 -0300
perf tools: Let O= makes handle relative paths
When I did a compile of perf using a relative path for the output directory, the build failed when it tried to compile libtraceevent. This is because it continues to use the same relative path when the new working directory is in a different path.
SUBDIR ../lib/traceevent//bin/sh: line 0: cd: ../../../nobackup/perf/: No such file or directory Makefile:74: *** output directory "../../../nobackup/perf/" does not exist. Stop.
make: *** [../../../nobackup/perf///libtraceevent.a] Error 2
Make the path used an absolute path when building perf with O=.
Boris:
Teach Makefile to check whether the supplied O= directory exists and bail out if not. Reportedly, kernel dudes are idiots and need to be guarded so as not to shoot themselves in the foot when playing in the sandbox.
--- tools/scripts/Makefile.include | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
tools/scripts/Makefile.include +4 -2
@@ -1,6 +1,8 @@ ifeq ("$(origin O)", "command line") - OUTPUT := $(O)/ - COMMAND_O := O=$(O) + dummy := $(if $(shell test -d $(O) || echo $(O)),$(error O=$(O) does not exist),) + ABSOLUTE_O := $(shell cd $(O) ; pwd) + OUTPUT := $(ABSOLUTE_O)/ + COMMAND_O := O=$(ABSOLUTE_O) endif ifneq ($(OUTPUT),)