Re: perf build broken in 5.1-rc7

From: Thomas Backlund
Date: Wed May 01 2019 - 02:43:02 EST



Den 01-05-2019 kl. 06:37, skrev Song Liu:
On Tue, Apr 30, 2019 at 6:31 AM Thomas Backlund <tmb@xxxxxxxxxx> wrote:

Den 30-04-2019 kl. 16:06, skrev Song Liu:
On Tue, Apr 30, 2019 at 12:55 AM Thomas Backlund <tmb@xxxxxxxxxx> wrote:
Den 30-04-2019 kl. 10:26, skrev Thomas Backlund:
Building perf in 5.1-rc5/6/7 fails:


Build start:


make -s -C tools/perf NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1
WERROR=0 NO_LIBUNWIND=1 HAVE_CPLUS_DEMANGLE=1 NO_GTK2=1 NO_STRLCPY=1
NO_BIONIC=1 NO_JVMTI=1 prefix=/usr lib=lib64 all
BUILD: Doing 'make -j32' parallel build
HOSTCC fixdep.o
HOSTLD fixdep-in.o
LINK fixdep
Warning: Kernel ABI header at 'tools/arch/x86/include/uapi/asm/vmx.h'
differs from latest version at 'arch/x86/include/uapi/asm/vmx.h'
diff -u tools/arch/x86/include/uapi/asm/vmx.h
arch/x86/include/uapi/asm/vmx.h

Auto-detecting system features:
... dwarf: [ on ]
... dwarf_getlocations: [ on ]
... glibc: [ on ]
... gtk2: [ on ]
... libaudit: [ on ]
... libbfd: [ on ]
... libelf: [ on ]
... libnuma: [ on ]
... numa_num_possible_cpus: [ on ]
... libperl: [ on ]
... libpython: [ on ]
... libslang: [ on ]
... libcrypto: [ on ]
... libunwind: [ on ]
... libdw-dwarf-unwind: [ on ]
... zlib: [ on ]
... lzma: [ on ]
... get_cpuid: [ on ]
... bpf: [ on ]
... libaio: [ on ]
... disassembler-four-args: [ OFF ]

Makefile.config:473: No sys/sdt.h found, no SDT events are defined,
please install systemtap-sdt-devel or systemtap-sdt-dev
Makefile.config:853: No libbabeltrace found, disables 'perf data' CTF
format support, please install libbabeltrace-dev[el]/libbabeltrace-ctf-dev


And breaks with:


CC ui/setup.o
util/annotate.c: In function 'symbol__disassemble_bpf':
util/annotate.c:1767:29: error: incompatible type for argument 1 of
'disassembler'
disassemble = disassembler(bfdf);
^~~~
In file included from util/annotate.c:1689:
/usr/include/dis-asm.h:325:63: note: expected 'enum bfd_architecture'
but argument is of type 'bfd *' {aka 'struct bfd *'}
extern disassembler_ftype disassembler (enum bfd_architecture arc,
~~~~~~~~~~~~~~~~~~~~~~^~~
util/annotate.c:1767:16: error: too few arguments to function
'disassembler'
disassemble = disassembler(bfdf);
^~~~~~~~~~~~
In file included from util/annotate.c:1689:
/usr/include/dis-asm.h:325:27: note: declared here
extern disassembler_ftype disassembler (enum bfd_architecture arc,
^~~~~~~~~~~~
CC arch/x86/util/header.o
CC arch/x86/util/tsc.o
CC arch/x86/util/pmu.o
mv: cannot stat 'util/.annotate.o.tmp': No such file or directory
CC bench/futex-requeue.o
CC arch/x86/util/kvm-stat.o
make[4]: ***
[/work/rpmbuild/BUILD/kernel-x86_64/linux-5.0/tools/build/Makefile.build:97:
util/annotate.o] Error 1
make[4]: *** Waiting for unfinished jobs....
CC util/build-id.o



And I forgot...

Reverting:
From 6987561c9e86eace45f2dbb0c564964a63f4150a Mon Sep 17 00:00:00 2001
From: Song Liu <songliubraving@xxxxxx>
Date: Mon, 11 Mar 2019 22:30:48 -0700
Subject: perf annotate: Enable annotation of BPF programs

Makes it build again.

--
Thomas

Hi Thomas,

Which system are you running this test on? I would like to repro it in a VM.

Thanks,
Song

Mageia Cauldron currently stabilizing to become Mageia 7 in ~1 month.


Basesystem is:

binutils-2.32-5.mga7
(includes all fixes from upstream binutils-2_32-branch)

gcc-8.3.1-0.20190419.2.mga7

glibc-2.29-7.mga7
(includes all fixes from upstream glibc release/2.29/master branch up to
2019-04-15 for now)


kernel-desktop-5.1.0-0.rc7.1.mga7
kernel-userspace-headers-5.1.0-0.rc7.1.mga7


--

Thomas


I am trying to install Mageia 7 beta 3, but hit some issue. While I try fix it,
could you please try clean everything under tools/ and retry:

make -C tools/ clean
make -C tools/perf -j


Still fails:

util/annotate.c: In function 'symbol__disassemble_bpf':
util/annotate.c:1767:29: error: incompatible type for argument 1 of 'disassembler'
 disassemble = disassembler(bfdf);
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ ^~~~
In file included from util/annotate.c:1689:
/usr/include/dis-asm.h:325:63: note: expected 'enum bfd_architecture' but argument is of type 'bfd *' {aka 'struct bfd *'}
Âextern disassembler_ftype disassembler (enum bfd_architecture arc,
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ ~~~~~~~~~~~~~~~~~~~~~~^~~
util/annotate.c:1767:16: error: too few arguments to function 'disassembler'
 disassemble = disassembler(bfdf);
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ ^~~~~~~~~~~~
In file included from util/annotate.c:1689:
/usr/include/dis-asm.h:325:27: note: declared here
Âextern disassembler_ftype disassembler (enum bfd_architecture arc,
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ ^~~~~~~~~~~~
 CC scripts/python/Perf-Trace-Util/Context.o
 CC bench/mem-memcpy-x86-64-lib.o
 CC tests/parse-events.o
 CC util/block-range.o
mv: cannot stat 'util/.annotate.o.tmp': No such file or directory
make[4]: *** [/work/5.1/linux-5.1-rc7-mga07/tools/build/Makefile.build:97: util/annotate.o] Error 1
make[4]: *** Waiting for unfinished jobs....
 CC ui/util.o


If it still fails, how about building bpftool?

make -C tools/bpf -j


Also fails:


Auto-detecting system features:
... libbfd: [ on ]
...ÂÂÂÂÂÂÂ disassembler-four-args: [ OFF ]

 CC bpf_jit_disasm.o
 CC bpf_dbg.o
 CC bpf_asm.o
 BISON bpf_exp.yacc.c
 DESCEND bpftool
make[1]: Entering directory '/work/5.1/linux-5.1-rc7-mga07/tools/bpf/bpftool'
/work/5.1/linux-5.1-rc7-mga07/tools/bpf/bpf_jit_disasm.c: In function 'get_asm_insns':
/work/5.1/linux-5.1-rc7-mga07/tools/bpf/bpf_jit_disasm.c:81:29: error: incompatible type for argument 1 of 'disassembler'
 disassemble = disassembler(bfdf);
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ ^~~~
In file included from /work/5.1/linux-5.1-rc7-mga07/tools/bpf/bpf_jit_disasm.c:24:
/usr/include/dis-asm.h:325:63: note: expected 'enum bfd_architecture' but argument is of type 'bfd *' {aka 'struct bfd *'}
Âextern disassembler_ftype disassembler (enum bfd_architecture arc,
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ ~~~~~~~~~~~~~~~~~~~~~~^~~
/work/5.1/linux-5.1-rc7-mga07/tools/bpf/bpf_jit_disasm.c:81:16: error: too few arguments to function 'disassembler'
 disassemble = disassembler(bfdf);
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ ^~~~~~~~~~~~
In file included from /work/5.1/linux-5.1-rc7-mga07/tools/bpf/bpf_jit_disasm.c:24:
/usr/include/dis-asm.h:325:27: note: declared here
Âextern disassembler_ftype disassembler (enum bfd_architecture arc,
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ ^~~~~~~~~~~~
make: *** [Makefile:57: bpf_jit_disasm.o] Error 1
make: *** Waiting for unfinished jobs....



So is this a bug in feature misdetection?


In your commit message you state:

"And making all this dependent on HAVE_LIBBFD_SUPPORT and
HAVE_LIBBPF_SUPPORT:"


Now we obviously have libbfd.

But if the HAVE_LIBBPF_SUPPORT means tools/lib/bpf, then I havent packaged that yet, so why is it detecting it as available ?


--

Thomas