Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1309270 > unrolled thread
| Started by | Wang Nan <wangnan0@huawei.com> |
|---|---|
| First post | 2016-01-14 14:20 +0100 |
| Last post | 2016-01-15 03:30 +0100 |
| Articles | 10 — 4 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH v2 3/9] perf build: Test correct path of perf in build-test Wang Nan <wangnan0@huawei.com> - 2016-01-14 14:20 +0100
Re: [PATCH v2 3/9] perf build: Test correct path of perf in build-test Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-01-14 16:00 +0100
Re: [PATCH v2 3/9] perf build: Test correct path of perf in build-test Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-01-14 16:00 +0100
Re: [PATCH v2 3/9] perf build: Test correct path of perf in build-test pi3orama <pi3orama@163.com> - 2016-01-14 16:10 +0100
Re: [PATCH v2 3/9] perf build: Test correct path of perf in build-test Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-01-14 16:50 +0100
Re: [PATCH v2 3/9] perf build: Test correct path of perf in build-test Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-01-14 17:10 +0100
Re: [PATCH v2 3/9] perf build: Test correct path of perf in build-test Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-01-14 18:40 +0100
Re: [PATCH v2 3/9] perf build: Test correct path of perf in build-test "Wangnan (F)" <wangnan0@huawei.com> - 2016-01-15 04:00 +0100
Re: [PATCH v2 3/9] perf build: Test correct path of perf in build-test "Wangnan (F)" <wangnan0@huawei.com> - 2016-01-15 04:40 +0100
Re: [PATCH v2 3/9] perf build: Test correct path of perf in build-test "Wangnan (F)" <wangnan0@huawei.com> - 2016-01-15 03:30 +0100
| From | Wang Nan <wangnan0@huawei.com> |
|---|---|
| Date | 2016-01-14 14:20 +0100 |
| Subject | [PATCH v2 3/9] perf build: Test correct path of perf in build-test |
| Message-ID | <qQPYK-7yP-15@gated-at.bofh.it> |
If an 'O' is passed to 'make build-test', many 'test -x' and 'test -f'
will fail because perf resides in a different directory. Fix this by
computing PERF_OUT according to 'O' and test correct output files.
For make_kernelsrc and make_kernelsrc_tools, set KBUILD_OUTPUT_DIR
instead because the path is different from others ($(O)/perf vs
$(O)/tools/perf).
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
---
tools/perf/tests/make | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/tools/perf/tests/make b/tools/perf/tests/make
index 14d7b8d..e74c86b 100644
--- a/tools/perf/tests/make
+++ b/tools/perf/tests/make
@@ -13,10 +13,12 @@ else
endif
else
PERF := .
+PERF_O := $(PERF)
O_OPT :=
ifneq ($(O),)
FULL_O := $(shell readlink -f $(O) || echo $(O))
+ PERF_O := $(FULL_O)
ifeq ($(SET_O),1)
O_OPT := 'O=$(FULL_O)'
endif
@@ -173,11 +175,11 @@ test_make_doc := $(test_ok)
test_make_help_O := $(test_ok)
test_make_doc_O := $(test_ok)
-test_make_python_perf_so := test -f $(PERF)/python/perf.so
+test_make_python_perf_so := test -f $(PERF_O)/python/perf.so
-test_make_perf_o := test -f $(PERF)/perf.o
-test_make_util_map_o := test -f $(PERF)/util/map.o
-test_make_util_pmu_bison_o := test -f $(PERF)/util/pmu-bison.o
+test_make_perf_o := test -f $(PERF_O)/perf.o
+test_make_util_map_o := test -f $(PERF_O)/util/map.o
+test_make_util_pmu_bison_o := test -f $(PERF_O)/util/pmu-bison.o
define test_dest_files
for file in $(1); do \
@@ -244,7 +246,7 @@ test_make_perf_o_O := test -f $$TMP_O/perf.o
test_make_util_map_o_O := test -f $$TMP_O/util/map.o
test_make_util_pmu_bison_o_O := test -f $$TMP_O/util/pmu-bison.o
-test_default = test -x $(PERF)/perf
+test_default = test -x $(PERF_O)/perf
test = $(if $(test_$1),$(test_$1),$(test_default))
test_default_O = test -x $$TMP_O/perf
@@ -264,7 +266,7 @@ endif
MAKEFLAGS := --no-print-directory
-clean := @(cd $(PERF); make -s -f $(MK) clean >/dev/null)
+clean := @(cd $(PERF); make -s -f $(MK) O=$(PERF_O) clean >/dev/null)
$(run):
$(call clean)
@@ -293,17 +295,22 @@ tarpkg:
( eval $$cmd ) >> $@ 2>&1 && \
rm -f $@
+KERNEL_O := ../..
+ifneq ($(O),)
+ KERNEL_O := $(O)
+endif
+
make_kernelsrc:
@echo "- make -C <kernelsrc> $(PARALLEL_OPT) tools/perf"
$(call clean); \
(make -C ../.. $(PARALLEL_OPT) tools/perf) > $@ 2>&1 && \
- test -x perf && rm -f $@ || (cat $@ ; false)
+ test -x $(KERNEL_O)/tools/perf/perf && rm -f $@ || (cat $@ ; false)
make_kernelsrc_tools:
@echo "- make -C <kernelsrc>/tools $(PARALLEL_OPT) perf"
$(call clean); \
(make -C ../../tools $(PARALLEL_OPT) perf) > $@ 2>&1 && \
- test -x perf && rm -f $@ || (cat $@ ; false)
+ test -x $(KERNEL_O)/tools/perf/perf && rm -f $@ || (cat $@ ; false)
all: $(run) $(run_O) tarpkg make_kernelsrc make_kernelsrc_tools
@echo OK
--
1.8.3.4
[toc] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-01-14 16:00 +0100 |
| Subject | Re: [PATCH v2 3/9] perf build: Test correct path of perf in build-test |
| Message-ID | <qQRxx-8vf-33@gated-at.bofh.it> |
| In reply to | #1309270 |
Em Thu, Jan 14, 2016 at 01:13:57PM +0000, Wang Nan escreveu:
> If an 'O' is passed to 'make build-test', many 'test -x' and 'test -f'
> will fail because perf resides in a different directory. Fix this by
> computing PERF_OUT according to 'O' and test correct output files.
> For make_kernelsrc and make_kernelsrc_tools, set KBUILD_OUTPUT_DIR
> instead because the path is different from others ($(O)/perf vs
> $(O)/tools/perf).
So, before this patch:
[acme@felicio linux]$ make -C tools/perf -f tests/make make_static
make: Entering directory `/home/acme/git/linux/tools/perf'
Testing Makefile
make[1]: Entering directory `/home/acme/git/linux/tools/perf'
- make_static: cd . && make -f Makefile DESTDIR=/tmp/tmp.aCtpIoMBDZ LDFLAGS=-static
make[1]: Leaving directory `/home/acme/git/linux/tools/perf'
make: Leaving directory `/home/acme/git/linux/tools/perf'
[acme@felicio linux]$
after I applied it it was failing, but now, running just the 'make_static'
target, it works, oops, trying to run it as plain 'build-test', i.e. randomly
picking the targets and running them all...
Also note that I'm not using O= at all, trying to check first if it works
without it, to avoid introducing a regression.
Ok, failed again, I was lucky and it was the second test to run, it seems some
cleanup is not being done wrt the python binding...
$ make -C tools/perf build-test
make: Entering directory `/home/acme/git/linux/tools/perf'
Testing Makefile
- make_no_demangle: cd . && make -f Makefile DESTDIR=/tmp/tmp.OO1OfcvkFQ NO_DEMANGLE=1
- make_static: cd . && make -f Makefile DESTDIR=/tmp/tmp.jSd2VoICTE LDFLAGS=-static
cd . && make -f Makefile DESTDIR=/tmp/tmp.jSd2VoICTE LDFLAGS=-static
BUILD: Doing 'make -j4' parallel build
Auto-detecting system features:
... dwarf: [ on ]
... glibc: [ on ]
... gtk2: [ on ]
... libaudit: [ on ]
... libbfd: [ on ]
... libelf: [ on ]
... libnuma: [ on ]
... numa_num_possible_cpus: [ on ]
... libperl: [ on ]
... libpython: [ on ]
... libslang: [ on ]
... libunwind: [ on ]
... libdw-dwarf-unwind: [ on ]
... zlib: [ on ]
... lzma: [ on ]
... get_cpuid: [ on ]
... bpf: [ on ]
GEN common-cmds.h
PERF_VERSION = 4.4.ge0a5e17c
CC plugin_hrtimer.o
CC plugin_jbd2.o
CC plugin_kmem.o
LD plugin_jbd2-in.o
<SNIP>
CC tests/llvm.o
AR libperf.a
CC tests/bpf.o
CC tests/topology.o
CC tests/cpumap.o
CC tests/stat.o
CC tests/event_update.o
CC tests/dwarf-unwind.o
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtbeginT.o: relocation R_X86_64_32 against `__TMC_END__' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtbeginT.o: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
CC tests/llvm-src-base.o
cp: cannot stat ‘python_ext_build/lib/perf.so’: No such file or directory
make[4]: *** [python/perf.so] Error 1
make[4]: *** Waiting for unfinished jobs....
CC tests/llvm-src-kbuild.o
CC tests/llvm-src-prologue.o
CC perf.o
LD tests/perf-in.o
LD perf-in.o
make[4]: *** wait: No child processes. Stop.
make[3]: *** [all] Error 2
test: test -x ./perf
make[2]: *** [make_static] Error 1
make[1]: *** [all] Error 2
make: *** [build-test] Error 2
make: Leaving directory `/home/acme/git/linux/tools/perf'
[acme@felicio linux]$
- Arnaldo
> Signed-off-by: Wang Nan <wangnan0@huawei.com>
> Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
> Cc: Jiri Olsa <jolsa@kernel.org>
> Cc: Namhyung Kim <namhyung@kernel.org>
> ---
> tools/perf/tests/make | 23 +++++++++++++++--------
> 1 file changed, 15 insertions(+), 8 deletions(-)
>
> diff --git a/tools/perf/tests/make b/tools/perf/tests/make
> index 14d7b8d..e74c86b 100644
> --- a/tools/perf/tests/make
> +++ b/tools/perf/tests/make
> @@ -13,10 +13,12 @@ else
> endif
> else
> PERF := .
> +PERF_O := $(PERF)
> O_OPT :=
>
> ifneq ($(O),)
> FULL_O := $(shell readlink -f $(O) || echo $(O))
> + PERF_O := $(FULL_O)
> ifeq ($(SET_O),1)
> O_OPT := 'O=$(FULL_O)'
> endif
> @@ -173,11 +175,11 @@ test_make_doc := $(test_ok)
> test_make_help_O := $(test_ok)
> test_make_doc_O := $(test_ok)
>
> -test_make_python_perf_so := test -f $(PERF)/python/perf.so
> +test_make_python_perf_so := test -f $(PERF_O)/python/perf.so
>
> -test_make_perf_o := test -f $(PERF)/perf.o
> -test_make_util_map_o := test -f $(PERF)/util/map.o
> -test_make_util_pmu_bison_o := test -f $(PERF)/util/pmu-bison.o
> +test_make_perf_o := test -f $(PERF_O)/perf.o
> +test_make_util_map_o := test -f $(PERF_O)/util/map.o
> +test_make_util_pmu_bison_o := test -f $(PERF_O)/util/pmu-bison.o
>
> define test_dest_files
> for file in $(1); do \
> @@ -244,7 +246,7 @@ test_make_perf_o_O := test -f $$TMP_O/perf.o
> test_make_util_map_o_O := test -f $$TMP_O/util/map.o
> test_make_util_pmu_bison_o_O := test -f $$TMP_O/util/pmu-bison.o
>
> -test_default = test -x $(PERF)/perf
> +test_default = test -x $(PERF_O)/perf
> test = $(if $(test_$1),$(test_$1),$(test_default))
>
> test_default_O = test -x $$TMP_O/perf
> @@ -264,7 +266,7 @@ endif
>
> MAKEFLAGS := --no-print-directory
>
> -clean := @(cd $(PERF); make -s -f $(MK) clean >/dev/null)
> +clean := @(cd $(PERF); make -s -f $(MK) O=$(PERF_O) clean >/dev/null)
>
> $(run):
> $(call clean)
> @@ -293,17 +295,22 @@ tarpkg:
> ( eval $$cmd ) >> $@ 2>&1 && \
> rm -f $@
>
> +KERNEL_O := ../..
> +ifneq ($(O),)
> + KERNEL_O := $(O)
> +endif
> +
> make_kernelsrc:
> @echo "- make -C <kernelsrc> $(PARALLEL_OPT) tools/perf"
> $(call clean); \
> (make -C ../.. $(PARALLEL_OPT) tools/perf) > $@ 2>&1 && \
> - test -x perf && rm -f $@ || (cat $@ ; false)
> + test -x $(KERNEL_O)/tools/perf/perf && rm -f $@ || (cat $@ ; false)
>
> make_kernelsrc_tools:
> @echo "- make -C <kernelsrc>/tools $(PARALLEL_OPT) perf"
> $(call clean); \
> (make -C ../../tools $(PARALLEL_OPT) perf) > $@ 2>&1 && \
> - test -x perf && rm -f $@ || (cat $@ ; false)
> + test -x $(KERNEL_O)/tools/perf/perf && rm -f $@ || (cat $@ ; false)
>
> all: $(run) $(run_O) tarpkg make_kernelsrc make_kernelsrc_tools
> @echo OK
> --
> 1.8.3.4
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-01-14 16:00 +0100 |
| Subject | Re: [PATCH v2 3/9] perf build: Test correct path of perf in build-test |
| Message-ID | <qQRxx-8vf-41@gated-at.bofh.it> |
| In reply to | #1309357 |
Em Thu, Jan 14, 2016 at 11:50:21AM -0300, Arnaldo Carvalho de Melo escreveu: > Em Thu, Jan 14, 2016 at 01:13:57PM +0000, Wang Nan escreveu: > > If an 'O' is passed to 'make build-test', many 'test -x' and 'test -f' > > will fail because perf resides in a different directory. Fix this by > > computing PERF_OUT according to 'O' and test correct output files. > > For make_kernelsrc and make_kernelsrc_tools, set KBUILD_OUTPUT_DIR > > instead because the path is different from others ($(O)/perf vs > > $(O)/tools/perf). > > So, before this patch: Also, while trying to get this to work, I found these places lacking the O= prefixing, right? diff --git a/tools/perf/tests/make b/tools/perf/tests/make index e74c86b00c31..67842900482e 100644 --- a/tools/perf/tests/make +++ b/tools/perf/tests/make @@ -59,7 +59,7 @@ has = $(shell which $1 2>/dev/null) # standard single make variable specified make_clean_all := clean all -make_python_perf_so := python/perf.so +make_python_perf_so := $(PERF_O)/python/perf.so make_debug := DEBUG=1 make_no_libperl := NO_LIBPERL=1 make_no_libpython := NO_LIBPYTHON=1 @@ -82,9 +82,9 @@ make_tags := tags make_cscope := cscope make_help := help make_doc := doc -make_perf_o := perf.o -make_util_map_o := util/map.o -make_util_pmu_bison_o := util/pmu-bison.o +make_perf_o := $(PERF_O)/perf.o +make_util_map_o := $(PERF_O)/util/map.o +make_util_pmu_bison_o := $(PERF_O)/util/pmu-bison.o make_install := install make_install_bin := install-bin make_install_doc := install-doc
[toc] | [prev] | [next] | [standalone]
| From | pi3orama <pi3orama@163.com> |
|---|---|
| Date | 2016-01-14 16:10 +0100 |
| Message-ID | <qQRHc-nE-5@gated-at.bofh.it> |
| In reply to | #1309359 |
发自我的 iPhone > 在 2016年1月14日,下午10:58,Arnaldo Carvalho de Melo <acme@kernel.org> 写道: > > Em Thu, Jan 14, 2016 at 11:50:21AM -0300, Arnaldo Carvalho de Melo escreveu: >> Em Thu, Jan 14, 2016 at 01:13:57PM +0000, Wang Nan escreveu: >>> If an 'O' is passed to 'make build-test', many 'test -x' and 'test -f' >>> will fail because perf resides in a different directory. Fix this by >>> computing PERF_OUT according to 'O' and test correct output files. >>> For make_kernelsrc and make_kernelsrc_tools, set KBUILD_OUTPUT_DIR >>> instead because the path is different from others ($(O)/perf vs >>> $(O)/tools/perf). >> >> So, before this patch: > > Also, while trying to get this to work, I found these places lacking the > O= prefixing, right? > > > diff --git a/tools/perf/tests/make b/tools/perf/tests/make > index e74c86b00c31..67842900482e 100644 > --- a/tools/perf/tests/make > +++ b/tools/perf/tests/make > @@ -59,7 +59,7 @@ has = $(shell which $1 2>/dev/null) > > # standard single make variable specified > make_clean_all := clean all > -make_python_perf_so := python/perf.so > +make_python_perf_so := $(PERF_O)/python/perf.so > make_debug := DEBUG=1 > make_no_libperl := NO_LIBPERL=1 > make_no_libpython := NO_LIBPYTHON=1 > @@ -82,9 +82,9 @@ make_tags := tags > make_cscope := cscope > make_help := help > make_doc := doc > -make_perf_o := perf.o > -make_util_map_o := util/map.o > -make_util_pmu_bison_o := util/pmu-bison.o > +make_perf_o := $(PERF_O)/perf.o > +make_util_map_o := $(PERF_O)/util/map.o > +make_util_pmu_bison_o := $(PERF_O)/util/pmu-bison.o > make_install := install > make_install_bin := install-bin > make_install_doc := install-doc I have throughly tested this patch set, both with and without O, many times, and see no error related to this part of code, so I think we don't really need this prefix. But maybe there's error I never noticed. Let me check it tomorrow. Thank you.
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-01-14 16:50 +0100 |
| Subject | Re: [PATCH v2 3/9] perf build: Test correct path of perf in build-test |
| Message-ID | <qQSjT-Dz-1@gated-at.bofh.it> |
| In reply to | #1309363 |
Em Thu, Jan 14, 2016 at 11:08:11PM +0800, pi3orama escreveu: > > > 发自我的 iPhone > > > 在 2016年1月14日,下午10:58,Arnaldo Carvalho de Melo <acme@kernel.org> 写道: > > > > Em Thu, Jan 14, 2016 at 11:50:21AM -0300, Arnaldo Carvalho de Melo escreveu: > >> Em Thu, Jan 14, 2016 at 01:13:57PM +0000, Wang Nan escreveu: > >>> If an 'O' is passed to 'make build-test', many 'test -x' and 'test -f' > >>> will fail because perf resides in a different directory. Fix this by > >>> computing PERF_OUT according to 'O' and test correct output files. > >>> For make_kernelsrc and make_kernelsrc_tools, set KBUILD_OUTPUT_DIR > >>> instead because the path is different from others ($(O)/perf vs > >>> $(O)/tools/perf). > >> > >> So, before this patch: > > > > Also, while trying to get this to work, I found these places lacking the > > O= prefixing, right? > > > > > > diff --git a/tools/perf/tests/make b/tools/perf/tests/make > > index e74c86b00c31..67842900482e 100644 > > --- a/tools/perf/tests/make > > +++ b/tools/perf/tests/make > > @@ -59,7 +59,7 @@ has = $(shell which $1 2>/dev/null) > > > > # standard single make variable specified > > make_clean_all := clean all > > -make_python_perf_so := python/perf.so > > +make_python_perf_so := $(PERF_O)/python/perf.so > > make_debug := DEBUG=1 > > make_no_libperl := NO_LIBPERL=1 > > make_no_libpython := NO_LIBPYTHON=1 > > @@ -82,9 +82,9 @@ make_tags := tags > > make_cscope := cscope > > make_help := help > > make_doc := doc > > -make_perf_o := perf.o > > -make_util_map_o := util/map.o > > -make_util_pmu_bison_o := util/pmu-bison.o > > +make_perf_o := $(PERF_O)/perf.o > > +make_util_map_o := $(PERF_O)/util/map.o > > +make_util_pmu_bison_o := $(PERF_O)/util/pmu-bison.o > > make_install := install > > make_install_bin := install-bin > > make_install_doc := install-doc > > I have throughly tested this patch set, both > with and without O, many times, and see no > error related to this part of code, so I think > we don't really need this prefix. > > But maybe there's error I never noticed. > Let me check it tomorrow. Ok, but are you testing it patch after patch or just after all the patches in this series are applied? Here, with up to: I am getting 'make clean' related errors after some tests on a RHEL7.1 test machine: - make_no_libunwind: cd . && make -f Makefile DESTDIR=/tmp/tmp.CKrCzt1X85 NO_LIBUNWIND=1 find: ‘/home/acme/git/linux/tools/perf/tests/dso-data.o’: No such file or directory find: ‘/home/acme/git/linux/tools/perf/tests/.dso-data.o.cmd’: No such file or directory find: ‘/home/acme/git/linux/tools/perf/tests/pmu.o’: No such file or directory find: ‘/home/acme/git/linux/tools/perf/tests/sw-clock.o’: No such file or directory find: ‘/home/acme/git/linux/tools/perf/tests/.sample-parsing.o.cmd’: No such file or directory find: ‘/home/acme/git/linux/tools/perf/tests/attr.o’: No such file or directory - make_help: cd . && make -f Makefile DESTDIR=/tmp/tmp.9Gcw1OfooR help - make_no_slang: cd . && make -f Makefile DESTDIR=/tmp/tmp.Ce5PSg2snH NO_SLANG=1 And 'build-test' fails when it tries to run the 'make_static' target and that is not the first one to be run: - make_no_libelf: cd . && make -f Makefile DESTDIR=/tmp/tmp.tEwrxaQPOB NO_LIBELF=1 - make_no_libdw_dwarf_unwind: cd . && make -f Makefile DESTDIR=/tmp/tmp.4r7zlxeeAA NO_LIBDW_DWARF_UNWIND=1 - make_no_libnuma: cd . && make -f Makefile DESTDIR=/tmp/tmp.XuaZ3SACwX NO_LIBNUMA=1 - make_perf_o: cd . && make -f Makefile DESTDIR=/tmp/tmp.LXh3STdaiO perf.o - make_static: cd . && make -f Makefile DESTDIR=/tmp/tmp.xii2W5SLf2 LDFLAGS=-static cd . && make -f Makefile DESTDIR=/tmp/tmp.xii2W5SLf2 LDFLAGS=-static BUILD: Doing 'make -j4' parallel build Auto-detecting system features: ... dwarf: [ on ] ... glibc: [ on ] ... gtk2: [ on ] ... libaudit: [ on ] ... libbfd: [ on ] ... libelf: [ on ] ... libnuma: [ on ] ... numa_num_possible_cpus: [ on ] ... libperl: [ on ] ... libpython: [ on ] ... libslang: [ on ] ... libunwind: [ on ] ... libdw-dwarf-unwind: [ on ] ... zlib: [ on ] ... lzma: [ on ] ... get_cpuid: [ on ] ... bpf: [ on ] GEN common-cmds.h PERF_VERSION = 4.4.gbe874d2 CC plugin_hrtimer.o <SNIP> CC util/zlib.o CC util/lzma.o FLEX util/parse-events-flex.c FLEX util/pmu-flex.c CC util/pmu-bison.o CC util/parse-events.o CC util/parse-events-flex.o CC util/pmu.o CC util/pmu-flex.o LD util/libperf-in.o LD libperf-in.o AR libperf.a /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtbeginT.o: relocation R_X86_64_32 against `__TMC_END__' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtbeginT.o: could not read symbols: Bad value collect2: error: ld returned 1 exit status error: command 'gcc' failed with exit status 1 cp: cannot stat ‘python_ext_build/lib/perf.so’: No such file or directory make[4]: *** [python/perf.so] Error 1 make[3]: *** [all] Error 2 test: test -x ./perf make[2]: *** [make_static] Error 1 make[1]: *** [all] Error 2 make: *** [build-test] Error 2 make: Leaving directory `/home/acme/git/linux/tools/perf' ------------------- If I try it manually, in the source tree: [acme@felicio linux]$ cd tools/perf [acme@felicio perf]$ make LDFLAGS=-static BUILD: Doing 'make -j4' parallel build GEN libtraceevent-dynamic-list LINK libperf-gtk.so /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtbeginT.o: relocation R_X86_64_32 against `__TMC_END__' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtbeginT.o: could not read symbols: Bad value collect2: error: ld returned 1 exit status make[1]: *** [libperf-gtk.so] Error 1 make: *** [all] Error 2 [acme@felicio perf]$ And if I do a make clean and try again, it works: [acme@felicio perf]$ make clean CLEAN libtraceevent CLEAN libapi CLEAN libbpf CLEAN libsubcmd CLEAN libsubcmd CLEAN config CLEAN core-objs CLEAN core-progs CLEAN core-gen SUBDIR Documentation CLEAN Documentation CLEAN python [acme@felicio perf]$ make LDFLAGS=-static BUILD: Doing 'make -j4' parallel build Auto-detecting system features: ... dwarf: [ OFF ] ... glibc: [ on ] ... gtk2: [ OFF ] ... libaudit: [ OFF ] ... libbfd: [ OFF ] ... libelf: [ on ] ... libnuma: [ OFF ] ... numa_num_possible_cpus: [ OFF ] ... libperl: [ OFF ] ... libpython: [ OFF ] ... libslang: [ OFF ] ... libunwind: [ OFF ] ... libdw-dwarf-unwind: [ OFF ] ... zlib: [ OFF ] ... lzma: [ OFF ] ... get_cpuid: [ on ] ... bpf: [ on ] config/Makefile:268: No libdw DWARF unwind found, Please install elfutils-devel/libdw-dev >= 0.158 and/or set LIBDW_DIR config/Makefile:272: No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev config/Makefile:328: DWARF support is off, BPF prologue is disabled config/Makefile:342: No libunwind found. Please install libunwind-dev[el] >= 1.1 and/or set LIBUNWIND_DIR config/Makefile:360: Disabling post unwind, no support found. config/Makefile:401: No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev config/Makefile:416: slang not found, disables TUI support. Please install slang-devel or libslang-dev config/Makefile:430: GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev config/Makefile:458: Missing perl devel files. Disabling perl scripting support, please install perl-ExtUtils-Embed/libperl-dev config/Makefile:501: No 'Python.h' (for Python 2.x support) was found: disables Python support - please install python-devel/python-dev config/Makefile:562: No bfd.h/libbfd found, please install binutils-dev[el]/zlib-static/libiberty-dev to gain symbol demangling config/Makefile:591: No liblzma found, disables xz kernel module decompression, please install xz-devel/liblzma-dev config/Makefile:604: No numa.h found, disables 'perf bench numa mem' benchmark, please install numactl-devel/libnuma-devel/libnuma-dev GEN common-cmds.h CC util/abspath.o CC fd/array.o CC fs/fs.o CC util/alias.o CC fs/tracing_path.o PERF_VERSION = 4.4.gbe874d2 CC event-parse.o CC util/annotate.o <SNIP> CC tests/llvm-src-prologue.o LD tests/perf-in.o LD perf-in.o LD libperf-in.o AR libperf.a LINK perf /home/acme/git/linux/tools/lib/traceevent/libtraceevent.a(libtraceevent-in.o): In function `load_plugin': /home/acme/git/linux/tools/lib/traceevent/event-plugin.c:304: warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking libperf.a(libperf-in.o): In function `target__parse_uid': /home/acme/git/linux/tools/perf/util/target.c:79: warning: Using 'getpwnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /home/acme/git/linux/tools/perf/util/target.c:91: warning: Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libpthread.a(libpthread.o): In function `sem_open': (.text+0x682b): warning: the use of `mktemp' is dangerous, better use `mkstemp' [acme@felicio perf]$ Running it again I don't see those warnings, that are for things we should fix eventually for static builds but that are not problems related to what we're trying to fix here: [acme@felicio perf]$ make LDFLAGS=-static BUILD: Doing 'make -j4' parallel build Auto-detecting system features: ... dwarf: [ OFF ] ... glibc: [ on ] ... gtk2: [ OFF ] ... libaudit: [ OFF ] ... libbfd: [ OFF ] ... libelf: [ on ] ... libnuma: [ OFF ] ... numa_num_possible_cpus: [ OFF ] ... libperl: [ OFF ] ... libpython: [ OFF ] ... libslang: [ OFF ] ... libunwind: [ OFF ] ... libdw-dwarf-unwind: [ OFF ] ... zlib: [ OFF ] ... lzma: [ OFF ] ... get_cpuid: [ on ] ... bpf: [ on ] config/Makefile:268: No libdw DWARF unwind found, Please install elfutils-devel/libdw-dev >= 0.158 and/or set LIBDW_DIR config/Makefile:272: No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev config/Makefile:328: DWARF support is off, BPF prologue is disabled config/Makefile:342: No libunwind found. Please install libunwind-dev[el] >= 1.1 and/or set LIBUNWIND_DIR config/Makefile:360: Disabling post unwind, no support found. config/Makefile:401: No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev config/Makefile:416: slang not found, disables TUI support. Please install slang-devel or libslang-dev config/Makefile:430: GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev config/Makefile:458: Missing perl devel files. Disabling perl scripting support, please install perl-ExtUtils-Embed/libperl-dev config/Makefile:501: No 'Python.h' (for Python 2.x support) was found: disables Python support - please install python-devel/python-dev config/Makefile:562: No bfd.h/libbfd found, please install binutils-dev[el]/zlib-static/libiberty-dev to gain symbol demangling config/Makefile:591: No liblzma found, disables xz kernel module decompression, please install xz-devel/liblzma-dev config/Makefile:604: No numa.h found, disables 'perf bench numa mem' benchmark, please install numactl-devel/libnuma-devel/libnuma-dev [acme@felicio perf]$ - Arnaldo
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-01-14 17:10 +0100 |
| Subject | Re: [PATCH v2 3/9] perf build: Test correct path of perf in build-test |
| Message-ID | <qQSDg-10I-21@gated-at.bofh.it> |
| In reply to | #1309437 |
Em Thu, Jan 14, 2016 at 12:44:36PM -0300, Arnaldo Carvalho de Melo escreveu:
> If I try it manually, in the source tree:
>
> [acme@felicio linux]$ cd tools/perf
> [acme@felicio perf]$ make LDFLAGS=-static
> BUILD: Doing 'make -j4' parallel build
> GEN libtraceevent-dynamic-list
> LINK libperf-gtk.so
> /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtbeginT.o: relocation R_X86_64_32 against `__TMC_END__' can not be used when making a shared object; recompile with -fPIC
> /usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtbeginT.o: could not read symbols: Bad value
> collect2: error: ld returned 1 exit status
> make[1]: *** [libperf-gtk.so] Error 1
> make: *** [all] Error 2
> [acme@felicio perf]$
>
> And if I do a make clean and try again, it works:
[acme@felicio linux]$ git log --oneline -5
be874d2f8baa perf build: Test correct path of perf in build-test
dab97c905927 perf build: Pass O option to Makefile.perf in build-test
7d66631ea112 perf build: Set parallel making options build-test
69d5f8e92f05 perf symbols: Fix reading of build-id from vDSO
8bf78e69a277 perf kvm record/report: 'unprocessable sample' error while
recording/reporting guest data
[acme@felicio linux]$
So, with that hunch, I tried with the patch below and it finishes a
'make -C tools/perf build-test' run with no find .cmd errors not
'make_static' failures, investigating what is the problem with the
'clean' target when it gets a O= passed...
[acme@felicio linux]$ git diff
diff --git a/tools/perf/tests/make b/tools/perf/tests/make
index e74c86b00c31..baf8f0099507 100644
--- a/tools/perf/tests/make
+++ b/tools/perf/tests/make
@@ -266,7 +266,8 @@ endif
MAKEFLAGS := --no-print-directory
-clean := @(cd $(PERF); make -s -f $(MK) O=$(PERF_O) clean >/dev/null)
+#clean := @(cd $(PERF); make -s -f $(MK) O=$(PERF_O) clean >/dev/null)
+clean := @(cd $(PERF); make -s -f $(MK) clean >/dev/null)
$(run):
$(call clean)
[acme@felicio linux]$
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-01-14 18:40 +0100 |
| Subject | Re: [PATCH v2 3/9] perf build: Test correct path of perf in build-test |
| Message-ID | <qQU2l-1Oc-5@gated-at.bofh.it> |
| In reply to | #1309449 |
Em Thu, Jan 14, 2016 at 01:02:02PM -0300, Arnaldo Carvalho de Melo escreveu: > Em Thu, Jan 14, 2016 at 12:44:36PM -0300, Arnaldo Carvalho de Melo escreveu: > > If I try it manually, in the source tree: > > > > [acme@felicio linux]$ cd tools/perf > > [acme@felicio perf]$ make LDFLAGS=-static > > BUILD: Doing 'make -j4' parallel build > > GEN libtraceevent-dynamic-list > > LINK libperf-gtk.so > > /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtbeginT.o: relocation R_X86_64_32 against `__TMC_END__' can not be used when making a shared object; recompile with -fPIC > > /usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtbeginT.o: could not read symbols: Bad value > > collect2: error: ld returned 1 exit status > > make[1]: *** [libperf-gtk.so] Error 1 > > make: *** [all] Error 2 > > [acme@felicio perf]$ > > > > And if I do a make clean and try again, it works: > > [acme@felicio linux]$ git log --oneline -5 > be874d2f8baa perf build: Test correct path of perf in build-test > dab97c905927 perf build: Pass O option to Makefile.perf in build-test > 7d66631ea112 perf build: Set parallel making options build-test > 69d5f8e92f05 perf symbols: Fix reading of build-id from vDSO > 8bf78e69a277 perf kvm record/report: 'unprocessable sample' error while > recording/reporting guest data > [acme@felicio linux]$ > > So, with that hunch, I tried with the patch below and it finishes a > 'make -C tools/perf build-test' run with no find .cmd errors not > 'make_static' failures, investigating what is the problem with the > 'clean' target when it gets a O= passed... So, this seems to do the trick, is it right? diff --git a/tools/perf/tests/make b/tools/perf/tests/make index e74c86b00c31..29810cf2c117 100644 --- a/tools/perf/tests/make +++ b/tools/perf/tests/make @@ -266,7 +266,7 @@ endif MAKEFLAGS := --no-print-directory -clean := @(cd $(PERF); make -s -f $(MK) O=$(PERF_O) clean >/dev/null) +clean := @(cd $(PERF); make -s -f $(MK) $(O_OPT) clean >/dev/null) $(run): $(call clean) > [acme@felicio linux]$ git diff > diff --git a/tools/perf/tests/make b/tools/perf/tests/make > index e74c86b00c31..baf8f0099507 100644 > --- a/tools/perf/tests/make > +++ b/tools/perf/tests/make > @@ -266,7 +266,8 @@ endif > > MAKEFLAGS := --no-print-directory > > -clean := @(cd $(PERF); make -s -f $(MK) O=$(PERF_O) clean >/dev/null) > +#clean := @(cd $(PERF); make -s -f $(MK) O=$(PERF_O) clean >/dev/null) > +clean := @(cd $(PERF); make -s -f $(MK) clean >/dev/null) > > $(run): > $(call clean) > [acme@felicio linux]$ >
[toc] | [prev] | [next] | [standalone]
| From | "Wangnan (F)" <wangnan0@huawei.com> |
|---|---|
| Date | 2016-01-15 04:00 +0100 |
| Message-ID | <qR2Mi-85x-13@gated-at.bofh.it> |
| In reply to | #1309437 |
On 2016/1/14 23:44, Arnaldo Carvalho de Melo wrote: > Em Thu, Jan 14, 2016 at 11:08:11PM +0800, pi3orama escreveu: >> >> 发自我的 iPhone >> >>> 在 2016年1月14日,下午10:58,Arnaldo Carvalho de Melo <acme@kernel.org> 写道: >>> >>> Em Thu, Jan 14, 2016 at 11:50:21AM -0300, Arnaldo Carvalho de Melo escreveu: >>>> Em Thu, Jan 14, 2016 at 01:13:57PM +0000, Wang Nan escreveu: >>>>> If an 'O' is passed to 'make build-test', many 'test -x' and 'test -f' >>>>> will fail because perf resides in a different directory. Fix this by >>>>> computing PERF_OUT according to 'O' and test correct output files. >>>>> For make_kernelsrc and make_kernelsrc_tools, set KBUILD_OUTPUT_DIR >>>>> instead because the path is different from others ($(O)/perf vs >>>>> $(O)/tools/perf). >>>> So, before this patch: >>> Also, while trying to get this to work, I found these places lacking the >>> O= prefixing, right? >>> >>> >>> diff --git a/tools/perf/tests/make b/tools/perf/tests/make >>> index e74c86b00c31..67842900482e 100644 >>> --- a/tools/perf/tests/make >>> +++ b/tools/perf/tests/make >>> @@ -59,7 +59,7 @@ has = $(shell which $1 2>/dev/null) >>> >>> # standard single make variable specified >>> make_clean_all := clean all >>> -make_python_perf_so := python/perf.so >>> +make_python_perf_so := $(PERF_O)/python/perf.so >>> make_debug := DEBUG=1 >>> make_no_libperl := NO_LIBPERL=1 >>> make_no_libpython := NO_LIBPYTHON=1 >>> @@ -82,9 +82,9 @@ make_tags := tags >>> make_cscope := cscope >>> make_help := help >>> make_doc := doc >>> -make_perf_o := perf.o >>> -make_util_map_o := util/map.o >>> -make_util_pmu_bison_o := util/pmu-bison.o >>> +make_perf_o := $(PERF_O)/perf.o >>> +make_util_map_o := $(PERF_O)/util/map.o >>> +make_util_pmu_bison_o := $(PERF_O)/util/pmu-bison.o >>> make_install := install >>> make_install_bin := install-bin >>> make_install_doc := install-doc >> I have throughly tested this patch set, both >> with and without O, many times, and see no >> error related to this part of code, so I think >> we don't really need this prefix. >> >> But maybe there's error I never noticed. >> Let me check it tomorrow. > Ok, but are you testing it patch after patch or just after all the > patches in this series are applied? > > Here, with up to: > > > I am getting 'make clean' related errors after some tests on a RHEL7.1 > test machine: > > - make_no_libunwind: cd . && make -f Makefile DESTDIR=/tmp/tmp.CKrCzt1X85 NO_LIBUNWIND=1 > find: ‘/home/acme/git/linux/tools/perf/tests/dso-data.o’: No such file or directory > find: ‘/home/acme/git/linux/tools/perf/tests/.dso-data.o.cmd’: No such file or directory > find: ‘/home/acme/git/linux/tools/perf/tests/pmu.o’: No such file or directory > find: ‘/home/acme/git/linux/tools/perf/tests/sw-clock.o’: No such file or directory > find: ‘/home/acme/git/linux/tools/perf/tests/.sample-parsing.o.cmd’: No such file or directory > find: ‘/home/acme/git/linux/tools/perf/tests/attr.o’: No such file or directory > - make_help: cd . && make -f Makefile DESTDIR=/tmp/tmp.9Gcw1OfooR help > - make_no_slang: cd . && make -f Makefile DESTDIR=/tmp/tmp.Ce5PSg2snH NO_SLANG=1 > > And 'build-test' fails when it tries to run the 'make_static' target and that > is not the first one to be run: > > - make_no_libelf: cd . && make -f Makefile DESTDIR=/tmp/tmp.tEwrxaQPOB NO_LIBELF=1 > - make_no_libdw_dwarf_unwind: cd . && make -f Makefile DESTDIR=/tmp/tmp.4r7zlxeeAA NO_LIBDW_DWARF_UNWIND=1 > - make_no_libnuma: cd . && make -f Makefile DESTDIR=/tmp/tmp.XuaZ3SACwX NO_LIBNUMA=1 > - make_perf_o: cd . && make -f Makefile DESTDIR=/tmp/tmp.LXh3STdaiO perf.o > - make_static: cd . && make -f Makefile DESTDIR=/tmp/tmp.xii2W5SLf2 LDFLAGS=-static > cd . && make -f Makefile DESTDIR=/tmp/tmp.xii2W5SLf2 LDFLAGS=-static > BUILD: Doing 'make -j4' parallel build > > Auto-detecting system features: > ... dwarf: [ on ] > ... glibc: [ on ] > ... gtk2: [ on ] > ... libaudit: [ on ] > ... libbfd: [ on ] > ... libelf: [ on ] > ... libnuma: [ on ] > ... numa_num_possible_cpus: [ on ] > ... libperl: [ on ] > ... libpython: [ on ] > ... libslang: [ on ] > ... libunwind: [ on ] > ... libdw-dwarf-unwind: [ on ] > ... zlib: [ on ] > ... lzma: [ on ] > ... get_cpuid: [ on ] > ... bpf: [ on ] Look at this feature detection result. > Auto-detecting system features: > ... dwarf: [ OFF ] > ... glibc: [ on ] > ... gtk2: [ OFF ] > ... libaudit: [ OFF ] > ... libbfd: [ OFF ] > ... libelf: [ on ] > ... libnuma: [ OFF ] > ... numa_num_possible_cpus: [ OFF ] > ... libperl: [ OFF ] > ... libpython: [ OFF ] > ... libslang: [ OFF ] > ... libunwind: [ OFF ] > ... libdw-dwarf-unwind: [ OFF ] > ... zlib: [ OFF ] > ... lzma: [ OFF ] > ... get_cpuid: [ on ] > ... bpf: [ on ] And this one. They are different. I reproduced this error in my environment. The reason is: if we use 'make clean O=something', the 'bin' files created by feature testing won't be removed. Not related to my work. Here I give an example: tools/perf> make clean tools/perf> make BUILD: Doing 'make -j24' parallel build Auto-detecting system features: ... dwarf: [ on ] ... glibc: [ on ] ... gtk2: [ OFF ] ... libaudit: [ OFF ] ... libbfd: [ OFF ] ... libelf: [ on ] ... libnuma: [ OFF ] ... numa_num_possible_cpus: [ OFF ] ... libperl: [ on ] ... libpython: [ on ] ... libslang: [ OFF ] ... libunwind: [ OFF ] ... libdw-dwarf-unwind: [ on ] ... zlib: [ on ] ... lzma: [ on ] ... get_cpuid: [ on ] ... bpf: [ on ] <SNIP> tools/perf> make clean O=. tools/perf> make LDFLAGS='-static' BUILD: Doing 'make -j24' parallel build Auto-detecting system features: ... dwarf: [ on ] ... glibc: [ on ] ... gtk2: [ OFF ] ... libaudit: [ OFF ] ... libbfd: [ OFF ] ... libelf: [ on ] ... libnuma: [ OFF ] ... numa_num_possible_cpus: [ OFF ] ... libperl: [ on ] ... libpython: [ on ] ... libslang: [ OFF ] ... libunwind: [ OFF ] ... libdw-dwarf-unwind: [ on ] ... zlib: [ on ] ... lzma: [ on ] ... get_cpuid: [ on ] ... bpf: [ on ] config/Makefile:342: No libunwind found. Please install libunwind-dev[el] >= 1.1 and/or set LIBUNWIND_DIR config/Makefile:401: No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev config/Makefile:416: slang not found, disables TUI support. Please install slang-devel or libslang-dev config/Makefile:430: GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev config/Makefile:562: No bfd.h/libbfd found, please install binutils-dev[el]/zlib-static/libiberty-dev to gain symbol demangling config/Makefile:604: No numa.h found, disables 'perf bench numa mem' benchmark, please install numactl-devel/libnuma-devel/libnuma-dev ... /home/w00229757/kernel-hydrogen/tools/lib/traceevent/libtraceevent.a(libtraceevent-in.o): In function `load_plugin': /home/w00229757/kernel-hydrogen/tools/lib/traceevent/event-plugin.c:304: warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /tmp/oxygen_root-w00229757/usr/bin/../lib64/gcc/x86_64-oe-linux/4.8.1/../../../../x86_64-oe-linux/bin/ld: cannot find -llzma /tmp/oxygen_root-w00229757/usr/bin/../lib64/gcc/x86_64-oe-linux/4.8.1/../../../../x86_64-oe-linux/bin/ld: cannot find -lperl libperf.a(libperf-in.o): In function `target__parse_uid': /home/w00229757/kernel-hydrogen/tools/perf/util/target.c:79: warning: Using 'getpwnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /home/w00229757/kernel-hydrogen/tools/perf/util/target.c:91: warning: Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /tmp/oxygen_root-w00229757/usr/bin/../lib64/gcc/x86_64-oe-linux/4.8.1/../../../../x86_64-oe-linux/bin/ld: cannot find -llzma collect2: error: ld returned 1 exit status ... Result of feature testing is similar. tools/perf> make clean tools/perf> make LDFLAGS='-static' BUILD: Doing 'make -j24' parallel build Auto-detecting system features: ... dwarf: [ OFF ] ... glibc: [ on ] ... gtk2: [ OFF ] ... libaudit: [ OFF ] ... libbfd: [ OFF ] ... libelf: [ on ] ... libnuma: [ OFF ] ... numa_num_possible_cpus: [ OFF ] ... libperl: [ OFF ] ... libpython: [ OFF ] ... libslang: [ OFF ] ... libunwind: [ OFF ] ... libdw-dwarf-unwind: [ OFF ] ... zlib: [ on ] ... lzma: [ OFF ] ... get_cpuid: [ on ] ... bpf: [ on ] ... Good result. Look at [1]. Here's a similar problem I reported to Jiri. Concultion: the reason of the problem you met is because 'make clean O=.' doesn't clean feature test results. In v1 I have: -clean := @(cd $(PERF); make -s -f $(MK) clean >/dev/null) +clean := @(cd $(PERF); make -s -f $(MK) O=$(PERF_OUT) clean >/dev/null; make -s -f $(MK) clean >/dev/null) (two 'make clean' here for safety) But removes them in v2. The second 'make clean' would remove any feature testing results and return good testing result for you. This also explain why I never met failure like this: if patch 4 - 9 are applied, make static would use feature dump. Let me see how to remove feature testing results. [1] http://lkml.kernel.org/g/5694C73C.3070007@huawei.com
[toc] | [prev] | [next] | [standalone]
| From | "Wangnan (F)" <wangnan0@huawei.com> |
|---|---|
| Date | 2016-01-15 04:40 +0100 |
| Message-ID | <qR3oZ-dt-7@gated-at.bofh.it> |
| In reply to | #1309839 |
On 2016/1/15 10:57, Wangnan (F) wrote:
>
>
[SNIP]
>
> Concultion: the reason of the problem you met is because 'make clean
> O=.' doesn't clean
> feature test results. In v1 I have:
>
> -clean := @(cd $(PERF); make -s -f $(MK) clean >/dev/null)
> +clean := @(cd $(PERF); make -s -f $(MK) O=$(PERF_OUT) clean
> >/dev/null; make -s -f $(MK) clean >/dev/null)
>
> (two 'make clean' here for safety)
>
> But removes them in v2. The second 'make clean' would remove any
> feature testing
> results and return good testing result for you. This also explain why
> I never met failure
> like this: if patch 4 - 9 are applied, make static would use feature
> dump.
>
> Let me see how to remove feature testing results.
Here:
config-clean:
$(call QUIET_CLEAN, config)
$(Q)$(MAKE) -C $(srctree)/tools/build/feature/ $(if
$(OUTPUT),OUTPUT=$(OUTPUT)feature/,) clean >/dev/null
If we build with 'O', feature test directory would reside in
$(OUTPUT)/feature. Then when
we 'make clean', the resuling .bin files are removed from
$(OUTPUT)/feature. However, if we
build without 'O' but clean with 'O=.', make clean tries to remove
./feature, but should be
../build/feature.
Thank you.
[toc] | [prev] | [next] | [standalone]
| From | "Wangnan (F)" <wangnan0@huawei.com> |
|---|---|
| Date | 2016-01-15 03:30 +0100 |
| Message-ID | <qR2jf-7U0-5@gated-at.bofh.it> |
| In reply to | #1309359 |
On 2016/1/14 22:58, Arnaldo Carvalho de Melo wrote:
> Em Thu, Jan 14, 2016 at 11:50:21AM -0300, Arnaldo Carvalho de Melo escreveu:
>> Em Thu, Jan 14, 2016 at 01:13:57PM +0000, Wang Nan escreveu:
>>> If an 'O' is passed to 'make build-test', many 'test -x' and 'test -f'
>>> will fail because perf resides in a different directory. Fix this by
>>> computing PERF_OUT according to 'O' and test correct output files.
>>> For make_kernelsrc and make_kernelsrc_tools, set KBUILD_OUTPUT_DIR
>>> instead because the path is different from others ($(O)/perf vs
>>> $(O)/tools/perf).
>> So, before this patch:
> Also, while trying to get this to work, I found these places lacking the
> O= prefixing, right?
>
>
> diff --git a/tools/perf/tests/make b/tools/perf/tests/make
> index e74c86b00c31..67842900482e 100644
> --- a/tools/perf/tests/make
> +++ b/tools/perf/tests/make
> @@ -59,7 +59,7 @@ has = $(shell which $1 2>/dev/null)
>
> # standard single make variable specified
> make_clean_all := clean all
> -make_python_perf_so := python/perf.so
> +make_python_perf_so := $(PERF_O)/python/perf.so
> make_debug := DEBUG=1
> make_no_libperl := NO_LIBPERL=1
> make_no_libpython := NO_LIBPYTHON=1
> @@ -82,9 +82,9 @@ make_tags := tags
> make_cscope := cscope
> make_help := help
> make_doc := doc
> -make_perf_o := perf.o
> -make_util_map_o := util/map.o
> -make_util_pmu_bison_o := util/pmu-bison.o
> +make_perf_o := $(PERF_O)/perf.o
> +make_util_map_o := $(PERF_O)/util/map.o
> +make_util_pmu_bison_o := $(PERF_O)/util/pmu-bison.o
> make_install := install
> make_install_bin := install-bin
> make_install_doc := install-doc
Rechecked. As a make target we don't need this prefix:
Don't allow writing at every directories:
$ find -type d -exec chmod 555 {} \;
$ touch ddd
touch: cannot touch ‘ddd’: Permission denied
$ make -C perf python/perf.so
make: Entering directory `/home/wangnan/kernel-hydrogen/tools/perf'
BUILD: Doing 'make -j24' parallel build
/bin/sh: .config-detected: Permission denied
...
config/Makefile:261: *** No gnu/libc-version.h found, please install
glibc-dev[el]. Stop.
make: *** [python/perf.so] Error 2
make: Leaving directory `/home/wangnan/kernel-hydrogen/tools/perf'
Then use python/perf.so as make target:
$ make -C perf python/perf.so O=/tmp/xxxxx
make: Entering directory `/home/w00229757/kernel-hydrogen/tools/perf'
BUILD: Doing 'make -j24' parallel build
Auto-detecting system features:
... dwarf: [ on ]
... glibc: [ on ]
... gtk2: [ OFF ]
... libaudit: [ OFF ]
... libbfd: [ OFF ]
... libelf: [ on ]
... libnuma: [ OFF ]
... numa_num_possible_cpus: [ OFF ]
... libperl: [ on ]
... libpython: [ on ]
... libslang: [ OFF ]
... libunwind: [ OFF ]
... libdw-dwarf-unwind: [ on ]
... zlib: [ on ]
... lzma: [ on ]
... get_cpuid: [ on ]
... bpf: [ on ]
...
LD /tmp/xxxxx/fd/libapi-in.o
GEN /tmp/xxxxx/libtraceevent-dynamic-list
LD /tmp/xxxxx/fs/libapi-in.o
LD /tmp/xxxxx/libapi-in.o
AR /tmp/xxxxx/libapi.a
LD /tmp/xxxxx/libtraceevent-in.o
LINK /tmp/xxxxx/libtraceevent.a
GEN /tmp/xxxxx/python/perf.so
make: Leaving directory `/home/wangnan/kernel-hydrogen/tools/perf'
Adding the prefix also works it.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web