All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: pi3orama <pi3orama@163.com>
Cc: Wang Nan <wangnan0@huawei.com>,
	jolsa@redhat.com, linux-kernel@vger.kernel.org,
	lizefan@huawei.com, Jiri Olsa <jolsa@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>
Subject: Re: [PATCH v2 3/9] perf build: Test correct path of perf in build-test
Date: Thu, 14 Jan 2016 12:44:36 -0300	[thread overview]
Message-ID: <20160114154436.GV18367@kernel.org> (raw)
In-Reply-To: <55C8AD45-4C6F-454E-A0E9-4BCF769EE74E@163.com>

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

  reply	other threads:[~2016-01-14 15:44 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-14 13:13 [PATCH v2 0/9] perf build: Make build-test faster Wang Nan
2016-01-14 13:13 ` [PATCH v2 1/9] perf build: Set parallel making options build-test Wang Nan
2016-01-14 13:13 ` [PATCH v2 2/9] perf build: Pass O option to Makefile.perf in build-test Wang Nan
2016-01-14 13:13 ` [PATCH v2 3/9] perf build: Test correct path of perf " Wang Nan
2016-01-14 14:50   ` Arnaldo Carvalho de Melo
2016-01-14 14:58     ` Arnaldo Carvalho de Melo
2016-01-14 15:08       ` pi3orama
2016-01-14 15:44         ` Arnaldo Carvalho de Melo [this message]
2016-01-14 16:02           ` Arnaldo Carvalho de Melo
2016-01-14 17:32             ` Arnaldo Carvalho de Melo
2016-01-15  2:57           ` Wangnan (F)
2016-01-15  3:32             ` Wangnan (F)
2016-01-15  2:22       ` Wangnan (F)
2016-01-14 13:13 ` [PATCH v2 4/9] perf build: Pass O option to kernel makefile " Wang Nan
2016-01-14 13:13 ` [PATCH v2 5/9] perf build: Add feature-dump target Wang Nan
2016-01-14 13:14 ` [PATCH v2 6/9] perf build: Introduce FEATURES_DUMP make variable Wang Nan
2016-01-14 13:14 ` [PATCH v2 7/9] tools build: Allow subprojects select all feature checkers Wang Nan
2016-01-14 13:14 ` [PATCH v2 8/9] perf build: Select all feature checkers for feature-dump Wang Nan
2016-01-14 13:14 ` [PATCH v2 9/9] perf build: Use feature dump file for build-test Wang Nan

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=20160114154436.GV18367@kernel.org \
    --to=acme@kernel.org \
    --cc=jolsa@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=namhyung@kernel.org \
    --cc=pi3orama@163.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.