linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: build failure after merge of the perf tree
@ 2024-04-01 22:41 Stephen Rothwell
  2024-04-02 20:17 ` Arnaldo Carvalho de Melo
  2024-04-12 15:22 ` Arnaldo Carvalho de Melo
  0 siblings, 2 replies; 57+ messages in thread
From: Stephen Rothwell @ 2024-04-01 22:41 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Namhyung Kim
  Cc: Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 711 bytes --]

Hi all,

After merging the perf tree, today's linux-next build (native i.e. ppc64le
perf) failed like this:

make[3]: *** No rule to make target '/home/sfr/next/next/tools/include/uapi/linux/stat.h', needed by '/home/sfr/next/perf/libbpf/staticobjs/libbpf.o'.  Stop.

Maybe caused by commit

  f122b3d6d179 ("perf beauty: Introduce scrape script for the 'statx' syscall 'mask' argument")

or

  a672af9139a8 ("tools headers: Remove almost unused copy of uapi/stat.h, add few conditional defines")

or a combination of them?

This is an incremental build but doing 'make -C tools/perf clean' and then
rebuilding works, so maybe there is a dependency missing?

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2024-04-01 22:41 linux-next: build failure after merge of the perf tree Stephen Rothwell
@ 2024-04-02 20:17 ` Arnaldo Carvalho de Melo
  2024-04-12 15:22 ` Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 57+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-04-02 20:17 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Arnaldo Carvalho de Melo, Namhyung Kim, Ian Rogers,
	Linux Kernel Mailing List, Linux Next Mailing List

On Tue, Apr 02, 2024 at 09:41:16AM +1100, Stephen Rothwell wrote:
> Hi all,
> 
> After merging the perf tree, today's linux-next build (native i.e. ppc64le
> perf) failed like this:
> 
> make[3]: *** No rule to make target '/home/sfr/next/next/tools/include/uapi/linux/stat.h', needed by '/home/sfr/next/perf/libbpf/staticobjs/libbpf.o'.  Stop.
> 
> Maybe caused by commit
> 
>   f122b3d6d179 ("perf beauty: Introduce scrape script for the 'statx' syscall 'mask' argument")
> 
> or
> 
>   a672af9139a8 ("tools headers: Remove almost unused copy of uapi/stat.h, add few conditional defines")
> 
> or a combination of them?

Right, these are headers that were used to extract string tables but
were added to a directory that was also used to build tools, sometimes
because headers contained new defines that wouldn't be available in
older distros.

We're trying to move things that are needed just for creating string
tables to a separate directory, as done in the second cset you mentioned
above, how to do it in a way that is noticed by the dependency files
cached by the tools build processes is what is needed here.

I planned to investigate and fix this, but this was preventing
development work to proceed as 6.9-rc was released, so I ended up moving
these to perf-tools-next, I'll try again to investigate the deps issue
to make this (and further work in this area) to avoid requiring these
'make clean' steps.

> This is an incremental build but doing 'make -C tools/perf clean' and then
> rebuilding works, so maybe there is a dependency missing?

Thanks for reporting.

- Arnaldo

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2024-04-01 22:41 linux-next: build failure after merge of the perf tree Stephen Rothwell
  2024-04-02 20:17 ` Arnaldo Carvalho de Melo
@ 2024-04-12 15:22 ` Arnaldo Carvalho de Melo
  2024-04-13  2:43   ` Stephen Rothwell
  1 sibling, 1 reply; 57+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-04-12 15:22 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Arnaldo Carvalho de Melo, Namhyung Kim,
	Linux Kernel Mailing List, Linux Next Mailing List

On Tue, Apr 02, 2024 at 09:41:16AM +1100, Stephen Rothwell wrote:
> Hi all,
> 
> After merging the perf tree, today's linux-next build (native i.e. ppc64le
> perf) failed like this:
> 
> make[3]: *** No rule to make target '/home/sfr/next/next/tools/include/uapi/linux/stat.h', needed by '/home/sfr/next/perf/libbpf/staticobjs/libbpf.o'.  Stop.

How is this built? Using O=/home/sfr/next/perf?
 
> Maybe caused by commit
> 
>   f122b3d6d179 ("perf beauty: Introduce scrape script for the 'statx' syscall 'mask' argument")
> 
> or
> 
>   a672af9139a8 ("tools headers: Remove almost unused copy of uapi/stat.h, add few conditional defines")
> 
> or a combination of them?
> 
> This is an incremental build but doing 'make -C tools/perf clean' and then
> rebuilding works, so maybe there is a dependency missing?

So I'm trying to revisit this, I did:

⬢[acme@toolbox perf-tools-next]$ rm -rf /tmp/build/$(basename $PWD)/ ; mkdir -p /tmp/build/$(basename $PWD)/
⬢[acme@toolbox perf-tools-next]$ alias m='rm -rf ~/libexec/perf-core/ ; make -k CORESIGHT=1 O=/tmp/build/$(basename $PWD)/ -C tools/perf install-bin && perf test python'
⬢[acme@toolbox perf-tools-next]$ git remote update torvalds
Fetching torvalds
⬢[acme@toolbox perf-tools-next]$ m
<SNIP>
  LD      /tmp/build/perf-tools-next/perf-in.o
  CC      /tmp/build/perf-tools-next/pmu-events/pmu-events.o
  LD      /tmp/build/perf-tools-next/pmu-events/pmu-events-in.o
  LINK    /tmp/build/perf-tools-next/perf
  INSTALL binaries
  INSTALL tests
  INSTALL libperf-jvmti.so
  INSTALL libexec
  INSTALL perf-archive
  INSTALL perf-iostat
  INSTALL strace/groups
  INSTALL perl-scripts
  INSTALL python-scripts
  INSTALL dlfilters
  INSTALL perf_completion-script
  INSTALL perf-tip
make: Leaving directory '/home/acme/git/perf-tools-next/tools/perf'
 17: 'import perf' in python                                         : Ok
⬢[acme@toolbox perf-tools-next]$

Then left this there and merged perf-tools-next:

⬢[acme@toolbox perf-tools-next]$ git merge perf-tools-next
Auto-merging MAINTAINERS
Merge made by the 'ort' strategy.
 MAINTAINERS                                                            |    1 +
 tools/include/uapi/asm-generic/fcntl.h                                 |  221 -----------
 tools/include/uapi/linux/openat2.h                                     |   43 ---
 tools/lib/perf/cpumap.c                                                |   33 +-
 tools/lib/perf/include/perf/cpumap.h                                   |   16 +
 tools/lib/perf/libperf.map                                             |    4 +
<SNIP>
 tools/perf/util/vdso.c                                                 |   48 +--
 186 files changed, 7217 insertions(+), 3829 deletions(-)
 delete mode 100644 tools/include/uapi/asm-generic/fcntl.h
 delete mode 100644 tools/include/uapi/linux/openat2.h
 rename tools/{ => perf/trace/beauty}/arch/x86/include/asm/irq_vectors.h (100%)
 rename tools/{ => perf/trace/beauty}/arch/x86/include/uapi/asm/prctl.h (100%)
 create mode 100755 tools/perf/trace/beauty/clone.sh
 create mode 100644 tools/perf/trace/beauty/fs_at_flags.c
 create mode 100755 tools/perf/trace/beauty/fs_at_flags.sh
 rename tools/{ => perf/trace/beauty}/include/uapi/linux/fcntl.h (100%)
 rename tools/{ => perf/trace/beauty}/include/uapi/linux/fs.h (100%)
 rename tools/{ => perf/trace/beauty}/include/uapi/linux/mount.h (100%)
 rename tools/{ => perf/trace/beauty}/include/uapi/linux/prctl.h (100%)
 rename tools/{ => perf/trace/beauty}/include/uapi/linux/sched.h (100%)
 rename tools/{ => perf/trace/beauty}/include/uapi/linux/stat.h (100%)
 rename tools/{ => perf/trace/beauty}/include/uapi/linux/usbdevice_fs.h (100%)
 rename tools/{ => perf/trace/beauty}/include/uapi/linux/vhost.h (100%)
 rename tools/{ => perf/trace/beauty}/include/uapi/sound/asound.h (100%)
 create mode 100755 tools/perf/trace/beauty/statx_mask.sh
 create mode 100644 tools/perf/ui/browsers/annotate-data.c
 create mode 100644 tools/perf/util/disasm.c
 create mode 100644 tools/perf/util/disasm.h
⬢[acme@toolbox perf-tools-next]$ 

And:

⬢[acme@toolbox perf-tools-next]$ m
rm: cannot remove '/home/acme/libexec/perf-core/scripts/python/Perf-Trace-Util/lib/Perf/Trace/__pycache__/Core.cpython-312.pyc': Permission denied
make: Entering directory '/home/acme/git/perf-tools-next/tools/perf'
  BUILD:   Doing 'make -j28' parallel build
Warning: Kernel ABI header differences:
<SNIP>
Auto-detecting system features:
...                                   dwarf: [ on  ]
...                      dwarf_getlocations: [ on  ]
...                                   glibc: [ on  ]
...                                  libbfd: [ on  ]
...                          libbfd-buildid: [ on  ]
...                                  libcap: [ on  ]
...                                  libelf: [ on  ]
...                                 libnuma: [ on  ]
...                  numa_num_possible_cpus: [ on  ]
...                                 libperl: [ on  ]
...                               libpython: [ on  ]
...                               libcrypto: [ on  ]
...                               libunwind: [ on  ]
...                      libdw-dwarf-unwind: [ on  ]
...                             libcapstone: [ on  ]
...                                    zlib: [ on  ]
...                                    lzma: [ on  ]
...                               get_cpuid: [ on  ]
...                                     bpf: [ on  ]
...                                  libaio: [ on  ]
...                                 libzstd: [ on  ]

  GEN     /tmp/build/perf-tools-next/common-cmds.h
  LINK    /tmp/build/perf-tools-next/libperf-jvmti.so
  INSTALL /tmp/build/perf-tools-next/libsubcmd/include/subcmd/run-command.h
<SNIP>
INSTALL libbpf_headers
  LD      /tmp/build/perf-tools-next/libperf/libperf-in.o
  CLANG   /tmp/build/perf-tools-next/util/bpf_skel/.tmp/augmented_raw_syscalls.bpf.o
  AR      /tmp/build/perf-tools-next/libperf/libperf.a
  GENSKEL /tmp/build/perf-tools-next/util/bpf_skel/augmented_raw_syscalls.skel.h
  GEN     /tmp/build/perf-tools-next/python/perf.cpython-312-x86_64-linux-gnu.so
  GEN     /tmp/build/perf-tools-next/pmu-events/pmu-events.c
  CC      /tmp/build/perf-tools-next/builtin-bench.o
  CC      /tmp/build/perf-tools-next/builtin-annotate.o
<SNIP>
  CC      /tmp/build/perf-tools-next/util/bpf-event.o
  CC      /tmp/build/perf-tools-next/util/bpf-utils.o
  CC      /tmp/build/perf-tools-next/util/pfm.o
  LD      /tmp/build/perf-tools-next/util/scripting-engines/perf-in.o
  LD      /tmp/build/perf-tools-next/util/perf-in.o
  LD      /tmp/build/perf-tools-next/perf-in.o
  CC      /tmp/build/perf-tools-next/pmu-events/pmu-events.o
  LD      /tmp/build/perf-tools-next/pmu-events/pmu-events-in.o
  LINK    /tmp/build/perf-tools-next/perf
  INSTALL binaries
  INSTALL tests
  INSTALL libperf-jvmti.so
  INSTALL libexec
  INSTALL perf-archive
  INSTALL perf-iostat
  INSTALL strace/groups
  INSTALL perl-scripts
  INSTALL python-scripts
  INSTALL dlfilters
  INSTALL perf_completion-script
  INSTALL perf-tip
make: Leaving directory '/home/acme/git/perf-tools-next/tools/perf'
 17: 'import perf' in python                                         : Ok
⬢[acme@toolbox perf-tools-next]$

⬢[acme@toolbox perf-tools-next]$ ls -la tools/include/uapi/linux/stat.h
ls: cannot access 'tools/include/uapi/linux/stat.h': No such file or directory
⬢[acme@toolbox perf-tools-next]$

I'm not being able to reproduce that problem, can you see where am I
doing some mistake in the above steps?

Thanks,

- Arnaldo

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2024-04-12 15:22 ` Arnaldo Carvalho de Melo
@ 2024-04-13  2:43   ` Stephen Rothwell
  2024-04-18 21:31     ` [PATCH][RFT] " Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 57+ messages in thread
From: Stephen Rothwell @ 2024-04-13  2:43 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Arnaldo Carvalho de Melo, Namhyung Kim,
	Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 9385 bytes --]

Hi Arnaldo,

On Fri, 12 Apr 2024 12:22:07 -0300 Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
>
> On Tue, Apr 02, 2024 at 09:41:16AM +1100, Stephen Rothwell wrote:
> > Hi all,
> > 
> > After merging the perf tree, today's linux-next build (native i.e. ppc64le
> > perf) failed like this:
> > 
> > make[3]: *** No rule to make target '/home/sfr/next/next/tools/include/uapi/linux/stat.h', needed by '/home/sfr/next/perf/libbpf/staticobjs/libbpf.o'.  Stop.  
> 
> How is this built? Using O=/home/sfr/next/perf?

Yes.  The actual command line is:

make -C tools/perf -f Makefile.perf -s -O -j60 O=/home/sfr/next/perf NO_BPF_SKEL=1

The source directory is /home/sfr/next/next.  This is a PowerPC 64 little endian
build (on a PowerPC 64 little endian host).

OK, I just tested on my x86_64 laptop:
(I started with a clone of Linus' current tree)

pine:~/next/next (master)$ rm -rf ../perf
pine:~/next/next (master)$ mkdir ../perf
pine:~/next/next (master)$ make -C tools/perf -f Makefile.perf -s -O -j10 O=/home/sfr/next/perf NO_BPF_SKEL=1
Warning: Kernel ABI header differences:
  diff -u tools/include/uapi/drm/i915_drm.h include/uapi/drm/i915_drm.h
  diff -u tools/include/uapi/linux/fs.h include/uapi/linux/fs.h
  diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h
  diff -u tools/include/uapi/linux/vhost.h include/uapi/linux/vhost.h
  diff -u tools/include/uapi/sound/asound.h include/uapi/sound/asound.h
  diff -u tools/include/linux/bits.h include/linux/bits.h
  diff -u tools/arch/x86/include/asm/disabled-features.h arch/x86/include/asm/disabled-features.h
  diff -u tools/arch/x86/include/asm/required-features.h arch/x86/include/asm/required-features.h
  diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h
  diff -u tools/arch/x86/include/asm/irq_vectors.h arch/x86/include/asm/irq_vectors.h
  diff -u tools/arch/x86/include/asm/msr-index.h arch/x86/include/asm/msr-index.h
  diff -u tools/arch/x86/include/uapi/asm/kvm.h arch/x86/include/uapi/asm/kvm.h
  diff -u tools/arch/powerpc/include/uapi/asm/kvm.h arch/powerpc/include/uapi/asm/kvm.h
  diff -u tools/arch/s390/include/uapi/asm/kvm.h arch/s390/include/uapi/asm/kvm.h
  diff -u tools/arch/arm64/include/uapi/asm/kvm.h arch/arm64/include/uapi/asm/kvm.h
  diff -u tools/include/asm-generic/bitops/__fls.h include/asm-generic/bitops/__fls.h
  diff -u tools/include/asm-generic/bitops/fls.h include/asm-generic/bitops/fls.h
  diff -u tools/arch/arm64/include/asm/cputype.h arch/arm64/include/asm/cputype.h
Makefile.config:455: No libdw DWARF unwind found, Please install elfutils-devel/libdw-dev >= 0.158 and/or set LIBDW_DIR
Makefile.config:460: 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
Makefile.config:602: No sys/sdt.h found, no SDT events are defined, please install systemtap-sdt-devel or systemtap-sdt-dev
Makefile.config:688: Warning: Disabled BPF skeletons as clang (clang) is missing
Makefile.config:800: slang not found, disables TUI support. Please install slang-devel, libslang-dev or libslang2-dev
Makefile.config:1083: No libbabeltrace found, disables 'perf data' CTF format support, please install libbabeltrace-dev[el]/libbabeltrace-ctf-dev
Makefile.config:1147: No openjdk development package found, please install JDK package, e.g. openjdk-8-jdk, java-1.8.0-openjdk-devel
Makefile.config:1160: libpfm4 not found, disables libpfm4 support. Please install libpfm4-dev

Auto-detecting system features:
...                                   dwarf: [ OFF ]
...                      dwarf_getlocations: [ OFF ]
...                                   glibc: [ on  ]
...                                  libbfd: [ on  ]
...                          libbfd-buildid: [ on  ]
...                                  libcap: [ on  ]
...                                  libelf: [ on  ]
...                                 libnuma: [ on  ]
...                  numa_num_possible_cpus: [ on  ]
...                                 libperl: [ on  ]
...                               libpython: [ on  ]
...                               libcrypto: [ on  ]
...                               libunwind: [ on  ]
...                      libdw-dwarf-unwind: [ OFF ]
...                             libcapstone: [ on  ]
...                                    zlib: [ on  ]
...                                    lzma: [ on  ]
...                               get_cpuid: [ on  ]
...                                     bpf: [ on  ]
...                                  libaio: [ on  ]
...                                 libzstd: [ on  ]

  PERF_VERSION = 6.9.rc3.g8f2c057754b2
pine:~/next/next (master)$ git merge perf-tools-next 
Auto-merging MAINTAINERS
Merge made by the 'ort' strategy.
 MAINTAINERS                                        |    1 +
 tools/include/uapi/asm-generic/fcntl.h             |  221 --
	.
	.
	.
 create mode 100644 tools/perf/util/disasm.h
pine:~/next/next (master)$ make -C tools/perf -f Makefile.perf -s -O -j10 O=/home/sfr/next/perf NO_BPF_SKEL=1
Warning: Kernel ABI header differences:
  diff -u tools/include/uapi/drm/i915_drm.h include/uapi/drm/i915_drm.h
  diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h
  diff -u tools/include/linux/bits.h include/linux/bits.h
  diff -u tools/arch/x86/include/asm/disabled-features.h arch/x86/include/asm/disabled-features.h
  diff -u tools/arch/x86/include/asm/required-features.h arch/x86/include/asm/required-features.h
  diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h
  diff -u tools/arch/x86/include/asm/msr-index.h arch/x86/include/asm/msr-index.h
  diff -u tools/arch/x86/include/uapi/asm/kvm.h arch/x86/include/uapi/asm/kvm.h
  diff -u tools/arch/powerpc/include/uapi/asm/kvm.h arch/powerpc/include/uapi/asm/kvm.h
  diff -u tools/arch/s390/include/uapi/asm/kvm.h arch/s390/include/uapi/asm/kvm.h
  diff -u tools/arch/arm64/include/uapi/asm/kvm.h arch/arm64/include/uapi/asm/kvm.h
  diff -u tools/include/asm-generic/bitops/__fls.h include/asm-generic/bitops/__fls.h
  diff -u tools/include/asm-generic/bitops/fls.h include/asm-generic/bitops/fls.h
  diff -u tools/arch/arm64/include/asm/cputype.h arch/arm64/include/asm/cputype.h
  diff -u tools/perf/trace/beauty/arch/x86/include/asm/irq_vectors.h arch/x86/include/asm/irq_vectors.h
  diff -u tools/perf/trace/beauty/include/uapi/linux/fs.h include/uapi/linux/fs.h
  diff -u tools/perf/trace/beauty/include/uapi/linux/vhost.h include/uapi/linux/vhost.h
  diff -u tools/perf/trace/beauty/include/uapi/sound/asound.h include/uapi/sound/asound.h
Makefile.config:465: No libdw DWARF unwind found, Please install elfutils-devel/libdw-dev >= 0.158 and/or set LIBDW_DIR
Makefile.config:470: 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
Makefile.config:612: No sys/sdt.h found, no SDT events are defined, please install systemtap-sdt-devel or systemtap-sdt-dev
Makefile.config:698: Warning: Disabled BPF skeletons as clang (clang) is missing
Makefile.config:810: slang not found, disables TUI support. Please install slang-devel, libslang-dev or libslang2-dev
Makefile.config:1093: No libbabeltrace found, disables 'perf data' CTF format support, please install libbabeltrace-dev[el]/libbabeltrace-ctf-dev
Makefile.config:1157: No openjdk development package found, please install JDK package, e.g. openjdk-8-jdk, java-1.8.0-openjdk-devel
Makefile.config:1170: libpfm4 not found, disables libpfm4 support. Please install libpfm4-dev

Auto-detecting system features:
...                                   dwarf: [ OFF ]
...                      dwarf_getlocations: [ OFF ]
...                                   glibc: [ on  ]
...                                  libbfd: [ on  ]
...                          libbfd-buildid: [ on  ]
...                                  libcap: [ on  ]
...                                  libelf: [ on  ]
...                                 libnuma: [ on  ]
...                  numa_num_possible_cpus: [ on  ]
...                                 libperl: [ on  ]
...                               libpython: [ on  ]
...                               libcrypto: [ on  ]
...                               libunwind: [ on  ]
...                      libdw-dwarf-unwind: [ OFF ]
...                             libcapstone: [ on  ]
...                                    zlib: [ on  ]
...                                    lzma: [ on  ]
...                               get_cpuid: [ on  ]
...                                     bpf: [ on  ]
...                                  libaio: [ on  ]
...                                 libzstd: [ on  ]

  PERF_VERSION = 6.9.rc3.g42c4635c8dee
make[3]: *** No rule to make target '/home/sfr/next/next/tools/include/uapi/linux/stat.h', needed by '/home/sfr/next/perf/libbpf/staticobjs/libbpf.o'.  Stop.
make[2]: *** [Makefile:157: /home/sfr/next/perf/libbpf/staticobjs/libbpf-in.o] Error 2
make[1]: *** [Makefile.perf:892: /home/sfr/next/perf/libbpf/libbpf.a] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile.perf:264: sub-make] Error 2

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 57+ messages in thread

* [PATCH][RFT] Re: linux-next: build failure after merge of the perf tree
  2024-04-13  2:43   ` Stephen Rothwell
@ 2024-04-18 21:31     ` Arnaldo Carvalho de Melo
  2024-04-18 23:17       ` Stephen Rothwell
  0 siblings, 1 reply; 57+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-04-18 21:31 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Arnaldo Carvalho de Melo, Namhyung Kim, Ian Rogers, Kan Liang,
	Adrian Hunter, Linux Kernel Mailing List,
	Linux Next Mailing List

On Sat, Apr 13, 2024 at 12:43:40PM +1000, Stephen Rothwell wrote:
> Hi Arnaldo,
> 
> On Fri, 12 Apr 2024 12:22:07 -0300 Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> >
> > On Tue, Apr 02, 2024 at 09:41:16AM +1100, Stephen Rothwell wrote:
> > > Hi all,
> > > 
> > > After merging the perf tree, today's linux-next build (native i.e. ppc64le
> > > perf) failed like this:
> > > 
> > > make[3]: *** No rule to make target '/home/sfr/next/next/tools/include/uapi/linux/stat.h', needed by '/home/sfr/next/perf/libbpf/staticobjs/libbpf.o'.  Stop.  
> > 
> > How is this built? Using O=/home/sfr/next/perf?
> 
> Yes.  The actual command line is:
> 
> make -C tools/perf -f Makefile.perf -s -O -j60 O=/home/sfr/next/perf NO_BPF_SKEL=1
> 
> The source directory is /home/sfr/next/next.  This is a PowerPC 64 little endian
> build (on a PowerPC 64 little endian host).
> 
> OK, I just tested on my x86_64 laptop:
> (I started with a clone of Linus' current tree)

Ok, I did that sequence:

1. checkout torvalds/master
2. use the make command line above
3. git merge perf-tools-next
4. use the make command line above

And reproduced the problem, find below a patch that reverts the patch
that removes tools/include/uapi/linux/stat.h, with it applied in the
sequence above right after the merge of perf-tools-next it seems to
work, i.e. it builds without problems.

Can you please test this so that I can get it into perf-tools-next?

Thanks again for the report!

- Arnaldo

From cec45ef1ad23059aac607d0db959c73c2198bc2a Mon Sep 17 00:00:00 2001
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Date: Thu, 18 Apr 2024 18:15:33 -0300
Subject: [PATCH 1/1] Revert "tools headers: Remove almost unused copy of
 uapi/stat.h, add few conditional defines"

This reverts commit a672af9139a843eb7a48fd7846bb6df8f81b5f86.

By now it is not used for building tools/perf, but Stephen Rothwell
reported that when building on a O= directory that had been built with
torvalds/master and this perf build command line:

  $ make -C tools/perf -f Makefile.perf -s -O -j60 O=/home/sfr/next/perf NO_BPF_SKEL=1

If we then merge perf-tools-next, as he did for linux-next, then we end
up with a build failure for libbpf:

    PERF_VERSION = 6.9.rc3.g42c4635c8dee
  make[3]: *** No rule to make target '/home/sfr/next/next/tools/include/uapi/linux/stat.h', needed by '/home/sfr/next/perf/libbpf/staticobjs/libbpf.o'.  Stop.
  make[2]: *** [Makefile:157: /home/sfr/next/perf/libbpf/staticobjs/libbpf-in.o] Error 2
  make[1]: *** [Makefile.perf:892: /home/sfr/next/perf/libbpf/libbpf.a] Error 2
  make[1]: *** Waiting for unfinished jobs....
  make: *** [Makefile.perf:264: sub-make] Error 2

This needs to be further investigated to figure out how to check if
libbpf really needs something that is in that
tools/include/uapi/linux/stat.h file and if not to remove that file in a
way that we don't break the build in any situation, to avoid requiring
doing a 'make clean'.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/lkml/20240413124340.4d48c6d8@canb.auug.org.au
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/include/uapi/linux/stat.h | 195 ++++++++++++++++++++++++++++++++
 tools/perf/check-headers.sh     |   1 +
 2 files changed, 196 insertions(+)
 create mode 100644 tools/include/uapi/linux/stat.h

diff --git a/tools/include/uapi/linux/stat.h b/tools/include/uapi/linux/stat.h
new file mode 100644
index 0000000000000000..2f2ee82d55175d05
--- /dev/null
+++ b/tools/include/uapi/linux/stat.h
@@ -0,0 +1,195 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+#ifndef _UAPI_LINUX_STAT_H
+#define _UAPI_LINUX_STAT_H
+
+#include <linux/types.h>
+
+#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
+
+#define S_IFMT  00170000
+#define S_IFSOCK 0140000
+#define S_IFLNK	 0120000
+#define S_IFREG  0100000
+#define S_IFBLK  0060000
+#define S_IFDIR  0040000
+#define S_IFCHR  0020000
+#define S_IFIFO  0010000
+#define S_ISUID  0004000
+#define S_ISGID  0002000
+#define S_ISVTX  0001000
+
+#define S_ISLNK(m)	(((m) & S_IFMT) == S_IFLNK)
+#define S_ISREG(m)	(((m) & S_IFMT) == S_IFREG)
+#define S_ISDIR(m)	(((m) & S_IFMT) == S_IFDIR)
+#define S_ISCHR(m)	(((m) & S_IFMT) == S_IFCHR)
+#define S_ISBLK(m)	(((m) & S_IFMT) == S_IFBLK)
+#define S_ISFIFO(m)	(((m) & S_IFMT) == S_IFIFO)
+#define S_ISSOCK(m)	(((m) & S_IFMT) == S_IFSOCK)
+
+#define S_IRWXU 00700
+#define S_IRUSR 00400
+#define S_IWUSR 00200
+#define S_IXUSR 00100
+
+#define S_IRWXG 00070
+#define S_IRGRP 00040
+#define S_IWGRP 00020
+#define S_IXGRP 00010
+
+#define S_IRWXO 00007
+#define S_IROTH 00004
+#define S_IWOTH 00002
+#define S_IXOTH 00001
+
+#endif
+
+/*
+ * Timestamp structure for the timestamps in struct statx.
+ *
+ * tv_sec holds the number of seconds before (negative) or after (positive)
+ * 00:00:00 1st January 1970 UTC.
+ *
+ * tv_nsec holds a number of nanoseconds (0..999,999,999) after the tv_sec time.
+ *
+ * __reserved is held in case we need a yet finer resolution.
+ */
+struct statx_timestamp {
+	__s64	tv_sec;
+	__u32	tv_nsec;
+	__s32	__reserved;
+};
+
+/*
+ * Structures for the extended file attribute retrieval system call
+ * (statx()).
+ *
+ * The caller passes a mask of what they're specifically interested in as a
+ * parameter to statx().  What statx() actually got will be indicated in
+ * st_mask upon return.
+ *
+ * For each bit in the mask argument:
+ *
+ * - if the datum is not supported:
+ *
+ *   - the bit will be cleared, and
+ *
+ *   - the datum will be set to an appropriate fabricated value if one is
+ *     available (eg. CIFS can take a default uid and gid), otherwise
+ *
+ *   - the field will be cleared;
+ *
+ * - otherwise, if explicitly requested:
+ *
+ *   - the datum will be synchronised to the server if AT_STATX_FORCE_SYNC is
+ *     set or if the datum is considered out of date, and
+ *
+ *   - the field will be filled in and the bit will be set;
+ *
+ * - otherwise, if not requested, but available in approximate form without any
+ *   effort, it will be filled in anyway, and the bit will be set upon return
+ *   (it might not be up to date, however, and no attempt will be made to
+ *   synchronise the internal state first);
+ *
+ * - otherwise the field and the bit will be cleared before returning.
+ *
+ * Items in STATX_BASIC_STATS may be marked unavailable on return, but they
+ * will have values installed for compatibility purposes so that stat() and
+ * co. can be emulated in userspace.
+ */
+struct statx {
+	/* 0x00 */
+	__u32	stx_mask;	/* What results were written [uncond] */
+	__u32	stx_blksize;	/* Preferred general I/O size [uncond] */
+	__u64	stx_attributes;	/* Flags conveying information about the file [uncond] */
+	/* 0x10 */
+	__u32	stx_nlink;	/* Number of hard links */
+	__u32	stx_uid;	/* User ID of owner */
+	__u32	stx_gid;	/* Group ID of owner */
+	__u16	stx_mode;	/* File mode */
+	__u16	__spare0[1];
+	/* 0x20 */
+	__u64	stx_ino;	/* Inode number */
+	__u64	stx_size;	/* File size */
+	__u64	stx_blocks;	/* Number of 512-byte blocks allocated */
+	__u64	stx_attributes_mask; /* Mask to show what's supported in stx_attributes */
+	/* 0x40 */
+	struct statx_timestamp	stx_atime;	/* Last access time */
+	struct statx_timestamp	stx_btime;	/* File creation time */
+	struct statx_timestamp	stx_ctime;	/* Last attribute change time */
+	struct statx_timestamp	stx_mtime;	/* Last data modification time */
+	/* 0x80 */
+	__u32	stx_rdev_major;	/* Device ID of special file [if bdev/cdev] */
+	__u32	stx_rdev_minor;
+	__u32	stx_dev_major;	/* ID of device containing file [uncond] */
+	__u32	stx_dev_minor;
+	/* 0x90 */
+	__u64	stx_mnt_id;
+	__u32	stx_dio_mem_align;	/* Memory buffer alignment for direct I/O */
+	__u32	stx_dio_offset_align;	/* File offset alignment for direct I/O */
+	/* 0xa0 */
+	__u64	__spare3[12];	/* Spare space for future expansion */
+	/* 0x100 */
+};
+
+/*
+ * Flags to be stx_mask
+ *
+ * Query request/result mask for statx() and struct statx::stx_mask.
+ *
+ * These bits should be set in the mask argument of statx() to request
+ * particular items when calling statx().
+ */
+#define STATX_TYPE		0x00000001U	/* Want/got stx_mode & S_IFMT */
+#define STATX_MODE		0x00000002U	/* Want/got stx_mode & ~S_IFMT */
+#define STATX_NLINK		0x00000004U	/* Want/got stx_nlink */
+#define STATX_UID		0x00000008U	/* Want/got stx_uid */
+#define STATX_GID		0x00000010U	/* Want/got stx_gid */
+#define STATX_ATIME		0x00000020U	/* Want/got stx_atime */
+#define STATX_MTIME		0x00000040U	/* Want/got stx_mtime */
+#define STATX_CTIME		0x00000080U	/* Want/got stx_ctime */
+#define STATX_INO		0x00000100U	/* Want/got stx_ino */
+#define STATX_SIZE		0x00000200U	/* Want/got stx_size */
+#define STATX_BLOCKS		0x00000400U	/* Want/got stx_blocks */
+#define STATX_BASIC_STATS	0x000007ffU	/* The stuff in the normal stat struct */
+#define STATX_BTIME		0x00000800U	/* Want/got stx_btime */
+#define STATX_MNT_ID		0x00001000U	/* Got stx_mnt_id */
+#define STATX_DIOALIGN		0x00002000U	/* Want/got direct I/O alignment info */
+#define STATX_MNT_ID_UNIQUE	0x00004000U	/* Want/got extended stx_mount_id */
+
+#define STATX__RESERVED		0x80000000U	/* Reserved for future struct statx expansion */
+
+#ifndef __KERNEL__
+/*
+ * This is deprecated, and shall remain the same value in the future.  To avoid
+ * confusion please use the equivalent (STATX_BASIC_STATS | STATX_BTIME)
+ * instead.
+ */
+#define STATX_ALL		0x00000fffU
+#endif
+
+/*
+ * Attributes to be found in stx_attributes and masked in stx_attributes_mask.
+ *
+ * These give information about the features or the state of a file that might
+ * be of use to ordinary userspace programs such as GUIs or ls rather than
+ * specialised tools.
+ *
+ * Note that the flags marked [I] correspond to the FS_IOC_SETFLAGS flags
+ * semantically.  Where possible, the numerical value is picked to correspond
+ * also.  Note that the DAX attribute indicates that the file is in the CPU
+ * direct access state.  It does not correspond to the per-inode flag that
+ * some filesystems support.
+ *
+ */
+#define STATX_ATTR_COMPRESSED		0x00000004 /* [I] File is compressed by the fs */
+#define STATX_ATTR_IMMUTABLE		0x00000010 /* [I] File is marked immutable */
+#define STATX_ATTR_APPEND		0x00000020 /* [I] File is append-only */
+#define STATX_ATTR_NODUMP		0x00000040 /* [I] File is not to be dumped */
+#define STATX_ATTR_ENCRYPTED		0x00000800 /* [I] File requires key to decrypt in fs */
+#define STATX_ATTR_AUTOMOUNT		0x00001000 /* Dir: Automount trigger */
+#define STATX_ATTR_MOUNT_ROOT		0x00002000 /* Root of a mount */
+#define STATX_ATTR_VERITY		0x00100000 /* [I] Verity protected file */
+#define STATX_ATTR_DAX			0x00200000 /* File is currently in DAX state */
+
+
+#endif /* _UAPI_LINUX_STAT_H */
diff --git a/tools/perf/check-headers.sh b/tools/perf/check-headers.sh
index 95a3a404bc6fddde..9c84fd0490707452 100755
--- a/tools/perf/check-headers.sh
+++ b/tools/perf/check-headers.sh
@@ -16,6 +16,7 @@ FILES=(
   "include/uapi/linux/in.h"
   "include/uapi/linux/perf_event.h"
   "include/uapi/linux/seccomp.h"
+  "include/uapi/linux/stat.h"
   "include/linux/bits.h"
   "include/vdso/bits.h"
   "include/linux/const.h"
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 57+ messages in thread

* Re: [PATCH][RFT] Re: linux-next: build failure after merge of the perf tree
  2024-04-18 21:31     ` [PATCH][RFT] " Arnaldo Carvalho de Melo
@ 2024-04-18 23:17       ` Stephen Rothwell
  2024-04-19  0:54         ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 57+ messages in thread
From: Stephen Rothwell @ 2024-04-18 23:17 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Arnaldo Carvalho de Melo, Namhyung Kim, Ian Rogers, Kan Liang,
	Adrian Hunter, Linux Kernel Mailing List,
	Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 710 bytes --]

Hi Arnaldo,

On Thu, 18 Apr 2024 18:31:45 -0300 Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
>
> 
> And reproduced the problem, find below a patch that reverts the patch
> that removes tools/include/uapi/linux/stat.h, with it applied in the
> sequence above right after the merge of perf-tools-next it seems to
> work, i.e. it builds without problems.
> 
> Can you please test this so that I can get it into perf-tools-next?

That works for me.  Thanks for this.

Tested-by: Stephen Rothwell <sfr@canb.auug.org.au> # PowerPC le incermental build

I will apply that patch to linux-next today (if you don't have time to
update your tree before I merge it).
-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH][RFT] Re: linux-next: build failure after merge of the perf tree
  2024-04-18 23:17       ` Stephen Rothwell
@ 2024-04-19  0:54         ` Arnaldo Carvalho de Melo
  2024-04-19  1:06           ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 57+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-04-19  0:54 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Arnaldo Carvalho de Melo, Namhyung Kim, Ian Rogers, Kan Liang,
	Adrian Hunter, Linux Kernel Mailing List,
	Linux Next Mailing List

On Fri, Apr 19, 2024 at 09:17:17AM +1000, Stephen Rothwell wrote:
> Hi Arnaldo,
> 
> On Thu, 18 Apr 2024 18:31:45 -0300 Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> >
> > 
> > And reproduced the problem, find below a patch that reverts the patch
> > that removes tools/include/uapi/linux/stat.h, with it applied in the
> > sequence above right after the merge of perf-tools-next it seems to
> > work, i.e. it builds without problems.
> > 
> > Can you please test this so that I can get it into perf-tools-next?
> 
> That works for me.  Thanks for this.
> 
> Tested-by: Stephen Rothwell <sfr@canb.auug.org.au> # PowerPC le incermental build
> 
> I will apply that patch to linux-next today (if you don't have time to
> update your tree before I merge it).

I'm finishing some local tests here, will push perf-tools-next after
that, some 30 minutes.

- Arnaldo

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH][RFT] Re: linux-next: build failure after merge of the perf tree
  2024-04-19  0:54         ` Arnaldo Carvalho de Melo
@ 2024-04-19  1:06           ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 57+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-04-19  1:06 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Arnaldo Carvalho de Melo, Namhyung Kim, Ian Rogers, Kan Liang,
	Adrian Hunter, Linux Kernel Mailing List,
	Linux Next Mailing List

On Thu, Apr 18, 2024 at 09:54:03PM -0300, Arnaldo Carvalho de Melo wrote:
> On Fri, Apr 19, 2024 at 09:17:17AM +1000, Stephen Rothwell wrote:
> > On Thu, 18 Apr 2024 18:31:45 -0300 Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> > > And reproduced the problem, find below a patch that reverts the patch
> > > that removes tools/include/uapi/linux/stat.h, with it applied in the
> > > sequence above right after the merge of perf-tools-next it seems to
> > > work, i.e. it builds without problems.

> > > Can you please test this so that I can get it into perf-tools-next?

> > That works for me.  Thanks for this.

> > Tested-by: Stephen Rothwell <sfr@canb.auug.org.au> # PowerPC le incermental build

> > I will apply that patch to linux-next today (if you don't have time to
> > update your tree before I merge it).

> I'm finishing some local tests here, will push perf-tools-next after
> that, some 30 minutes.

Ah, and again thanks for the report and follow up collaboration on
having these things sorted out, I'm sorry for not having this fixed
sooner, I'm taking notes to automate this type of test and have it done
before pushing branches publicly.

I just found it strange that when trying to reproduce this the problem
didn't manifested itself reliably, but then, ENOTIME to root cause this
so far, this (partial) revert is the best thing we can do now, so lets
go with it.

- Arnaldo

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2024-03-22  2:13       ` Stephen Rothwell
@ 2024-03-22 14:32         ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 57+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-03-22 14:32 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Arnaldo Carvalho de Melo, Namhyung Kim,
	Linux Kernel Mailing List, Linux Next Mailing List

On Fri, Mar 22, 2024 at 01:13:38PM +1100, Stephen Rothwell wrote:
> Hi Arnaldo,
> 
> On Fri, 22 Mar 2024 10:32:29 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> >
> > On Thu, 21 Mar 2024 20:19:00 -0300 Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
>  > 
> > > About this specific problem, was this done on over a previous build? Can
> > > you try after a 'make -C tools/perf clean' ?  
> > 
> > It was done over a previous build.  I can try a clean build later
> > today.  We have had this problem before with different include files
> > and I think it came down to a missing dependency.
> 
> It builds OK if I do the clean first.

Thanks for checking, I'll try and have this noticed by make so that it
works even when doing it on a previous build.

- Arnaldo

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2024-03-21 23:32     ` Stephen Rothwell
@ 2024-03-22  2:13       ` Stephen Rothwell
  2024-03-22 14:32         ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 57+ messages in thread
From: Stephen Rothwell @ 2024-03-22  2:13 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Arnaldo Carvalho de Melo, Namhyung Kim,
	Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 597 bytes --]

Hi Arnaldo,

On Fri, 22 Mar 2024 10:32:29 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> On Thu, 21 Mar 2024 20:19:00 -0300 Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
 > 
> > About this specific problem, was this done on over a previous build? Can
> > you try after a 'make -C tools/perf clean' ?  
> 
> It was done over a previous build.  I can try a clean build later
> today.  We have had this problem before with different include files
> and I think it came down to a missing dependency.

It builds OK if I do the clean first.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2024-03-21 23:36   ` Stephen Rothwell
  2024-03-21 23:40     ` arnaldo.melo
@ 2024-03-21 23:48     ` Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 57+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-03-21 23:48 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Namhyung Kim, Linux Kernel Mailing List, Linux Next Mailing List

On Fri, Mar 22, 2024 at 10:36:36AM +1100, Stephen Rothwell wrote:
> Hi Arnaldo,
> 
> On Thu, 21 Mar 2024 20:18:00 -0300 Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> >
> > Ok, maybe I opened perf-tools-next for the next merge window too early?
> 
> Yeah.

Ok, I got it back to:

acme@x1:~/git/perf-tools-next$ git log --oneline -3 perf-tools-next/perf-tools-next
1bbeaf83dd7b5e36 (perf-tools-next/perf-tools-next) Merge tag 'perf-tools-for-v6.9-2024-03-13' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools
63bd30f249dcf0a7 Merge tag 'trace-ring-buffer-v6.8-rc7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace
01732755ee30f086 Merge tag 'probes-v6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace
acme@x1:~/git/perf-tools-next$
 
Sorry for the noise, I'll move to perf-tools-next when -rc1 gets
released, I'm acumulating new stuff on a different branch.

- Arnaldo

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2024-03-21 23:36   ` Stephen Rothwell
@ 2024-03-21 23:40     ` arnaldo.melo
  2024-03-21 23:48     ` Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 57+ messages in thread
From: arnaldo.melo @ 2024-03-21 23:40 UTC (permalink / raw)
  Cc: Arnaldo Carvalho de Melo, Namhyung Kim,
	Linux Kernel Mailing List, Linux Next Mailing List

On Fri, Mar 22, 2024 at 10:36:36AM +1100, Stephen Rothwell wrote:
> Hi Arnaldo,
> 
> On Thu, 21 Mar 2024 20:18:00 -0300 Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> >
> > Ok, maybe I opened perf-tools-next for the next merge window too early?
> 
> Yeah.

Ok, I'm rewinding perf-tools-next to the point where Linus merged
Namhyung's first, and only so far, pull request, sorry for the noise.
 
> > For this merge window I think Namhyung is switching to perf-tools,
> > right?
 
> Hopefully.  That branch is for bugs fixes, I think.

Right, that will start at rc1, ok.
 
> > From your reaction I think I made a mistake and should have opened
> > perf-tools-next for v6.10 stuff only when the v6.9-rc1 gets released...
> 
> The top of my daily linux-next release report says
> 
> "Please do not add any v6.10 material to your linux-next included branches
> until after v6.9-rc1 has been released."
> 
> (I did forget this message for few days this merge window, sorry).

Ok,

- Arnaldo

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2024-03-21 23:18 ` Arnaldo Carvalho de Melo
  2024-03-21 23:19   ` Arnaldo Carvalho de Melo
@ 2024-03-21 23:36   ` Stephen Rothwell
  2024-03-21 23:40     ` arnaldo.melo
  2024-03-21 23:48     ` Arnaldo Carvalho de Melo
  1 sibling, 2 replies; 57+ messages in thread
From: Stephen Rothwell @ 2024-03-21 23:36 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Arnaldo Carvalho de Melo, Namhyung Kim,
	Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 750 bytes --]

Hi Arnaldo,

On Thu, 21 Mar 2024 20:18:00 -0300 Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
>
> Ok, maybe I opened perf-tools-next for the next merge window too early?

Yeah.

> For this merge window I think Namhyung is switching to perf-tools,
> right?

Hopefully.  That branch is for bugs fixes, I think.

> From your reaction I think I made a mistake and should have opened
> perf-tools-next for v6.10 stuff only when the v6.9-rc1 gets released...

The top of my daily linux-next release report says

"Please do not add any v6.10 material to your linux-next included branches
until after v6.9-rc1 has been released."

(I did forget this message for few days this merge window, sorry).

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2024-03-21 23:19   ` Arnaldo Carvalho de Melo
@ 2024-03-21 23:32     ` Stephen Rothwell
  2024-03-22  2:13       ` Stephen Rothwell
  0 siblings, 1 reply; 57+ messages in thread
From: Stephen Rothwell @ 2024-03-21 23:32 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Arnaldo Carvalho de Melo, Namhyung Kim,
	Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 456 bytes --]

Hi Arnaldo,

On Thu, 21 Mar 2024 20:19:00 -0300 Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
>
> 
> About this specific problem, was this done on over a previous build? Can
> you try after a 'make -C tools/perf clean' ?

It was done over a previous build.  I can try a clean build later
today.  We have had this problem before with different include files
and I think it came down to a missing dependency.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2024-03-21 23:18 ` Arnaldo Carvalho de Melo
@ 2024-03-21 23:19   ` Arnaldo Carvalho de Melo
  2024-03-21 23:32     ` Stephen Rothwell
  2024-03-21 23:36   ` Stephen Rothwell
  1 sibling, 1 reply; 57+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-03-21 23:19 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Arnaldo Carvalho de Melo, Namhyung Kim,
	Linux Kernel Mailing List, Linux Next Mailing List

On Thu, Mar 21, 2024 at 08:18:03PM -0300, Arnaldo Carvalho de Melo wrote:
> On Fri, Mar 22, 2024 at 08:41:31AM +1100, Stephen Rothwell wrote:
> > Hi all,
> > 
> > After merging the perf tree, today's linux-next build (native perf)
> > failed like this:
> > 
> > make[3]: *** No rule to make target '/home/sfr/next/next/tools/include/uapi/linux/stat.h', needed by '/home/sfr/next/perf/libbpf/staticobjs/libbpf.o'.  Stop.

About this specific problem, was this done on over a previous build? Can
you try after a 'make -C tools/perf clean' ?

> > Caused by commit
> > 
> >   f122b3d6d179 ("perf beauty: Introduce scrape script for the 'statx' syscall 'mask' argument")

> > Are all these new commits today really destined for the current merge
> > window?
> > 
> > I have used the perf tree from next-20240321 for today.
> 
> Ok, maybe I opened perf-tools-next for the next merge window too early?
> 
> For this merge window I think Namhyung is switching to perf-tools,
> right?
> 
> From your reaction I think I made a mistake and should have opened
> perf-tools-next for v6.10 stuff only when the v6.9-rc1 gets released...
> 
> - Arnaldo

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2024-03-21 21:41 Stephen Rothwell
@ 2024-03-21 23:18 ` Arnaldo Carvalho de Melo
  2024-03-21 23:19   ` Arnaldo Carvalho de Melo
  2024-03-21 23:36   ` Stephen Rothwell
  0 siblings, 2 replies; 57+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-03-21 23:18 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Arnaldo Carvalho de Melo, Namhyung Kim,
	Linux Kernel Mailing List, Linux Next Mailing List

On Fri, Mar 22, 2024 at 08:41:31AM +1100, Stephen Rothwell wrote:
> Hi all,
> 
> After merging the perf tree, today's linux-next build (native perf)
> failed like this:
> 
> make[3]: *** No rule to make target '/home/sfr/next/next/tools/include/uapi/linux/stat.h', needed by '/home/sfr/next/perf/libbpf/staticobjs/libbpf.o'.  Stop.
> 
> Caused by commit
> 
>   f122b3d6d179 ("perf beauty: Introduce scrape script for the 'statx' syscall 'mask' argument")
> 
> Are all these new commits today really destined for the current merge
> window?
> 
> I have used the perf tree from next-20240321 for today.

Ok, maybe I opened perf-tools-next for the next merge window too early?

For this merge window I think Namhyung is switching to perf-tools,
right?

From your reaction I think I made a mistake and should have opened
perf-tools-next for v6.10 stuff only when the v6.9-rc1 gets released...

- Arnaldo

^ permalink raw reply	[flat|nested] 57+ messages in thread

* linux-next: build failure after merge of the perf tree
@ 2024-03-21 21:41 Stephen Rothwell
  2024-03-21 23:18 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 57+ messages in thread
From: Stephen Rothwell @ 2024-03-21 21:41 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Namhyung Kim
  Cc: Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 554 bytes --]

Hi all,

After merging the perf tree, today's linux-next build (native perf)
failed like this:

make[3]: *** No rule to make target '/home/sfr/next/next/tools/include/uapi/linux/stat.h', needed by '/home/sfr/next/perf/libbpf/staticobjs/libbpf.o'.  Stop.

Caused by commit

  f122b3d6d179 ("perf beauty: Introduce scrape script for the 'statx' syscall 'mask' argument")

Are all these new commits today really destined for the current merge
window?

I have used the perf tree from next-20240321 for today.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2024-02-21 23:06 Stephen Rothwell
@ 2024-02-23 19:50 ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 57+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-02-23 19:50 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Arnaldo Carvalho de Melo, Namhyung Kim, Arnaldo Carvalho de Melo,
	Linux Kernel Mailing List, Linux Next Mailing List

On Thu, Feb 22, 2024 at 10:06:56AM +1100, Stephen Rothwell wrote:
> Hi all,
> 
> After merging the perf tree, today's linux-next build (native perf)
> failed like this:
> 
> util/bpf_skel/augmented_raw_syscalls.bpf.c:329:15: error: invalid application of 'sizeof' to an incomplete type 'struct timespec64'
>         __u32 size = sizeof(struct timespec64);
>                      ^     ~~~~~~~~~~~~~~~~~~~
> util/bpf_skel/augmented_raw_syscalls.bpf.c:329:29: note: forward declaration of 'struct timespec64'
>         __u32 size = sizeof(struct timespec64);
>                                    ^
> 
> Caused by commit
> 
>   29d16de26df1 ("perf augmented_raw_syscalls.bpf: Move 'struct timespec64' to vmlinux.h")
> 
> This is a ppc64 le build.
> 
> I have used the perf tree from next-20240221 for today.

Ok, finally I managed to secure a ppc64 machine to test this and
sometimes I reproduce just like you reported, but sometimes I can't do
it, didn't manage to isolate what is that makes it fail sometimes, make
-C tools/perf clean, nuking the O= target directory, etc, when I
reproduce it:

  GENSKEL /tmp/build/perf-tools-next/util/bpf_skel/lock_contention.skel.h
util/bpf_skel/augmented_raw_syscalls.bpf.c:329:15: error: invalid application of 'sizeof' to an incomplete type 'struct timespec64'
  329 |         __u32 size = sizeof(struct timespec64);
      |                      ^     ~~~~~~~~~~~~~~~~~~~
util/bpf_skel/augmented_raw_syscalls.bpf.c:329:29: note: forward declaration of 'struct timespec64'
  329 |         __u32 size = sizeof(struct timespec64);
      |                                    ^
1 error generated.
make[2]: *** [Makefile.perf:1161: /tmp/build/perf-tools-next/util/bpf_skel/.tmp/augmented_raw_syscalls.bpf.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile.perf:264: sub-make] Error 2
make: *** [Makefile:113: install-bin] Error 2
make: Leaving directory '/home/acme/git/perf-tools-next/tools/perf'

$ cat /etc/redhat-release 
Red Hat Enterprise Linux release 9.5 Beta (Plow)
$
Linux host 5.14.0-425.el9.ppc64le #1 SMP Wed Feb 21 15:29:04 EST 2024 ppc64le ppc64le ppc64le GNU/Linux

$ clang -v
clang version 17.0.6 (Red Hat, Inc. 17.0.6-5.el9)
Target: ppc64le-redhat-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /opt/rh/gcc-toolset-13/root/usr/lib/gcc/ppc64le-redhat-linux/13
Selected GCC installation: /opt/rh/gcc-toolset-13/root/usr/lib/gcc/ppc64le-redhat-linux/13
Candidate multilib: .;@m64
Selected multilib: .;@m64


But this is an elusive bug, its not always that it fails :-\

$ git log --oneline -1
659663f0bccc (HEAD -> perf-tools-next, perf-tools-next/perf-tools-next) perf: script: prefer capstone to XED
$ file /tmp/build/perf-tools-next/util/bpf_skel/.tmp/augmented_raw_syscalls.bpf.o 
/tmp/build/perf-tools-next/util/bpf_skel/.tmp/augmented_raw_syscalls.bpf.o: ELF 64-bit LSB relocatable, eBPF, version 1 (SYSV), with debug_info, not stripped
$ 

That "incomplete" type is defined in:

$ grep timespec64 -B10 -A3 tools/perf/util/bpf_skel/vmlinux/vmlinux.h 

typedef __u8 u8;
typedef __u32 u32;
typedef __u64 u64;
typedef __s64 s64;

typedef int pid_t;

typedef __s64 time64_t;

struct timespec64 {
        time64_t        tv_sec;
        long int        tv_nsec;
};
$

But it is used only on this sizeof expression, that is used only by
clang and for the BPF target...

$ grep timespec64 tools/perf/util/bpf_skel/augmented_raw_syscalls.bpf.c
	__u32 size = sizeof(struct timespec64);
$

Stephen, can you try to reproduce this again? And if it fails, try
reproducing that 'sizeof(struct timespec64)' with 16, which is, in
ppc64:

$ uname -m
ppc64le
$ pahole timespec64
struct timespec64 {
	time64_t                   tv_sec;               /*     0     8 */
	long int                   tv_nsec;              /*     8     8 */

	/* size: 16, cachelines: 1, members: 2 */
	/* last cacheline: 16 bytes */
};

$ 

And on x86_64:

acme@x1:~$ uname -m
x86_64
acme@x1:~$ pahole timespec64
struct timespec64 {
	time64_t                   tv_sec;               /*     0     8 */
	long int                   tv_nsec;              /*     8     8 */

	/* size: 16, cachelines: 1, members: 2 */
	/* last cacheline: 16 bytes */
};

acme@x1:~$

- Arnaldo

^ permalink raw reply	[flat|nested] 57+ messages in thread

* linux-next: build failure after merge of the perf tree
@ 2024-02-21 23:06 Stephen Rothwell
  2024-02-23 19:50 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 57+ messages in thread
From: Stephen Rothwell @ 2024-02-21 23:06 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Namhyung Kim
  Cc: Arnaldo Carvalho de Melo, Arnaldo Carvalho de Melo,
	Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 754 bytes --]

Hi all,

After merging the perf tree, today's linux-next build (native perf)
failed like this:

util/bpf_skel/augmented_raw_syscalls.bpf.c:329:15: error: invalid application of 'sizeof' to an incomplete type 'struct timespec64'
        __u32 size = sizeof(struct timespec64);
                     ^     ~~~~~~~~~~~~~~~~~~~
util/bpf_skel/augmented_raw_syscalls.bpf.c:329:29: note: forward declaration of 'struct timespec64'
        __u32 size = sizeof(struct timespec64);
                                   ^

Caused by commit

  29d16de26df1 ("perf augmented_raw_syscalls.bpf: Move 'struct timespec64' to vmlinux.h")

This is a ppc64 le build.

I have used the perf tree from next-20240221 for today.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2024-02-06 23:40 Stephen Rothwell
@ 2024-02-07  0:02 ` Ian Rogers
  0 siblings, 0 replies; 57+ messages in thread
From: Ian Rogers @ 2024-02-07  0:02 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Arnaldo Carvalho de Melo, Namhyung Kim,
	Linux Kernel Mailing List, Linux Next Mailing List

On Tue, Feb 6, 2024 at 3:40 PM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Hi all,
>
> After merging the perf tree, today's linux-next build (native perf)
> failed like this:
>
> arch/powerpc/util/kvm-stat.c: In function 'is_tracepoint_available':
> arch/powerpc/util/kvm-stat.c:117:16: error: 'struct parse_events_error' has no member named 'str'
>   117 |         if (err.str)
>       |                ^
>
> Caused by commit
>
>   fd7b8e8fb20f ("perf parse-events: Print all errors")

Thanks, I sent:
https://lore.kernel.org/lkml/20240206235902.2917395-1-irogers@google.com/
to address this. Fwiw, it is great linux-next is able to spot issues
like this early.

Ian



Ian

> I have used the perf tree from next-20240206 for today.
>
> --
> Cheers,
> Stephen Rothwell

^ permalink raw reply	[flat|nested] 57+ messages in thread

* linux-next: build failure after merge of the perf tree
@ 2024-02-06 23:40 Stephen Rothwell
  2024-02-07  0:02 ` Ian Rogers
  0 siblings, 1 reply; 57+ messages in thread
From: Stephen Rothwell @ 2024-02-06 23:40 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Namhyung Kim
  Cc: Ian Rogers, Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 497 bytes --]

Hi all,

After merging the perf tree, today's linux-next build (native perf)
failed like this:

arch/powerpc/util/kvm-stat.c: In function 'is_tracepoint_available':
arch/powerpc/util/kvm-stat.c:117:16: error: 'struct parse_events_error' has no member named 'str'
  117 |         if (err.str)
      |                ^

Caused by commit

  fd7b8e8fb20f ("perf parse-events: Print all errors")

I have used the perf tree from next-20240206 for today.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2023-10-24 23:26 Stephen Rothwell
@ 2023-10-25  0:34 ` Namhyung Kim
  0 siblings, 0 replies; 57+ messages in thread
From: Namhyung Kim @ 2023-10-25  0:34 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Arnaldo Carvalho de Melo, Linux Kernel Mailing List,
	Linux Next Mailing List

Hello,

On Tue, Oct 24, 2023 at 4:27 PM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Hi all,
>
> After merging the perf tree, today's linux-next build (native perf)
> failed like this:
>
> perf/util/pmu-flex.c:1812:1: error: unterminated comment
>  1812 | /** Setup the input buffer state to scan a string. The next call to yylex() will
>       | ^
> perf/util/pmu-flex.c:550:24: error: 'yy_fatal_error' used but never defined [-Werror]
>   550 | static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
>       |                        ^~~~~~~~~~~~~~
>
> I don't know what caused this, but the above file looks fine and redoing
> the build works, so it may be some timing problem when doing an
> incremental build?

Yeah, I think I saw this error before.  Looks like a timing issue
but I believe something is wrong with it.  I'll take a look.

Thanks,
Namhyung

^ permalink raw reply	[flat|nested] 57+ messages in thread

* linux-next: build failure after merge of the perf tree
@ 2023-10-24 23:26 Stephen Rothwell
  2023-10-25  0:34 ` Namhyung Kim
  0 siblings, 1 reply; 57+ messages in thread
From: Stephen Rothwell @ 2023-10-24 23:26 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Namhyung Kim
  Cc: Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 678 bytes --]

Hi all,

After merging the perf tree, today's linux-next build (native perf)
failed like this:

perf/util/pmu-flex.c:1812:1: error: unterminated comment
 1812 | /** Setup the input buffer state to scan a string. The next call to yylex() will
      | ^
perf/util/pmu-flex.c:550:24: error: 'yy_fatal_error' used but never defined [-Werror]
  550 | static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
      |                        ^~~~~~~~~~~~~~

I don't know what caused this, but the above file looks fine and redoing
the build works, so it may be some timing problem when doing an
incremental build?

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2023-05-29 23:05 Stephen Rothwell
@ 2023-05-30  2:16 ` Ian Rogers
  0 siblings, 0 replies; 57+ messages in thread
From: Ian Rogers @ 2023-05-30  2:16 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Arnaldo Carvalho de Melo, Arnaldo Carvalho de Melo,
	Linux Kernel Mailing List, Linux Next Mailing List

On Mon, May 29, 2023 at 4:05 PM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Hi all,
>
> After merging the perf tree, today's linux-next build (powerpc perf)
> failed like this:
>
> arch/powerpc/util/kvm-stat.c: In function 'kvm_add_default_arch_event':
> arch/powerpc/util/kvm-stat.c:207:21: error: implicit declaration of function 'pmu_have_event'; did you mean 'perf_pmu__have_event'? [-Werror=implicit-function-declaration]
>   207 |                 if (pmu_have_event("trace_imc", "trace_cycles")) {
>       |                     ^~~~~~~~~~~~~~
>       |                     perf_pmu__have_event
>
> Caused by commit
>
>   1eaf496ed386 ("perf pmu: Separate pmu and pmus")
>
> I have used the perf tree from next-20230525 for today.

Apologies, the function was renamed to perf_pmus__have_event. I've
sent out a patch and confirmed this was the only issue on a cross
compile build with "NO_LIBELF=1 NO_LIBTRACEEVENT=1".

The 1-liner fix is here:
https://lore.kernel.org/lkml/20230530021433.3107580-1-irogers@google.com/

Thanks,
Ian



> --
> Cheers,
> Stephen Rothwell

^ permalink raw reply	[flat|nested] 57+ messages in thread

* linux-next: build failure after merge of the perf tree
@ 2023-05-29 23:05 Stephen Rothwell
  2023-05-30  2:16 ` Ian Rogers
  0 siblings, 1 reply; 57+ messages in thread
From: Stephen Rothwell @ 2023-05-29 23:05 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Arnaldo Carvalho de Melo, Ian Rogers, Linux Kernel Mailing List,
	Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 685 bytes --]

Hi all,

After merging the perf tree, today's linux-next build (powerpc perf)
failed like this:

arch/powerpc/util/kvm-stat.c: In function 'kvm_add_default_arch_event':
arch/powerpc/util/kvm-stat.c:207:21: error: implicit declaration of function 'pmu_have_event'; did you mean 'perf_pmu__have_event'? [-Werror=implicit-function-declaration]
  207 |                 if (pmu_have_event("trace_imc", "trace_cycles")) {
      |                     ^~~~~~~~~~~~~~
      |                     perf_pmu__have_event

Caused by commit

  1eaf496ed386 ("perf pmu: Separate pmu and pmus")

I have used the perf tree from next-20230525 for today.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2023-03-29 12:28               ` Arnaldo Carvalho de Melo
@ 2023-04-03  5:15                 ` Stephen Rothwell
  0 siblings, 0 replies; 57+ messages in thread
From: Stephen Rothwell @ 2023-04-03  5:15 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Ian Rogers, Arnaldo Carvalho de Melo, Linux Kernel Mailing List,
	Linux Next Mailing List, namhyung

[-- Attachment #1: Type: text/plain, Size: 552 bytes --]

Hi Arnaldo,

On Wed, 29 Mar 2023 09:28:39 -0300 Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
>
> > [On my arm64 machine:
> > 
> > $ ls -l /sys/kernel/btf/vmlinux
> > -r--r--r-- 1 root root 5209570 Mar 29 09:52 /sys/kernel/btf/vmlinux
> > 
> > and on my amd64 machine:
> > 
> > $ ls -l /sys/kernel/btf/vmlinux
> > -r--r--r-- 1 root root 8536946 Mar 29 10:04 /sys/kernel/btf/vmlinux
> > ]  
> 
> Everything should be working fine on those machines, right?

Sorry, I don;t build on those machines.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2023-03-28 23:06             ` Stephen Rothwell
@ 2023-03-29 12:28               ` Arnaldo Carvalho de Melo
  2023-04-03  5:15                 ` Stephen Rothwell
  0 siblings, 1 reply; 57+ messages in thread
From: Arnaldo Carvalho de Melo @ 2023-03-29 12:28 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Ian Rogers, Arnaldo Carvalho de Melo, Linux Kernel Mailing List,
	Linux Next Mailing List, namhyung

Em Wed, Mar 29, 2023 at 10:06:12AM +1100, Stephen Rothwell escreveu:
> Hi Arnaldo,
 
> On Tue, 28 Mar 2023 16:47:23 -0300 Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> > The config files you used don't match the running kernels
 
> This is just the way Debian names its kernel packages.
 
> > > $ uname -a
> > > Linux zz1 6.0.0-5-powerpc64le #1 SMP Debian 6.0.10-2 (2022-12-01) ppc64le GNU/Linux
>               ^^^^^^^^^^^^^^^^^^^
> > > $ ls -l /sys/kernel/bpf/
> > > ls: cannot access '/sys/kernel/bpf/': No such file or directory
> > > $ grep CONFIG_DEBUG_INFO_BTF /boot/config-6.0.0-5-powerpc64le
>                                               ^^^^^^^^^^^^^^^^^^^
> And so on.  It just happens that this kernel is based on v6.0.10.
 
> $ uname -r
> 6.0.0-5-powerpc64le
 
> So they are the correct config files.
 
> Also, the mail I replied to talked about checking /sys/kernel/bpf/ (not
> btf) :-(

Sorry about that, I replied from my smartphone, when on my workstation
I try to try the commands and copy'n'paste the whole command + output
sequence to avoid such mistakes.
 
> still on my build machine (of course):
 
> $ ls -l /sys/kernel/btf/
> ls: cannot access '/sys/kernel/btf/': No such file or directory
 
> So it seems that Debian do not build their powerpcle kernels with
> CONFIG_DEBUG_INFO_BTF. I don't know why not since all the dependencies
> seem to be OK.

Right, at this point they should if they want to properly support the
full set of BPF functionalities, notably CO-RE.
 
> [On my arm64 machine:
> 
> $ ls -l /sys/kernel/btf/vmlinux
> -r--r--r-- 1 root root 5209570 Mar 29 09:52 /sys/kernel/btf/vmlinux
> 
> and on my amd64 machine:
> 
> $ ls -l /sys/kernel/btf/vmlinux
> -r--r--r-- 1 root root 8536946 Mar 29 10:04 /sys/kernel/btf/vmlinux
> ]

Everything should be working fine on those machines, right?

- Arnaldo

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2023-03-28 19:47           ` Arnaldo Carvalho de Melo
@ 2023-03-28 23:06             ` Stephen Rothwell
  2023-03-29 12:28               ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 57+ messages in thread
From: Stephen Rothwell @ 2023-03-28 23:06 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Ian Rogers, Arnaldo Carvalho de Melo, Linux Kernel Mailing List,
	Linux Next Mailing List, namhyung

[-- Attachment #1: Type: text/plain, Size: 1417 bytes --]

Hi Arnaldo,

On Tue, 28 Mar 2023 16:47:23 -0300 Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> 
> The config files you used don't match the running kernels

This is just the way Debian names its kernel packages.

> > $ uname -a
> > Linux zz1 6.0.0-5-powerpc64le #1 SMP Debian 6.0.10-2 (2022-12-01) ppc64le GNU/Linux
              ^^^^^^^^^^^^^^^^^^^
> > $ ls -l /sys/kernel/bpf/
> > ls: cannot access '/sys/kernel/bpf/': No such file or directory
> > $ grep CONFIG_DEBUG_INFO_BTF /boot/config-6.0.0-5-powerpc64le
                                              ^^^^^^^^^^^^^^^^^^^

And so on.  It just happens that this kernel is based on v6.0.10.

$ uname -r
6.0.0-5-powerpc64le

So they are the correct config files.

Also, the mail I replied to talked about checking /sys/kernel/bpf/ (not
btf) :-(

still on my build machine (of course):

$ ls -l /sys/kernel/btf/
ls: cannot access '/sys/kernel/btf/': No such file or directory

So it seems that Debian do not build their powerpcle kernels with
CONFIG_DEBUG_INFO_BTF. I don't know why not since all the dependencies
seem to be OK.

[On my arm64 machine:

$ ls -l /sys/kernel/btf/vmlinux
-r--r--r-- 1 root root 5209570 Mar 29 09:52 /sys/kernel/btf/vmlinux

and on my amd64 machine:

$ ls -l /sys/kernel/btf/vmlinux
-r--r--r-- 1 root root 8536946 Mar 29 10:04 /sys/kernel/btf/vmlinux
]
-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2023-03-28  1:33         ` Stephen Rothwell
@ 2023-03-28 19:47           ` Arnaldo Carvalho de Melo
  2023-03-28 23:06             ` Stephen Rothwell
  0 siblings, 1 reply; 57+ messages in thread
From: Arnaldo Carvalho de Melo @ 2023-03-28 19:47 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Ian Rogers, Arnaldo Carvalho de Melo, Linux Kernel Mailing List,
	Linux Next Mailing List, namhyung

Em Tue, Mar 28, 2023 at 12:33:32PM +1100, Stephen Rothwell escreveu:
> Hi Arnaldo,
> 
> Just a few datapoints:
> 
> My build machine (Debian Testing PowerpcLE, not quite the latest
> kernel):
 
> On Thu, 23 Mar 2023 10:27:36 -0300 Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> >  Which improves a bit the situation.
> > 
> > We could check if bpftool is available and if not, suggest installing
> > it.
> 
> $ ls -l /usr/sbin/bpftool
> -rwxr-xr-x 1 root root 790504 Mar  6 02:33 /usr/sbin/bpftool
> 
> > If it is available, we could check if /sys/kernel/bpf/ is available, if
> > not suggest using a kernel with CONFIG_DEBUG_INFO_BTF=y, as most distros
> > have by now.

The config files you used don't match the running kernels
 
> $ uname -a
> Linux zz1 6.0.0-5-powerpc64le #1 SMP Debian 6.0.10-2 (2022-12-01) ppc64le GNU/Linux
> $ ls -l /sys/kernel/bpf/
> ls: cannot access '/sys/kernel/bpf/': No such file or directory
> $ grep CONFIG_DEBUG_INFO_BTF /boot/config-6.0.0-5-powerpc64le
> # CONFIG_DEBUG_INFO_BTF is not set
> 
> And in the latest powerpc64le kernel:
> 
> $ grep CONFIG_DEBUG_INFO_BTF /boot/config-6.1.0-5-powerpc64le
> # CONFIG_DEBUG_INFO_BTF is not set
> 
> Debian Testing arm64, not quite the latest kernel:
> 
> $ uname -a
> Linux oak 6.1.0-5-arm64 #1 SMP Debian 6.1.12-1 (2023-02-15) aarch64 GNU/Linux
> $ ls -l /sys/kernel/bpf/
> ls: cannot access '/sys/kernel/bpf/': No such file or directory
> $ grep CONFIG_DEBUG_INFO_BTF /boot/config-6.1.0-5-arm64
> CONFIG_DEBUG_INFO_BTF=y
> CONFIG_DEBUG_INFO_BTF_MODULES=y

The running kernel is 6.1.12-1, the .config is 6.1.0-5

> Debian Testing amd64, the latest kernel:
> 
> $ uname -a
> Linux pine 6.1.0-6-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.15-1 (2023-03-05) x86_64 GNU/Linux
> $ ls -l /sys/kernel/bpf/
> ls: cannot access '/sys/kernel/bpf/': No such file or directory
> $ grep CONFIG_DEBUG_INFO_BTF /boot/config-6.1.0-6-amd64
> CONFIG_DEBUG_INFO_BTF=y
> CONFIG_DEBUG_INFO_BTF_MODULES=y


Ditto, 6.1.15-1 != 6.1.0-6

> 
> Debian Stable amd64, the latest kernel:
> 
> $ uname -a
> Linux gimli 5.10.0-21-cloud-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64 GNU/Linux
> $ ls -l /sys/kernel/bpf/
> ls: cannot access '/sys/kernel/bpf/': No such file or directory
> $ grep CONFIG_DEBUG_INFO_BTF /boot/config-5.10.0-21-cloud-amd64
> CONFIG_DEBUG_INFO_BTF=y

Ditto, 5.10.162-1  != 5.10.0-21-cloud

Here:

[acme@quaco pahole]$ grep CONFIG_DEBUG_INFO_BTF /boot/config-`uname -r`
CONFIG_DEBUG_INFO_BTF=y
CONFIG_DEBUG_INFO_BTF_MODULES=y
[acme@quaco pahole]$ uname -r
6.1.18-100.fc36.x86_64
[acme@quaco pahole]$

[acme@quaco pahole]$ ls -la /sys/kernel/btf/vmlinux
-r--r--r--. 1 root root 5499812 Mar 20 17:45 /sys/kernel/btf/vmlinux
[acme@quaco pahole]$ ls -la /sys/kernel/btf/nfsv4
-r--r--r--. 1 root root 319948 Mar 28 16:46 /sys/kernel/btf/nfsv4
[acme@quaco pahole]$ lsmod | grep -w nfsv4
nfsv4                1085440  1
dns_resolver           16384  1 nfsv4
nfs                   532480  2 nfsv4
sunrpc                704512  26 nfsd,rpcrdma,nfsv4,auth_rpcgss,lockd,rpcsec_gss_krb5,nfs_acl,nfs
[acme@quaco pahole]$ ls -la /sys/kernel/btf/nfsd
-r--r--r--. 1 root root 596066 Mar 28 16:46 /sys/kernel/btf/nfsd
[acme@quaco pahole]$ ls -la /sys/kernel/btf/lockd
-r--r--r--. 1 root root 180234 Mar 28 16:46 /sys/kernel/btf/lockd
[acme@quaco pahole]$
 
> -- 
> Cheers,
> Stephen Rothwell

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2023-03-23 13:27       ` Arnaldo Carvalho de Melo
  2023-03-27 20:31         ` Ian Rogers
@ 2023-03-28  1:33         ` Stephen Rothwell
  2023-03-28 19:47           ` Arnaldo Carvalho de Melo
  1 sibling, 1 reply; 57+ messages in thread
From: Stephen Rothwell @ 2023-03-28  1:33 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Ian Rogers, Arnaldo Carvalho de Melo, Linux Kernel Mailing List,
	Linux Next Mailing List, namhyung

[-- Attachment #1: Type: text/plain, Size: 2094 bytes --]

Hi Arnaldo,

Just a few datapoints:

My build machine (Debian Testing PowerpcLE, not quite the latest
kernel):

On Thu, 23 Mar 2023 10:27:36 -0300 Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
>  Which improves a bit the situation.
> 
> We could check if bpftool is available and if not, suggest installing
> it.

$ ls -l /usr/sbin/bpftool
-rwxr-xr-x 1 root root 790504 Mar  6 02:33 /usr/sbin/bpftool

> If it is available, we could check if /sys/kernel/bpf/ is available, if
> not suggest using a kernel with CONFIG_DEBUG_INFO_BTF=y, as most distros
> have by now.

$ uname -a
Linux zz1 6.0.0-5-powerpc64le #1 SMP Debian 6.0.10-2 (2022-12-01) ppc64le GNU/Linux
$ ls -l /sys/kernel/bpf/
ls: cannot access '/sys/kernel/bpf/': No such file or directory
$ grep CONFIG_DEBUG_INFO_BTF /boot/config-6.0.0-5-powerpc64le
# CONFIG_DEBUG_INFO_BTF is not set

And in the latest powerpc64le kernel:

$ grep CONFIG_DEBUG_INFO_BTF /boot/config-6.1.0-5-powerpc64le
# CONFIG_DEBUG_INFO_BTF is not set

Debian Testing arm64, not quite the latest kernel:

$ uname -a
Linux oak 6.1.0-5-arm64 #1 SMP Debian 6.1.12-1 (2023-02-15) aarch64 GNU/Linux
$ ls -l /sys/kernel/bpf/
ls: cannot access '/sys/kernel/bpf/': No such file or directory
$ grep CONFIG_DEBUG_INFO_BTF /boot/config-6.1.0-5-arm64
CONFIG_DEBUG_INFO_BTF=y
CONFIG_DEBUG_INFO_BTF_MODULES=y

Debian Testing amd64, the latest kernel:

$ uname -a
Linux pine 6.1.0-6-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.15-1 (2023-03-05) x86_64 GNU/Linux
$ ls -l /sys/kernel/bpf/
ls: cannot access '/sys/kernel/bpf/': No such file or directory
$ grep CONFIG_DEBUG_INFO_BTF /boot/config-6.1.0-6-amd64
CONFIG_DEBUG_INFO_BTF=y
CONFIG_DEBUG_INFO_BTF_MODULES=y

Debian Stable amd64, the latest kernel:

$ uname -a
Linux gimli 5.10.0-21-cloud-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64 GNU/Linux
$ ls -l /sys/kernel/bpf/
ls: cannot access '/sys/kernel/bpf/': No such file or directory
$ grep CONFIG_DEBUG_INFO_BTF /boot/config-5.10.0-21-cloud-amd64
CONFIG_DEBUG_INFO_BTF=y

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2023-03-23 13:27       ` Arnaldo Carvalho de Melo
@ 2023-03-27 20:31         ` Ian Rogers
  2023-03-28  1:33         ` Stephen Rothwell
  1 sibling, 0 replies; 57+ messages in thread
From: Ian Rogers @ 2023-03-27 20:31 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Stephen Rothwell, Arnaldo Carvalho de Melo,
	Linux Kernel Mailing List, Linux Next Mailing List, namhyung

On Thu, Mar 23, 2023 at 6:27 AM Arnaldo Carvalho de Melo
<acme@kernel.org> wrote:
>
> Em Thu, Mar 23, 2023 at 09:54:37AM +1100, Stephen Rothwell escreveu:
> > Hi Ian,
> >
> > On Wed, 22 Mar 2023 11:37:31 -0700 Ian Rogers <irogers@google.com> wrote:
> > >
> > > On Tue, Mar 21, 2023 at 2:40 PM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> > > >
> > > > Hi all,
> > > >
> > > > On Fri, 17 Mar 2023 09:50:25 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> > > > >
> > > > > After merging the perf tree, today's linux-next build (native perf)
> > > > > failed like this:
> > > > >
> > > > > Auto-detecting system features:
> > > > > ...                         clang-bpf-co-re: [  [32mon [m  ]
> > > > > ...                                    llvm: [  [31mOFF [m ]
> > > > > ...                                  libcap: [  [32mon [m  ]
> > > > > ...                                  libbfd: [  [32mon [m  ]
> > > > >
> > > > > make[1]: *** Deleting file '/home/sfr/next/perf/util/bpf_skel/vmlinux.h'
> > > > > libbpf: failed to find '.BTF' ELF section in /boot/vmlinux-6.0.0-5-powerpc64le
> > > > > Error: failed to load BTF from /boot/vmlinux-6.0.0-5-powerpc64le: No data available
> > > > > make[1]: *** [Makefile.perf:1075: /home/sfr/next/perf/util/bpf_skel/vmlinux.h] Error 195
> > > > > make[1]: *** Waiting for unfinished jobs....
> > > > > make: *** [Makefile.perf:236: sub-make] Error 2
> > > > > Command exited with non-zero status 2
> > > > >
> > > > > To be clear this is a native build of perf on a PPC64le host using this
> > > > > command line:
> > > > >
> > > > > make -C tools/perf -f Makefile.perf -s -O -j60 O=../perf EXTRA_CFLAGS=-Wno-psabi
> > > > >
> > > > > (I could probably remove the EXTRA_CLFAGS now that I am building with
> > > > > gcc 12.2)
> > > > >
> > > > > I don't know which commit caused this.
> > > > >
> > > > > I have used the perf tree from next-20230316 for today.
> > > >
> > > > I am still getting this build failure.
>
> > > The build failure is intentional as not having BPF skeleton support in
> > > the perf tool will remove features. I've just sent:
> > > https://lore.kernel.org/lkml/20230322183108.1380882-1-irogers@google.com/
> > > Which will recommend adding NO_BPF_SKEL=1 to your build options when
> > > this failure occurs. I didn't think a features test was appropriate
> > > for this as the feature test would basically replicate the vmlinux.h
> > > generation and I didn't want to move that support through the build
> > > system.
>
> > I was trying to understand why this step fails, but from the error
> > messages, it seems to require something to be present in the distro
> > supplied kernel image?  Is there something missing from the ppc
> > build process?  Or toolchain?  Why is it looking at the installed
> > kernel and not the built kernel?  Does the perf build now depend on the
> > kernel being built first?
> >
> > I will add NO_BPF_SKEL=1 to my build from tomorrow, but surely that
> > means that we miss some perf build testing :-(
>
> Before this BUILD_BPF_SKEL wasn't on by default, so you're back testing
> as much as before.
>
> Having said that, we need to improve the warning and I processed a patch
> from Ian to that extent:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git/commit/?h=tmp.perf-tools-next&id=12a83df53444165d39d3e09fcd9627e7bec7828e
>
>  $(SKEL_OUT)/vmlinux.h: $(VMLINUX_BTF) $(BPFTOOL)
>  ifeq ($(VMLINUX_H),)
> -       $(QUIET_GEN)$(BPFTOOL) btf dump file $< format c > $@
> +       $(QUIET_GEN)$(BPFTOOL) btf dump file $< format c > $@ || \
> +       (echo "Failure to generate vmlinux.h needed for the recommended BPF skeleton support." && \
> +       echo "To disable this use the build option NO_BPF_SKEL=1." && \
> +       echo "Alternatively point at a pre-generated vmlinux.h with VMLINUX_H=<path>." && \
> +       false)
>  else
>         $(Q)cp "$(VMLINUX_H)" $@
>  endif
>
>  Which improves a bit the situation.
>
> We could check if bpftool is available and if not, suggest installing
> it.
>
> If it is available, we could check if /sys/kernel/bpf/ is available, if
> not suggest using a kernel with CONFIG_DEBUG_INFO_BTF=y, as most distros
> have by now.
>
> As to the features this enables:
>
> ⬢[acme@toolbox perf-tools-next]$ ls -la tools/perf/util/bpf_skel/*.c
> -rw-r--r--. 1 acme acme 5581 Oct 17 09:07 tools/perf/util/bpf_skel/bperf_cgroup.bpf.c
> -rw-r--r--. 1 acme acme 1764 May  5  2022 tools/perf/util/bpf_skel/bperf_follower.bpf.c
> -rw-r--r--. 1 acme acme 1438 May  5  2022 tools/perf/util/bpf_skel/bperf_leader.bpf.c
> -rw-r--r--. 1 acme acme 2290 May  5  2022 tools/perf/util/bpf_skel/bpf_prog_profiler.bpf.c
> -rw-r--r--. 1 acme acme 2164 May  5  2022 tools/perf/util/bpf_skel/func_latency.bpf.c
> -rw-r--r--. 1 acme acme 9017 Aug 26  2022 tools/perf/util/bpf_skel/kwork_trace.bpf.c
> -rw-r--r--. 1 acme acme 9251 Mar 14 08:33 tools/perf/util/bpf_skel/lock_contention.bpf.c
> -rw-r--r--. 1 acme acme 6109 Feb 27 17:47 tools/perf/util/bpf_skel/off_cpu.bpf.c
> -rw-r--r--. 1 acme acme 4310 Mar 15 11:08 tools/perf/util/bpf_skel/sample_filter.bpf.c
> ⬢[acme@toolbox perf-tools-next]$
>
> For instance, take a look at these csets:
>
> ⬢[acme@toolbox perf-tools-next]$ git log --oneline tools/perf/util/bpf_skel/lock_contention.bpf.c
> d24c0144b1dde00f perf lock contention: Show per-cpu rq_lock with address
> 1811e82767dcc6eb perf lock contention: Track and show siglock with address
> 3ace2435bb93445e perf lock contention: Track and show mmap_lock with address
> 17535a33a9c1e4fb perf lock contention: Fix compiler builtin detection
> 1bece1351c653c3d perf lock contention: Support old rw_semaphore type
> 3477f079fe70b3c9 perf lock contention: Add -o/--lock-owner option
> ebab291641bed48f perf lock contention: Support filters for different aggregation
> 5e3febe7b7b99f94 perf lock contention: Support lock addr/name filtering for BPF
> 529772c4df286159 perf lock contention: Support lock type filtering for BPF
> 688d2e8de231c54e perf lock contention: Add -l/--lock-addr option
> eca949b2b4addd94 perf lock contention: Implement -t/--threads option for BPF
> fd507d3e359c7e06 perf lock contention: Add lock_data.h for common data
> c66a36af7ba3a628 perf lock contention: Do not use BPF task local storage
> 433b31fa00797a2a perf lock contention: Fix a build error on 32-bit
> c1da8dd5c11dabd5 perf lock contention: Skip stack trace from BPF
> 6d499a6b3d90277d perf lock: Print the number of lost entries for BPF
> 6fda2405f414b24a perf lock: Implement cpu and task filters for BPF
> 407b36f69efbdccf perf lock: Use BPF for lock contention analysis
> ⬢[acme@toolbox perf-tools-next]$
>
>
> or:
>
> ⬢[acme@toolbox perf-tools-next]$ git log --oneline tools/perf/util/bpf_skel/kwork_trace.bpf.c
> acfb65fe1d11a97f perf kwork: Add workqueue trace BPF support
> 5a81927a407c050a perf kwork: Add softirq trace BPF support
> 420298aefe94840f perf kwork: Add IRQ trace BPF support
> daf07d220710a3c8 perf kwork: Implement BPF trace
> ⬢[acme@toolbox perf-tools-next]$
>
> So we need to fine tune this detection of needed components to build
> these features, in time for the v6.4 merge window, that is why we
> decided  to make this opt-out to hammer out problems.
>
> Other arches probably will hit some of these problems, lets try to
> encourage others to try what is in linux-next.

Just to throw out, perhaps we could ship a vmlinux.h in the perf
source tree. We could also validate it with something similar to the
header file checking. This would remove the bpftool and properly built
kernel issues. It may make a package maintainer's life easier.

Thanks,
Ian

> - Arnaldo

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2023-03-22 22:54     ` Stephen Rothwell
@ 2023-03-23 13:27       ` Arnaldo Carvalho de Melo
  2023-03-27 20:31         ` Ian Rogers
  2023-03-28  1:33         ` Stephen Rothwell
  0 siblings, 2 replies; 57+ messages in thread
From: Arnaldo Carvalho de Melo @ 2023-03-23 13:27 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Ian Rogers, Arnaldo Carvalho de Melo, Linux Kernel Mailing List,
	Linux Next Mailing List, namhyung

Em Thu, Mar 23, 2023 at 09:54:37AM +1100, Stephen Rothwell escreveu:
> Hi Ian,
> 
> On Wed, 22 Mar 2023 11:37:31 -0700 Ian Rogers <irogers@google.com> wrote:
> >
> > On Tue, Mar 21, 2023 at 2:40 PM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> > >
> > > Hi all,
> > >
> > > On Fri, 17 Mar 2023 09:50:25 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:  
> > > >
> > > > After merging the perf tree, today's linux-next build (native perf)
> > > > failed like this:
> > > >
> > > > Auto-detecting system features:
> > > > ...                         clang-bpf-co-re: [  [32mon [m  ]
> > > > ...                                    llvm: [  [31mOFF [m ]
> > > > ...                                  libcap: [  [32mon [m  ]
> > > > ...                                  libbfd: [  [32mon [m  ]
> > > >
> > > > make[1]: *** Deleting file '/home/sfr/next/perf/util/bpf_skel/vmlinux.h'
> > > > libbpf: failed to find '.BTF' ELF section in /boot/vmlinux-6.0.0-5-powerpc64le
> > > > Error: failed to load BTF from /boot/vmlinux-6.0.0-5-powerpc64le: No data available
> > > > make[1]: *** [Makefile.perf:1075: /home/sfr/next/perf/util/bpf_skel/vmlinux.h] Error 195
> > > > make[1]: *** Waiting for unfinished jobs....
> > > > make: *** [Makefile.perf:236: sub-make] Error 2
> > > > Command exited with non-zero status 2
> > > >
> > > > To be clear this is a native build of perf on a PPC64le host using this
> > > > command line:
> > > >
> > > > make -C tools/perf -f Makefile.perf -s -O -j60 O=../perf EXTRA_CFLAGS=-Wno-psabi
> > > >
> > > > (I could probably remove the EXTRA_CLFAGS now that I am building with
> > > > gcc 12.2)
> > > >
> > > > I don't know which commit caused this.
> > > >
> > > > I have used the perf tree from next-20230316 for today.  
> > >
> > > I am still getting this build failure.  

> > The build failure is intentional as not having BPF skeleton support in
> > the perf tool will remove features. I've just sent:
> > https://lore.kernel.org/lkml/20230322183108.1380882-1-irogers@google.com/
> > Which will recommend adding NO_BPF_SKEL=1 to your build options when
> > this failure occurs. I didn't think a features test was appropriate
> > for this as the feature test would basically replicate the vmlinux.h
> > generation and I didn't want to move that support through the build
> > system.
 
> I was trying to understand why this step fails, but from the error
> messages, it seems to require something to be present in the distro
> supplied kernel image?  Is there something missing from the ppc
> build process?  Or toolchain?  Why is it looking at the installed
> kernel and not the built kernel?  Does the perf build now depend on the
> kernel being built first?
> 
> I will add NO_BPF_SKEL=1 to my build from tomorrow, but surely that
> means that we miss some perf build testing :-(

Before this BUILD_BPF_SKEL wasn't on by default, so you're back testing
as much as before.

Having said that, we need to improve the warning and I processed a patch
from Ian to that extent:

https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git/commit/?h=tmp.perf-tools-next&id=12a83df53444165d39d3e09fcd9627e7bec7828e

 $(SKEL_OUT)/vmlinux.h: $(VMLINUX_BTF) $(BPFTOOL)
 ifeq ($(VMLINUX_H),)
-	$(QUIET_GEN)$(BPFTOOL) btf dump file $< format c > $@
+	$(QUIET_GEN)$(BPFTOOL) btf dump file $< format c > $@ || \
+	(echo "Failure to generate vmlinux.h needed for the recommended BPF skeleton support." && \
+	echo "To disable this use the build option NO_BPF_SKEL=1." && \
+	echo "Alternatively point at a pre-generated vmlinux.h with VMLINUX_H=<path>." && \
+	false)
 else
 	$(Q)cp "$(VMLINUX_H)" $@
 endif

 Which improves a bit the situation.

We could check if bpftool is available and if not, suggest installing
it.

If it is available, we could check if /sys/kernel/bpf/ is available, if
not suggest using a kernel with CONFIG_DEBUG_INFO_BTF=y, as most distros
have by now.

As to the features this enables:

⬢[acme@toolbox perf-tools-next]$ ls -la tools/perf/util/bpf_skel/*.c
-rw-r--r--. 1 acme acme 5581 Oct 17 09:07 tools/perf/util/bpf_skel/bperf_cgroup.bpf.c
-rw-r--r--. 1 acme acme 1764 May  5  2022 tools/perf/util/bpf_skel/bperf_follower.bpf.c
-rw-r--r--. 1 acme acme 1438 May  5  2022 tools/perf/util/bpf_skel/bperf_leader.bpf.c
-rw-r--r--. 1 acme acme 2290 May  5  2022 tools/perf/util/bpf_skel/bpf_prog_profiler.bpf.c
-rw-r--r--. 1 acme acme 2164 May  5  2022 tools/perf/util/bpf_skel/func_latency.bpf.c
-rw-r--r--. 1 acme acme 9017 Aug 26  2022 tools/perf/util/bpf_skel/kwork_trace.bpf.c
-rw-r--r--. 1 acme acme 9251 Mar 14 08:33 tools/perf/util/bpf_skel/lock_contention.bpf.c
-rw-r--r--. 1 acme acme 6109 Feb 27 17:47 tools/perf/util/bpf_skel/off_cpu.bpf.c
-rw-r--r--. 1 acme acme 4310 Mar 15 11:08 tools/perf/util/bpf_skel/sample_filter.bpf.c
⬢[acme@toolbox perf-tools-next]$

For instance, take a look at these csets:

⬢[acme@toolbox perf-tools-next]$ git log --oneline tools/perf/util/bpf_skel/lock_contention.bpf.c
d24c0144b1dde00f perf lock contention: Show per-cpu rq_lock with address
1811e82767dcc6eb perf lock contention: Track and show siglock with address
3ace2435bb93445e perf lock contention: Track and show mmap_lock with address
17535a33a9c1e4fb perf lock contention: Fix compiler builtin detection
1bece1351c653c3d perf lock contention: Support old rw_semaphore type
3477f079fe70b3c9 perf lock contention: Add -o/--lock-owner option
ebab291641bed48f perf lock contention: Support filters for different aggregation
5e3febe7b7b99f94 perf lock contention: Support lock addr/name filtering for BPF
529772c4df286159 perf lock contention: Support lock type filtering for BPF
688d2e8de231c54e perf lock contention: Add -l/--lock-addr option
eca949b2b4addd94 perf lock contention: Implement -t/--threads option for BPF
fd507d3e359c7e06 perf lock contention: Add lock_data.h for common data
c66a36af7ba3a628 perf lock contention: Do not use BPF task local storage
433b31fa00797a2a perf lock contention: Fix a build error on 32-bit
c1da8dd5c11dabd5 perf lock contention: Skip stack trace from BPF
6d499a6b3d90277d perf lock: Print the number of lost entries for BPF
6fda2405f414b24a perf lock: Implement cpu and task filters for BPF
407b36f69efbdccf perf lock: Use BPF for lock contention analysis
⬢[acme@toolbox perf-tools-next]$


or:

⬢[acme@toolbox perf-tools-next]$ git log --oneline tools/perf/util/bpf_skel/kwork_trace.bpf.c
acfb65fe1d11a97f perf kwork: Add workqueue trace BPF support
5a81927a407c050a perf kwork: Add softirq trace BPF support
420298aefe94840f perf kwork: Add IRQ trace BPF support
daf07d220710a3c8 perf kwork: Implement BPF trace
⬢[acme@toolbox perf-tools-next]$

So we need to fine tune this detection of needed components to build
these features, in time for the v6.4 merge window, that is why we
decided  to make this opt-out to hammer out problems.

Other arches probably will hit some of these problems, lets try to
encourage others to try what is in linux-next.

- Arnaldo

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2023-03-22 18:37   ` Ian Rogers
@ 2023-03-22 22:54     ` Stephen Rothwell
  2023-03-23 13:27       ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 57+ messages in thread
From: Stephen Rothwell @ 2023-03-22 22:54 UTC (permalink / raw)
  To: Ian Rogers
  Cc: Arnaldo Carvalho de Melo, Linux Kernel Mailing List,
	Linux Next Mailing List, namhyung

[-- Attachment #1: Type: text/plain, Size: 2730 bytes --]

Hi Ian,

On Wed, 22 Mar 2023 11:37:31 -0700 Ian Rogers <irogers@google.com> wrote:
>
> On Tue, Mar 21, 2023 at 2:40 PM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> >
> > Hi all,
> >
> > On Fri, 17 Mar 2023 09:50:25 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:  
> > >
> > > After merging the perf tree, today's linux-next build (native perf)
> > > failed like this:
> > >
> > > Auto-detecting system features:
> > > ...                         clang-bpf-co-re: [  [32mon [m  ]
> > > ...                                    llvm: [  [31mOFF [m ]
> > > ...                                  libcap: [  [32mon [m  ]
> > > ...                                  libbfd: [  [32mon [m  ]
> > >
> > > make[1]: *** Deleting file '/home/sfr/next/perf/util/bpf_skel/vmlinux.h'
> > > libbpf: failed to find '.BTF' ELF section in /boot/vmlinux-6.0.0-5-powerpc64le
> > > Error: failed to load BTF from /boot/vmlinux-6.0.0-5-powerpc64le: No data available
> > > make[1]: *** [Makefile.perf:1075: /home/sfr/next/perf/util/bpf_skel/vmlinux.h] Error 195
> > > make[1]: *** Waiting for unfinished jobs....
> > > make: *** [Makefile.perf:236: sub-make] Error 2
> > > Command exited with non-zero status 2
> > >
> > > To be clear this is a native build of perf on a PPC64le host using this
> > > command line:
> > >
> > > make -C tools/perf -f Makefile.perf -s -O -j60 O=../perf EXTRA_CFLAGS=-Wno-psabi
> > >
> > > (I could probably remove the EXTRA_CLFAGS now that I am building with
> > > gcc 12.2)
> > >
> > > I don't know which commit caused this.
> > >
> > > I have used the perf tree from next-20230316 for today.  
> >
> > I am still getting this build failure.  
> 
> The build failure is intentional as not having BPF skeleton support in
> the perf tool will remove features. I've just sent:
> https://lore.kernel.org/lkml/20230322183108.1380882-1-irogers@google.com/
> Which will recommend adding NO_BPF_SKEL=1 to your build options when
> this failure occurs. I didn't think a features test was appropriate
> for this as the feature test would basically replicate the vmlinux.h
> generation and I didn't want to move that support through the build
> system.

I was trying to understand why this step fails, but from the error
messages, it seems to require something to be present in the distro
supplied kernel image?  Is there something missing from the ppc
build process?  Or toolchain?  Why is it looking at the installed
kernel and not the built kernel?  Does the perf build now depend on the
kernel being built first?

I will add NO_BPF_SKEL=1 to my build from tomorrow, but surely that
means that we miss some perf build testing :-(
-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2023-03-21 21:39 ` Stephen Rothwell
@ 2023-03-22 18:37   ` Ian Rogers
  2023-03-22 22:54     ` Stephen Rothwell
  0 siblings, 1 reply; 57+ messages in thread
From: Ian Rogers @ 2023-03-22 18:37 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Arnaldo Carvalho de Melo, Linux Kernel Mailing List,
	Linux Next Mailing List, namhyung

On Tue, Mar 21, 2023 at 2:40 PM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Hi all,
>
> On Fri, 17 Mar 2023 09:50:25 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> >
> > After merging the perf tree, today's linux-next build (native perf)
> > failed like this:
> >
> > Auto-detecting system features:
> > ...                         clang-bpf-co-re: [  [32mon [m  ]
> > ...                                    llvm: [  [31mOFF [m ]
> > ...                                  libcap: [  [32mon [m  ]
> > ...                                  libbfd: [  [32mon [m  ]
> >
> > make[1]: *** Deleting file '/home/sfr/next/perf/util/bpf_skel/vmlinux.h'
> > libbpf: failed to find '.BTF' ELF section in /boot/vmlinux-6.0.0-5-powerpc64le
> > Error: failed to load BTF from /boot/vmlinux-6.0.0-5-powerpc64le: No data available
> > make[1]: *** [Makefile.perf:1075: /home/sfr/next/perf/util/bpf_skel/vmlinux.h] Error 195
> > make[1]: *** Waiting for unfinished jobs....
> > make: *** [Makefile.perf:236: sub-make] Error 2
> > Command exited with non-zero status 2
> >
> > To be clear this is a native build of perf on a PPC64le host using this
> > command line:
> >
> > make -C tools/perf -f Makefile.perf -s -O -j60 O=../perf EXTRA_CFLAGS=-Wno-psabi
> >
> > (I could probably remove the EXTRA_CLFAGS now that I am building with
> > gcc 12.2)
> >
> > I don't know which commit caused this.
> >
> > I have used the perf tree from next-20230316 for today.
>
> I am still getting this build failure.

Hi Stephen,

The build failure is intentional as not having BPF skeleton support in
the perf tool will remove features. I've just sent:
https://lore.kernel.org/lkml/20230322183108.1380882-1-irogers@google.com/
Which will recommend adding NO_BPF_SKEL=1 to your build options when
this failure occurs. I didn't think a features test was appropriate
for this as the feature test would basically replicate the vmlinux.h
generation and I didn't want to move that support through the build
system.

Thanks,
Ian

> --
> Cheers,
> Stephen Rothwell

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2023-03-16 22:50 Stephen Rothwell
  2023-03-16 23:11 ` Arnaldo Carvalho de Melo
@ 2023-03-21 21:39 ` Stephen Rothwell
  2023-03-22 18:37   ` Ian Rogers
  1 sibling, 1 reply; 57+ messages in thread
From: Stephen Rothwell @ 2023-03-21 21:39 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Linux Kernel Mailing List, Linux Next Mailing List, Ian Rogers, namhyung

[-- Attachment #1: Type: text/plain, Size: 1424 bytes --]

Hi all,

On Fri, 17 Mar 2023 09:50:25 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> After merging the perf tree, today's linux-next build (native perf)
> failed like this:
> 
> Auto-detecting system features:
> ...                         clang-bpf-co-re: [ ^[[32mon^[[m  ]
> ...                                    llvm: [ ^[[31mOFF^[[m ]
> ...                                  libcap: [ ^[[32mon^[[m  ]
> ...                                  libbfd: [ ^[[32mon^[[m  ]
> 
> make[1]: *** Deleting file '/home/sfr/next/perf/util/bpf_skel/vmlinux.h'
> libbpf: failed to find '.BTF' ELF section in /boot/vmlinux-6.0.0-5-powerpc64le
> Error: failed to load BTF from /boot/vmlinux-6.0.0-5-powerpc64le: No data available
> make[1]: *** [Makefile.perf:1075: /home/sfr/next/perf/util/bpf_skel/vmlinux.h] Error 195
> make[1]: *** Waiting for unfinished jobs....
> make: *** [Makefile.perf:236: sub-make] Error 2
> Command exited with non-zero status 2
> 
> To be clear this is a native build of perf on a PPC64le host using this
> command line:
> 
> make -C tools/perf -f Makefile.perf -s -O -j60 O=../perf EXTRA_CFLAGS=-Wno-psabi
> 
> (I could probably remove the EXTRA_CLFAGS now that I am building with
> gcc 12.2)
> 
> I don't know which commit caused this.
> 
> I have used the perf tree from next-20230316 for today.

I am still getting this build failure.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2023-03-16 23:55   ` Stephen Rothwell
@ 2023-03-17  3:23     ` Ian Rogers
  0 siblings, 0 replies; 57+ messages in thread
From: Ian Rogers @ 2023-03-17  3:23 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Arnaldo Carvalho de Melo, Linux Kernel Mailing List,
	Linux Next Mailing List, namhyung

On Thu, Mar 16, 2023 at 4:55 PM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Hi Arnaldo,
>
> On Thu, 16 Mar 2023 20:11:11 -0300 Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com> wrote:
> >
> > Can you try adding NO_BPF_SKEL=1 to the make -C tools/perf command line?
>
> That made it build.  Can that be automated, or is there something else
> I need to install to make it work?  Or, at least can the error be made
> more informative?

Good idea. I'll look into a feature test to cover this. For context
the change that altered the behavior was:
https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git/commit/?h=perf-tools-next&id=a980755beb5aca9002e1c95ba519b83a44242b5b

Thanks,
Ian

> --
> Cheers,
> Stephen Rothwell

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2023-03-16 23:11 ` Arnaldo Carvalho de Melo
@ 2023-03-16 23:55   ` Stephen Rothwell
  2023-03-17  3:23     ` Ian Rogers
  0 siblings, 1 reply; 57+ messages in thread
From: Stephen Rothwell @ 2023-03-16 23:55 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Linux Kernel Mailing List, Linux Next Mailing List, irogers, namhyung

[-- Attachment #1: Type: text/plain, Size: 386 bytes --]

Hi Arnaldo,

On Thu, 16 Mar 2023 20:11:11 -0300 Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com> wrote:
>
> Can you try adding NO_BPF_SKEL=1 to the make -C tools/perf command line?

That made it build.  Can that be automated, or is there something else
I need to install to make it work?  Or, at least can the error be made
more informative?

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2023-03-16 22:50 Stephen Rothwell
@ 2023-03-16 23:11 ` Arnaldo Carvalho de Melo
  2023-03-16 23:55   ` Stephen Rothwell
  2023-03-21 21:39 ` Stephen Rothwell
  1 sibling, 1 reply; 57+ messages in thread
From: Arnaldo Carvalho de Melo @ 2023-03-16 23:11 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Linux Kernel Mailing List, Linux Next Mailing List, irogers, namhyung



On March 16, 2023 7:50:25 PM GMT-03:00, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>Hi all,
>
>After merging the perf tree, today's linux-next build (native perf)
>failed like this:
>
>Auto-detecting system features:
>...                         clang-bpf-co-re: [ ^[[32mon^[[m  ]
>...                                    llvm: [ ^[[31mOFF^[[m ]
>...                                  libcap: [ ^[[32mon^[[m  ]
>...                                  libbfd: [ ^[[32mon^[[m  ]
>
>make[1]: *** Deleting file '/home/sfr/next/perf/util/bpf_skel/vmlinux.h'
>libbpf: failed to find '.BTF' ELF section in /boot/vmlinux-6.0.0-5-powerpc64le
>Error: failed to load BTF from /boot/vmlinux-6.0.0-5-powerpc64le: No data available
>make[1]: *** [Makefile.perf:1075: /home/sfr/next/perf/util/bpf_skel/vmlinux.h] Error 195
>make[1]: *** Waiting for unfinished jobs....
>make: *** [Makefile.perf:236: sub-make] Error 2
>Command exited with non-zero status 2
>
>To be clear this is a native build of perf on a PPC64le host using this
>command line:
>
>make -C tools/perf -f Makefile.perf -s -O -j60 O=../perf EXTRA_CFLAGS=-Wno-psabi
>
>(I could probably remove the EXTRA_CLFAGS now that I am building with
>gcc 12.2)
>
>I don't know which commit caused this.

Can you try adding NO_BPF_SKEL=1 to the make -C tools/perf command line?

- Arnaldo

>
>I have used the perf tree from next-20230316 for today.
>
>
>

^ permalink raw reply	[flat|nested] 57+ messages in thread

* linux-next: build failure after merge of the perf tree
@ 2023-03-16 22:50 Stephen Rothwell
  2023-03-16 23:11 ` Arnaldo Carvalho de Melo
  2023-03-21 21:39 ` Stephen Rothwell
  0 siblings, 2 replies; 57+ messages in thread
From: Stephen Rothwell @ 2023-03-16 22:50 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 1244 bytes --]

Hi all,

After merging the perf tree, today's linux-next build (native perf)
failed like this:

Auto-detecting system features:
...                         clang-bpf-co-re: [ ^[[32mon^[[m  ]
...                                    llvm: [ ^[[31mOFF^[[m ]
...                                  libcap: [ ^[[32mon^[[m  ]
...                                  libbfd: [ ^[[32mon^[[m  ]

make[1]: *** Deleting file '/home/sfr/next/perf/util/bpf_skel/vmlinux.h'
libbpf: failed to find '.BTF' ELF section in /boot/vmlinux-6.0.0-5-powerpc64le
Error: failed to load BTF from /boot/vmlinux-6.0.0-5-powerpc64le: No data available
make[1]: *** [Makefile.perf:1075: /home/sfr/next/perf/util/bpf_skel/vmlinux.h] Error 195
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile.perf:236: sub-make] Error 2
Command exited with non-zero status 2

To be clear this is a native build of perf on a PPC64le host using this
command line:

make -C tools/perf -f Makefile.perf -s -O -j60 O=../perf EXTRA_CFLAGS=-Wno-psabi

(I could probably remove the EXTRA_CLFAGS now that I am building with
gcc 12.2)

I don't know which commit caused this.

I have used the perf tree from next-20230316 for today.



-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2022-09-07  4:22       ` Anshuman Khandual
@ 2022-09-08 15:21         ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 57+ messages in thread
From: Arnaldo Carvalho de Melo @ 2022-09-08 15:21 UTC (permalink / raw)
  To: Anshuman Khandual
  Cc: Stephen Rothwell, Arnaldo Carvalho de Melo,
	Linux Kernel Mailing List, Linux Next Mailing List

Em Wed, Sep 07, 2022 at 09:52:48AM +0530, Anshuman Khandual escreveu:
> 
> 
> On 9/7/22 08:30, Stephen Rothwell wrote:
> > Hi all,
> > 
> > On Wed, 7 Sep 2022 08:01:34 +0530 Anshuman Khandual <anshuman.khandual@arm.com> wrote:
> >>
> >> On 9/7/22 00:35, Stephen Rothwell wrote:
> >>> Hi all,
> >>>
> >>> On Wed, 31 Aug 2022 08:34:52 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:  
> >>>>
> >>>> After merging the perf tree, today's linux-next build (native perf)
> >>>> failed like this:
> >>>>
> >>>> In file included from /usr/include/stdio.h:866,
> >>>>                  from /home/sfr/next/next/tools/perf/util/branch.h:9,
> >>>>                  from util/branch.c:2:
> >>>> In function 'fprintf',
> >>>>     inlined from 'branch_type_stat_display' at util/branch.c:152:4:
> >>>> /usr/include/powerpc64le-linux-gnu/bits/stdio2.h:105:10: error: '%8s' directive argument is null [-Werror=format-overflow=]
> >>>>   105 |   return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
> >>>>       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >>>>   106 |                         __va_arg_pack ());
> >>>>       |                         ~~~~~~~~~~~~~~~~~
> >>>> cc1: all warnings being treated as errors
> >>>>
> >>>> Presumably caused by commit
> >>>>
> >>>>   9781e500dcb8 ("perf branch: Extend branch type classification")
> >>>>
> >>>> "native" here is PowerPC64 LE.
> >>>> $ gcc --version
> >>>> gcc (Debian 11.2.0-10) 11.2.0
> >>>>
> >>>> I have used the perf tree from next-20220830 for today.  
> >>>
> >>> I am still seeing this build failure.  
> >>
> >> But did you apply the fix patch from Arnaldo that removes -Wno-format-overflow
> >> compiler option for the file util/branch.c ?
> >>
> >> https://lore.kernel.org/all/YxJBh3wvAGol+Ekq@kernel.org/
> > 
> > No, I expected a fix to be in the perf tree ...
> > 
> > Also note that the following fixes the problem for me:
> > 
> > diff --git a/tools/perf/util/branch.c b/tools/perf/util/branch.c
> > index d40776c44b06..b7b898f2872e 100644
> > --- a/tools/perf/util/branch.c
> > +++ b/tools/perf/util/branch.c
> > @@ -88,7 +88,8 @@ const char *branch_type_name(int type)
> >  		"ERET",
> >  		"IRQ",
> >  		"SERROR",
> > -		"NO_TX"
> > +		"NO_TX",
> > +		""
> >  	};
> >  
> >  	if (type >= 0 && type < PERF_BR_MAX)
> 
> This looks right, makes sense.
> 
> > 
> > 
> > PERF_BR_MAX has been increased by one (when PERF_BR_EXTEND_ABI was
> > added), but a new string has not been added to the array ...
> 
> Right, even though new branch_new_names[] array gets queried on when type
> value is PERF_BR_EXTEND_ABI, branch_names[] should still contain an empty
> string "" just to match the now incremented PERF_BR_MAX which extends the
> array size as well. I guess the compiler detects this mismatch here and
> just complains about it.
> 
> Hello Arnaldo,
> 
> As adding empty string to the array solves the build problem, I guess we
> should fold this fix instead, rather than trying to drop the compiler
> option itself, as discussed earlier.

I'll do it, and even force push perf/core so that this problem doesn't
get into the bisection history upstream.

- Arnaldo
 
> The above fix should be folded into the following commit
> 
> 9781e500dcb8 ("perf branch: Extend branch type classification")
> 
> in the following perf tree - branch.
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git (perf/core)
> 
> - Anshuman

-- 

- Arnaldo

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2022-09-07  3:00     ` Stephen Rothwell
@ 2022-09-07  4:22       ` Anshuman Khandual
  2022-09-08 15:21         ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 57+ messages in thread
From: Anshuman Khandual @ 2022-09-07  4:22 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Arnaldo Carvalho de Melo, Linux Kernel Mailing List,
	Linux Next Mailing List



On 9/7/22 08:30, Stephen Rothwell wrote:
> Hi all,
> 
> On Wed, 7 Sep 2022 08:01:34 +0530 Anshuman Khandual <anshuman.khandual@arm.com> wrote:
>>
>> On 9/7/22 00:35, Stephen Rothwell wrote:
>>> Hi all,
>>>
>>> On Wed, 31 Aug 2022 08:34:52 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:  
>>>>
>>>> After merging the perf tree, today's linux-next build (native perf)
>>>> failed like this:
>>>>
>>>> In file included from /usr/include/stdio.h:866,
>>>>                  from /home/sfr/next/next/tools/perf/util/branch.h:9,
>>>>                  from util/branch.c:2:
>>>> In function 'fprintf',
>>>>     inlined from 'branch_type_stat_display' at util/branch.c:152:4:
>>>> /usr/include/powerpc64le-linux-gnu/bits/stdio2.h:105:10: error: '%8s' directive argument is null [-Werror=format-overflow=]
>>>>   105 |   return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
>>>>       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>>   106 |                         __va_arg_pack ());
>>>>       |                         ~~~~~~~~~~~~~~~~~
>>>> cc1: all warnings being treated as errors
>>>>
>>>> Presumably caused by commit
>>>>
>>>>   9781e500dcb8 ("perf branch: Extend branch type classification")
>>>>
>>>> "native" here is PowerPC64 LE.
>>>> $ gcc --version
>>>> gcc (Debian 11.2.0-10) 11.2.0
>>>>
>>>> I have used the perf tree from next-20220830 for today.  
>>>
>>> I am still seeing this build failure.  
>>
>> But did you apply the fix patch from Arnaldo that removes -Wno-format-overflow
>> compiler option for the file util/branch.c ?
>>
>> https://lore.kernel.org/all/YxJBh3wvAGol+Ekq@kernel.org/
> 
> No, I expected a fix to be in the perf tree ...
> 
> Also note that the following fixes the problem for me:
> 
> diff --git a/tools/perf/util/branch.c b/tools/perf/util/branch.c
> index d40776c44b06..b7b898f2872e 100644
> --- a/tools/perf/util/branch.c
> +++ b/tools/perf/util/branch.c
> @@ -88,7 +88,8 @@ const char *branch_type_name(int type)
>  		"ERET",
>  		"IRQ",
>  		"SERROR",
> -		"NO_TX"
> +		"NO_TX",
> +		""
>  	};
>  
>  	if (type >= 0 && type < PERF_BR_MAX)

This looks right, makes sense.

> 
> 
> PERF_BR_MAX has been increased by one (when PERF_BR_EXTEND_ABI was
> added), but a new string has not been added to the array ...

Right, even though new branch_new_names[] array gets queried on when type
value is PERF_BR_EXTEND_ABI, branch_names[] should still contain an empty
string "" just to match the now incremented PERF_BR_MAX which extends the
array size as well. I guess the compiler detects this mismatch here and
just complains about it.

Hello Arnaldo,

As adding empty string to the array solves the build problem, I guess we
should fold this fix instead, rather than trying to drop the compiler
option itself, as discussed earlier.

The above fix should be folded into the following commit

9781e500dcb8 ("perf branch: Extend branch type classification")

in the following perf tree - branch.

git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git (perf/core)

- Anshuman

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2022-09-07  2:31   ` Anshuman Khandual
@ 2022-09-07  3:00     ` Stephen Rothwell
  2022-09-07  4:22       ` Anshuman Khandual
  0 siblings, 1 reply; 57+ messages in thread
From: Stephen Rothwell @ 2022-09-07  3:00 UTC (permalink / raw)
  To: Anshuman Khandual
  Cc: Arnaldo Carvalho de Melo, Linux Kernel Mailing List,
	Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 2255 bytes --]

Hi all,

On Wed, 7 Sep 2022 08:01:34 +0530 Anshuman Khandual <anshuman.khandual@arm.com> wrote:
>
> On 9/7/22 00:35, Stephen Rothwell wrote:
> > Hi all,
> > 
> > On Wed, 31 Aug 2022 08:34:52 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:  
> >>
> >> After merging the perf tree, today's linux-next build (native perf)
> >> failed like this:
> >>
> >> In file included from /usr/include/stdio.h:866,
> >>                  from /home/sfr/next/next/tools/perf/util/branch.h:9,
> >>                  from util/branch.c:2:
> >> In function 'fprintf',
> >>     inlined from 'branch_type_stat_display' at util/branch.c:152:4:
> >> /usr/include/powerpc64le-linux-gnu/bits/stdio2.h:105:10: error: '%8s' directive argument is null [-Werror=format-overflow=]
> >>   105 |   return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
> >>       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >>   106 |                         __va_arg_pack ());
> >>       |                         ~~~~~~~~~~~~~~~~~
> >> cc1: all warnings being treated as errors
> >>
> >> Presumably caused by commit
> >>
> >>   9781e500dcb8 ("perf branch: Extend branch type classification")
> >>
> >> "native" here is PowerPC64 LE.
> >> $ gcc --version
> >> gcc (Debian 11.2.0-10) 11.2.0
> >>
> >> I have used the perf tree from next-20220830 for today.  
> > 
> > I am still seeing this build failure.  
> 
> But did you apply the fix patch from Arnaldo that removes -Wno-format-overflow
> compiler option for the file util/branch.c ?
> 
> https://lore.kernel.org/all/YxJBh3wvAGol+Ekq@kernel.org/

No, I expected a fix to be in the perf tree ...

Also note that the following fixes the problem for me:

diff --git a/tools/perf/util/branch.c b/tools/perf/util/branch.c
index d40776c44b06..b7b898f2872e 100644
--- a/tools/perf/util/branch.c
+++ b/tools/perf/util/branch.c
@@ -88,7 +88,8 @@ const char *branch_type_name(int type)
 		"ERET",
 		"IRQ",
 		"SERROR",
-		"NO_TX"
+		"NO_TX",
+		""
 	};
 
 	if (type >= 0 && type < PERF_BR_MAX)


PERF_BR_MAX has been increased by one (when PERF_BR_EXTEND_ABI was
added), but a new string has not been added to the array ...
-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2022-09-06 19:05 ` Stephen Rothwell
@ 2022-09-07  2:31   ` Anshuman Khandual
  2022-09-07  3:00     ` Stephen Rothwell
  0 siblings, 1 reply; 57+ messages in thread
From: Anshuman Khandual @ 2022-09-07  2:31 UTC (permalink / raw)
  To: Stephen Rothwell, Arnaldo Carvalho de Melo
  Cc: Linux Kernel Mailing List, Linux Next Mailing List



On 9/7/22 00:35, Stephen Rothwell wrote:
> Hi all,
> 
> On Wed, 31 Aug 2022 08:34:52 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>>
>> After merging the perf tree, today's linux-next build (native perf)
>> failed like this:
>>
>> In file included from /usr/include/stdio.h:866,
>>                  from /home/sfr/next/next/tools/perf/util/branch.h:9,
>>                  from util/branch.c:2:
>> In function 'fprintf',
>>     inlined from 'branch_type_stat_display' at util/branch.c:152:4:
>> /usr/include/powerpc64le-linux-gnu/bits/stdio2.h:105:10: error: '%8s' directive argument is null [-Werror=format-overflow=]
>>   105 |   return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
>>       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>   106 |                         __va_arg_pack ());
>>       |                         ~~~~~~~~~~~~~~~~~
>> cc1: all warnings being treated as errors
>>
>> Presumably caused by commit
>>
>>   9781e500dcb8 ("perf branch: Extend branch type classification")
>>
>> "native" here is PowerPC64 LE.
>> $ gcc --version
>> gcc (Debian 11.2.0-10) 11.2.0
>>
>> I have used the perf tree from next-20220830 for today.
> 
> I am still seeing this build failure.

But did you apply the fix patch from Arnaldo that removes -Wno-format-overflow
compiler option for the file util/branch.c ?

https://lore.kernel.org/all/YxJBh3wvAGol+Ekq@kernel.org/

- Anshuman

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2022-08-30 22:34 Stephen Rothwell
  2022-09-01  5:11 ` Anshuman Khandual
@ 2022-09-06 19:05 ` Stephen Rothwell
  2022-09-07  2:31   ` Anshuman Khandual
  1 sibling, 1 reply; 57+ messages in thread
From: Stephen Rothwell @ 2022-09-06 19:05 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Anshuman Khandual, Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 1226 bytes --]

Hi all,

On Wed, 31 Aug 2022 08:34:52 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> 
> After merging the perf tree, today's linux-next build (native perf)
> failed like this:
> 
> In file included from /usr/include/stdio.h:866,
>                  from /home/sfr/next/next/tools/perf/util/branch.h:9,
>                  from util/branch.c:2:
> In function 'fprintf',
>     inlined from 'branch_type_stat_display' at util/branch.c:152:4:
> /usr/include/powerpc64le-linux-gnu/bits/stdio2.h:105:10: error: '%8s' directive argument is null [-Werror=format-overflow=]
>   105 |   return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
>       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>   106 |                         __va_arg_pack ());
>       |                         ~~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
> 
> Presumably caused by commit
> 
>   9781e500dcb8 ("perf branch: Extend branch type classification")
> 
> "native" here is PowerPC64 LE.
> $ gcc --version
> gcc (Debian 11.2.0-10) 11.2.0
> 
> I have used the perf tree from next-20220830 for today.

I am still seeing this build failure.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2022-08-30 22:34 Stephen Rothwell
@ 2022-09-01  5:11 ` Anshuman Khandual
  2022-09-06 19:05 ` Stephen Rothwell
  1 sibling, 0 replies; 57+ messages in thread
From: Anshuman Khandual @ 2022-09-01  5:11 UTC (permalink / raw)
  To: Stephen Rothwell, Arnaldo Carvalho de Melo
  Cc: Linux Kernel Mailing List, Linux Next Mailing List

Hello Stephen,

This seems to be the same problem as pointed by ACME on the patch series [1].
Could this be a compiler false positive ? Because the new code block is exact
same like the existing one. This warning seems to only occurs on powerpc64el
platform, but not on others.

[1] https://lore.kernel.org/lkml/Yw59CkHUVbfrHdkh@kernel.org/

- Anshuman

On 8/31/22 04:04, Stephen Rothwell wrote:
> Hi all,
> 
> After merging the perf tree, today's linux-next build (native perf)
> failed like this:
> 
> In file included from /usr/include/stdio.h:866,
>                  from /home/sfr/next/next/tools/perf/util/branch.h:9,
>                  from util/branch.c:2:
> In function 'fprintf',
>     inlined from 'branch_type_stat_display' at util/branch.c:152:4:
> /usr/include/powerpc64le-linux-gnu/bits/stdio2.h:105:10: error: '%8s' directive argument is null [-Werror=format-overflow=]
>   105 |   return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
>       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>   106 |                         __va_arg_pack ());
>       |                         ~~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
> 
> Presumably caused by commit
> 
>   9781e500dcb8 ("perf branch: Extend branch type classification")
> 
> "native" here is PowerPC64 LE.
> $ gcc --version
> gcc (Debian 11.2.0-10) 11.2.0
> 
> I have used the perf tree from next-20220830 for today.
> 

^ permalink raw reply	[flat|nested] 57+ messages in thread

* linux-next: build failure after merge of the perf tree
@ 2022-08-30 22:34 Stephen Rothwell
  2022-09-01  5:11 ` Anshuman Khandual
  2022-09-06 19:05 ` Stephen Rothwell
  0 siblings, 2 replies; 57+ messages in thread
From: Stephen Rothwell @ 2022-08-30 22:34 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Anshuman Khandual, Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 1050 bytes --]

Hi all,

After merging the perf tree, today's linux-next build (native perf)
failed like this:

In file included from /usr/include/stdio.h:866,
                 from /home/sfr/next/next/tools/perf/util/branch.h:9,
                 from util/branch.c:2:
In function 'fprintf',
    inlined from 'branch_type_stat_display' at util/branch.c:152:4:
/usr/include/powerpc64le-linux-gnu/bits/stdio2.h:105:10: error: '%8s' directive argument is null [-Werror=format-overflow=]
  105 |   return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  106 |                         __va_arg_pack ());
      |                         ~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Presumably caused by commit

  9781e500dcb8 ("perf branch: Extend branch type classification")

"native" here is PowerPC64 LE.
$ gcc --version
gcc (Debian 11.2.0-10) 11.2.0

I have used the perf tree from next-20220830 for today.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2022-07-21  3:55   ` Stephen Rothwell
@ 2022-07-21  5:33     ` Ian Rogers
  0 siblings, 0 replies; 57+ messages in thread
From: Ian Rogers @ 2022-07-21  5:33 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Arnaldo Carvalho de Melo, Arnaldo Carvalho de Melo, Ian Rogers,
	Linux Kernel Mailing List, Linux Next Mailing List

On Wed, Jul 20, 2022 at 8:56 PM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Hi Ian,
>
> On Wed, 20 Jul 2022 19:35:45 -0700 Ian Rogers <irogers@google.com> wrote:
> >
> > On Wed, Jul 20, 2022 at 4:05 PM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> > >
> > > I installed python3-setuptools.
> >
> > Thanks, could you give more details? Are you overriding python to be
> > an older version on the command line? What does "python --version" and
> > "python3 --version" show? Installing python3-setuptools should be what
> > you need, but I'm not sure why that's not working for you.
>
> I am not doing anything unusual.  What I meant was "To fix this, I
> installed python3-setuptools as I did not have it installed before".
> It built fine once I installed that.

Ah, thanks for the clarification. We could do something to make the
remedy of this problem clearer.

Thanks,
Ian

> --
> Cheers,
> Stephen Rothwell

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2022-07-21  2:35 ` Ian Rogers
@ 2022-07-21  3:55   ` Stephen Rothwell
  2022-07-21  5:33     ` Ian Rogers
  0 siblings, 1 reply; 57+ messages in thread
From: Stephen Rothwell @ 2022-07-21  3:55 UTC (permalink / raw)
  To: Ian Rogers
  Cc: Arnaldo Carvalho de Melo, Arnaldo Carvalho de Melo, Ian Rogers,
	Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 713 bytes --]

Hi Ian,

On Wed, 20 Jul 2022 19:35:45 -0700 Ian Rogers <irogers@google.com> wrote:
>
> On Wed, Jul 20, 2022 at 4:05 PM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> >
> > I installed python3-setuptools.  
> 
> Thanks, could you give more details? Are you overriding python to be
> an older version on the command line? What does "python --version" and
> "python3 --version" show? Installing python3-setuptools should be what
> you need, but I'm not sure why that's not working for you.

I am not doing anything unusual.  What I meant was "To fix this, I
installed python3-setuptools as I did not have it installed before".
It built fine once I installed that.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2022-07-20 23:05 Stephen Rothwell
@ 2022-07-21  2:35 ` Ian Rogers
  2022-07-21  3:55   ` Stephen Rothwell
  0 siblings, 1 reply; 57+ messages in thread
From: Ian Rogers @ 2022-07-21  2:35 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Arnaldo Carvalho de Melo, Arnaldo Carvalho de Melo, Ian Rogers,
	Linux Kernel Mailing List, Linux Next Mailing List

On Wed, Jul 20, 2022 at 4:05 PM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Hi all,
>
> After merging the perf tree, today's linux-next build (native perf)
> failed like this:
>
> Traceback (most recent call last):
>   File "util/setup.py", line 31, in <module>
>     from setuptools import setup, Extension
> ImportError: No module named setuptools
>
> Caused by commit
>
>   ee87a0841aa5 ("perf python: Avoid deprecation warning on distutils")
>
> I installed python3-setuptools.

Thanks, could you give more details? Are you overriding python to be
an older version on the command line? What does "python --version" and
"python3 --version" show? Installing python3-setuptools should be what
you need, but I'm not sure why that's not working for you.

In any case. sorry for the inconvenience of this. Thanks,
Ian

> --
> Cheers,
> Stephen Rothwell

^ permalink raw reply	[flat|nested] 57+ messages in thread

* linux-next: build failure after merge of the perf tree
@ 2022-07-20 23:05 Stephen Rothwell
  2022-07-21  2:35 ` Ian Rogers
  0 siblings, 1 reply; 57+ messages in thread
From: Stephen Rothwell @ 2022-07-20 23:05 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Arnaldo Carvalho de Melo, Ian Rogers, Ian Rogers,
	Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 432 bytes --]

Hi all,

After merging the perf tree, today's linux-next build (native perf)
failed like this:

Traceback (most recent call last):
  File "util/setup.py", line 31, in <module>
    from setuptools import setup, Extension
ImportError: No module named setuptools

Caused by commit

  ee87a0841aa5 ("perf python: Avoid deprecation warning on distutils")

I installed python3-setuptools.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2022-01-11 22:01     ` Arnaldo Carvalho de Melo
  2022-01-12  5:30       ` kajoljain
  2022-01-12  6:16       ` Stephen Rothwell
@ 2022-01-14 12:03       ` Michael Ellerman
  2 siblings, 0 replies; 57+ messages in thread
From: Michael Ellerman @ 2022-01-14 12:03 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Stephen Rothwell
  Cc: Arnaldo Carvalho de Melo, kajoljain, Linux Kernel Mailing List,
	Linux Next Mailing List

Arnaldo Carvalho de Melo <acme@kernel.org> writes:
> Em Wed, Jan 12, 2022 at 08:45:53AM +1100, Stephen Rothwell escreveu:
>> Hi all,
>> 
>> On Fri, 7 Jan 2022 14:28:37 +0530 kajoljain <kjain@linux.ibm.com> wrote:
>> >
>> > On 1/6/22 3:49 AM, Stephen Rothwell wrote:
>> > > 
>> > > After merging the perf tree, today's linux-next build (powerpc
>> > > ppc64_defconfig) failed like this:
>> > > 
>> > > In file included from include/linux/perf_event.h:17,
>> > >                  from arch/powerpc/perf/isa207-common.h:12,
>> > >                  from arch/powerpc/perf/isa207-common.c:9:
>> > > arch/powerpc/perf/isa207-common.c: In function 'isa207_find_source':
>> > > include/uapi/linux/perf_event.h:1339:11: error: 'PERF_MEM_HOPS_2' undeclared (first use in this function); did you mean 'PERF_MEM_HOPS_0'?
>> > >  1339 |  (((__u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT)
>> > >       |           ^~~~~~~~~
>> > > arch/powerpc/perf/isa207-common.h:273:20: note: in expansion of macro 'PERF_MEM_S'
>> > >   273 | #define P(a, b)    PERF_MEM_S(a, b)
>> > >       |                    ^~~~~~~~~~
>> > > arch/powerpc/perf/isa207-common.c:240:51: note: in expansion of macro 'P'
>> > >   240 |     ret |= PH(LVL, REM_RAM1) | REM | LEVEL(RAM) | P(HOPS, 2);
>> > >       |                                                   ^
>> > > include/uapi/linux/perf_event.h:1339:11: note: each undeclared identifier is reported only once for each function it appears in
>> > >  1339 |  (((__u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT)
>> > >       |           ^~~~~~~~~
>> > > arch/powerpc/perf/isa207-common.h:273:20: note: in expansion of macro 'PERF_MEM_S'
>> > >   273 | #define P(a, b)    PERF_MEM_S(a, b)
>> > >       |                    ^~~~~~~~~~
>> > > arch/powerpc/perf/isa207-common.c:240:51: note: in expansion of macro 'P'
>> > >   240 |     ret |= PH(LVL, REM_RAM1) | REM | LEVEL(RAM) | P(HOPS, 2);
>> > >       |                                                   ^
>> > > include/uapi/linux/perf_event.h:1339:11: error: 'PERF_MEM_HOPS_3' undeclared (first use in this function); did you mean 'PERF_MEM_HOPS_0'?
>> > >  1339 |  (((__u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT)
>> > >       |           ^~~~~~~~~
>> > > arch/powerpc/perf/isa207-common.h:273:20: note: in expansion of macro 'PERF_MEM_S'
>> > >   273 | #define P(a, b)    PERF_MEM_S(a, b)
>> > >       |                    ^~~~~~~~~~
>> > > arch/powerpc/perf/isa207-common.c:244:51: note: in expansion of macro 'P'
>> > >   244 |     ret |= PH(LVL, REM_RAM2) | REM | LEVEL(RAM) | P(HOPS, 3);
>> > >       |                                                   ^
>> > > 
>> > > Caused by commit
>> > > 
>> > >   af2b24f228a0 ("perf powerpc: Add data source encodings for power10 platform")
>> > > 
>> > > It looks like patch 1/4 of this series is missing ...  
>> > 
>> > Hi Stephen,
>> >      Yes you are right, original patch series contain 4 patches, where
>> > 1/4 patch contain kernel side changes for the same. Hence we are getting
>> > this error, as that patch is missing in the Arnaldo tree.
>> > 
>> > Link to the patchset: https://lkml.org/lkml/2021/12/6/143
>> > 
>> > That kernel side patch is taken by Michael Ellermen via powerpc git.
>> > 
>> > Link to the patchset on powerpc/next:
>> > 
>> > [1/4] perf: Add new macros for mem_hops field
>> > https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id=cb1c4aba055f928ffae0c868e8dfe08eeab302e7
>> > 
>> > 
>> > [3/4] powerpc/perf: Add encodings to represent data based on newer
>> > composite PERF_MEM_LVLNUM* fields
>> >  https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id=4a20ee106154ac1765dea97932faad29f0ba57fc
>> > 
>> > [4/4] powerpc/perf: Add data source encodings for power10 platform
>> > https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id=6ed05a8efda56e5be11081954929421de19cce88
>> > 
>> > Thanks,
>> > Kajol Jain
>> > 
>> > > 
>> > > I have used the perf tree from next-20220105 for today.
>> > >   
>> 
>> I am still getting this build failure.
>
> Yeah, this patch shouldn't have been merged thru the perf _tools_ tree,
> my bad, it should have gone thru Michael PPC kernel tree.
>
> It was a single series mixing up tools/ with kernel bits, I thought I
> had picked just the tools part but made a mistake.
>
> This should get resolved when the rest of the kernel bits go via
> Michael's powerpc tree, right?

Sorry about this.

I've just sent my pull request to Linus.

cheers

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2022-01-11 22:01     ` Arnaldo Carvalho de Melo
  2022-01-12  5:30       ` kajoljain
@ 2022-01-12  6:16       ` Stephen Rothwell
  2022-01-14 12:03       ` Michael Ellerman
  2 siblings, 0 replies; 57+ messages in thread
From: Stephen Rothwell @ 2022-01-12  6:16 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Michael Ellerman, Arnaldo Carvalho de Melo, kajoljain,
	Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 746 bytes --]

Hi Arnaldo,

On Tue, 11 Jan 2022 19:01:23 -0300 Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
>
> Yeah, this patch shouldn't have been merged thru the perf _tools_ tree,
> my bad, it should have gone thru Michael PPC kernel tree.
> 
> It was a single series mixing up tools/ with kernel bits, I thought I
> had picked just the tools part but made a mistake.
> 
> This should get resolved when the rest of the kernel bits go via
> Michael's powerpc tree, right?

I just re merged the perf tree on top of the reste of linux-next and it
builds fine.  So I guess you need to wait until after the powerpc tree
has been merged before sending your pull request (or revert the
offending commit(s)).

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 484 bytes --]

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2022-01-11 22:01     ` Arnaldo Carvalho de Melo
@ 2022-01-12  5:30       ` kajoljain
  2022-01-12  6:16       ` Stephen Rothwell
  2022-01-14 12:03       ` Michael Ellerman
  2 siblings, 0 replies; 57+ messages in thread
From: kajoljain @ 2022-01-12  5:30 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Michael Ellerman, Stephen Rothwell
  Cc: Arnaldo Carvalho de Melo, Linux Kernel Mailing List,
	Linux Next Mailing List



On 1/12/22 3:31 AM, Arnaldo Carvalho de Melo wrote:
> Em Wed, Jan 12, 2022 at 08:45:53AM +1100, Stephen Rothwell escreveu:
>> Hi all,
>>
>> On Fri, 7 Jan 2022 14:28:37 +0530 kajoljain <kjain@linux.ibm.com> wrote:
>>>
>>> On 1/6/22 3:49 AM, Stephen Rothwell wrote:
>>>>
>>>> After merging the perf tree, today's linux-next build (powerpc
>>>> ppc64_defconfig) failed like this:
>>>>
>>>> In file included from include/linux/perf_event.h:17,
>>>>                  from arch/powerpc/perf/isa207-common.h:12,
>>>>                  from arch/powerpc/perf/isa207-common.c:9:
>>>> arch/powerpc/perf/isa207-common.c: In function 'isa207_find_source':
>>>> include/uapi/linux/perf_event.h:1339:11: error: 'PERF_MEM_HOPS_2' undeclared (first use in this function); did you mean 'PERF_MEM_HOPS_0'?
>>>>  1339 |  (((__u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT)
>>>>       |           ^~~~~~~~~
>>>> arch/powerpc/perf/isa207-common.h:273:20: note: in expansion of macro 'PERF_MEM_S'
>>>>   273 | #define P(a, b)    PERF_MEM_S(a, b)
>>>>       |                    ^~~~~~~~~~
>>>> arch/powerpc/perf/isa207-common.c:240:51: note: in expansion of macro 'P'
>>>>   240 |     ret |= PH(LVL, REM_RAM1) | REM | LEVEL(RAM) | P(HOPS, 2);
>>>>       |                                                   ^
>>>> include/uapi/linux/perf_event.h:1339:11: note: each undeclared identifier is reported only once for each function it appears in
>>>>  1339 |  (((__u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT)
>>>>       |           ^~~~~~~~~
>>>> arch/powerpc/perf/isa207-common.h:273:20: note: in expansion of macro 'PERF_MEM_S'
>>>>   273 | #define P(a, b)    PERF_MEM_S(a, b)
>>>>       |                    ^~~~~~~~~~
>>>> arch/powerpc/perf/isa207-common.c:240:51: note: in expansion of macro 'P'
>>>>   240 |     ret |= PH(LVL, REM_RAM1) | REM | LEVEL(RAM) | P(HOPS, 2);
>>>>       |                                                   ^
>>>> include/uapi/linux/perf_event.h:1339:11: error: 'PERF_MEM_HOPS_3' undeclared (first use in this function); did you mean 'PERF_MEM_HOPS_0'?
>>>>  1339 |  (((__u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT)
>>>>       |           ^~~~~~~~~
>>>> arch/powerpc/perf/isa207-common.h:273:20: note: in expansion of macro 'PERF_MEM_S'
>>>>   273 | #define P(a, b)    PERF_MEM_S(a, b)
>>>>       |                    ^~~~~~~~~~
>>>> arch/powerpc/perf/isa207-common.c:244:51: note: in expansion of macro 'P'
>>>>   244 |     ret |= PH(LVL, REM_RAM2) | REM | LEVEL(RAM) | P(HOPS, 3);
>>>>       |                                                   ^
>>>>
>>>> Caused by commit
>>>>
>>>>   af2b24f228a0 ("perf powerpc: Add data source encodings for power10 platform")
>>>>
>>>> It looks like patch 1/4 of this series is missing ...  
>>>
>>> Hi Stephen,
>>>      Yes you are right, original patch series contain 4 patches, where
>>> 1/4 patch contain kernel side changes for the same. Hence we are getting
>>> this error, as that patch is missing in the Arnaldo tree.
>>>
>>> Link to the patchset: https://lkml.org/lkml/2021/12/6/143
>>>
>>> That kernel side patch is taken by Michael Ellermen via powerpc git.
>>>
>>> Link to the patchset on powerpc/next:
>>>
>>> [1/4] perf: Add new macros for mem_hops field
>>> https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id=cb1c4aba055f928ffae0c868e8dfe08eeab302e7
>>>
>>>
>>> [3/4] powerpc/perf: Add encodings to represent data based on newer
>>> composite PERF_MEM_LVLNUM* fields
>>>  https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id=4a20ee106154ac1765dea97932faad29f0ba57fc
>>>
>>> [4/4] powerpc/perf: Add data source encodings for power10 platform
>>> https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id=6ed05a8efda56e5be11081954929421de19cce88
>>>
>>> Thanks,
>>> Kajol Jain
>>>
>>>>
>>>> I have used the perf tree from next-20220105 for today.
>>>>   
>>
>> I am still getting this build failure.
> 
> Yeah, this patch shouldn't have been merged thru the perf _tools_ tree,
> my bad, it should have gone thru Michael PPC kernel tree.
> 
> It was a single series mixing up tools/ with kernel bits, I thought I
> had picked just the tools part but made a mistake.
> 
> This should get resolved when the rest of the kernel bits go via
> Michael's powerpc tree, right?
> 
> - Arnaldo

Yes Arnaldo,
      Michael already pulled kernel and power side patches for that
patchset. Only patch 2 of that patchset had tools side changes i.e;

[PATCH 2/4]tools/perf: Add new macros for mem_hops field
Link to the patch: https://lkml.org/lkml/2021/12/6/145

So, we will not get this error once kernel side changes are in via
Michael's powerpc tree.

Thanks,
Kajol Jain
> 

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2022-01-11 21:45   ` Stephen Rothwell
@ 2022-01-11 22:01     ` Arnaldo Carvalho de Melo
  2022-01-12  5:30       ` kajoljain
                         ` (2 more replies)
  0 siblings, 3 replies; 57+ messages in thread
From: Arnaldo Carvalho de Melo @ 2022-01-11 22:01 UTC (permalink / raw)
  To: Michael Ellerman, Stephen Rothwell
  Cc: Arnaldo Carvalho de Melo, kajoljain, Linux Kernel Mailing List,
	Linux Next Mailing List

Em Wed, Jan 12, 2022 at 08:45:53AM +1100, Stephen Rothwell escreveu:
> Hi all,
> 
> On Fri, 7 Jan 2022 14:28:37 +0530 kajoljain <kjain@linux.ibm.com> wrote:
> >
> > On 1/6/22 3:49 AM, Stephen Rothwell wrote:
> > > 
> > > After merging the perf tree, today's linux-next build (powerpc
> > > ppc64_defconfig) failed like this:
> > > 
> > > In file included from include/linux/perf_event.h:17,
> > >                  from arch/powerpc/perf/isa207-common.h:12,
> > >                  from arch/powerpc/perf/isa207-common.c:9:
> > > arch/powerpc/perf/isa207-common.c: In function 'isa207_find_source':
> > > include/uapi/linux/perf_event.h:1339:11: error: 'PERF_MEM_HOPS_2' undeclared (first use in this function); did you mean 'PERF_MEM_HOPS_0'?
> > >  1339 |  (((__u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT)
> > >       |           ^~~~~~~~~
> > > arch/powerpc/perf/isa207-common.h:273:20: note: in expansion of macro 'PERF_MEM_S'
> > >   273 | #define P(a, b)    PERF_MEM_S(a, b)
> > >       |                    ^~~~~~~~~~
> > > arch/powerpc/perf/isa207-common.c:240:51: note: in expansion of macro 'P'
> > >   240 |     ret |= PH(LVL, REM_RAM1) | REM | LEVEL(RAM) | P(HOPS, 2);
> > >       |                                                   ^
> > > include/uapi/linux/perf_event.h:1339:11: note: each undeclared identifier is reported only once for each function it appears in
> > >  1339 |  (((__u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT)
> > >       |           ^~~~~~~~~
> > > arch/powerpc/perf/isa207-common.h:273:20: note: in expansion of macro 'PERF_MEM_S'
> > >   273 | #define P(a, b)    PERF_MEM_S(a, b)
> > >       |                    ^~~~~~~~~~
> > > arch/powerpc/perf/isa207-common.c:240:51: note: in expansion of macro 'P'
> > >   240 |     ret |= PH(LVL, REM_RAM1) | REM | LEVEL(RAM) | P(HOPS, 2);
> > >       |                                                   ^
> > > include/uapi/linux/perf_event.h:1339:11: error: 'PERF_MEM_HOPS_3' undeclared (first use in this function); did you mean 'PERF_MEM_HOPS_0'?
> > >  1339 |  (((__u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT)
> > >       |           ^~~~~~~~~
> > > arch/powerpc/perf/isa207-common.h:273:20: note: in expansion of macro 'PERF_MEM_S'
> > >   273 | #define P(a, b)    PERF_MEM_S(a, b)
> > >       |                    ^~~~~~~~~~
> > > arch/powerpc/perf/isa207-common.c:244:51: note: in expansion of macro 'P'
> > >   244 |     ret |= PH(LVL, REM_RAM2) | REM | LEVEL(RAM) | P(HOPS, 3);
> > >       |                                                   ^
> > > 
> > > Caused by commit
> > > 
> > >   af2b24f228a0 ("perf powerpc: Add data source encodings for power10 platform")
> > > 
> > > It looks like patch 1/4 of this series is missing ...  
> > 
> > Hi Stephen,
> >      Yes you are right, original patch series contain 4 patches, where
> > 1/4 patch contain kernel side changes for the same. Hence we are getting
> > this error, as that patch is missing in the Arnaldo tree.
> > 
> > Link to the patchset: https://lkml.org/lkml/2021/12/6/143
> > 
> > That kernel side patch is taken by Michael Ellermen via powerpc git.
> > 
> > Link to the patchset on powerpc/next:
> > 
> > [1/4] perf: Add new macros for mem_hops field
> > https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id=cb1c4aba055f928ffae0c868e8dfe08eeab302e7
> > 
> > 
> > [3/4] powerpc/perf: Add encodings to represent data based on newer
> > composite PERF_MEM_LVLNUM* fields
> >  https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id=4a20ee106154ac1765dea97932faad29f0ba57fc
> > 
> > [4/4] powerpc/perf: Add data source encodings for power10 platform
> > https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id=6ed05a8efda56e5be11081954929421de19cce88
> > 
> > Thanks,
> > Kajol Jain
> > 
> > > 
> > > I have used the perf tree from next-20220105 for today.
> > >   
> 
> I am still getting this build failure.

Yeah, this patch shouldn't have been merged thru the perf _tools_ tree,
my bad, it should have gone thru Michael PPC kernel tree.

It was a single series mixing up tools/ with kernel bits, I thought I
had picked just the tools part but made a mistake.

This should get resolved when the rest of the kernel bits go via
Michael's powerpc tree, right?

- Arnaldo

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2022-01-07  8:58 ` kajoljain
@ 2022-01-11 21:45   ` Stephen Rothwell
  2022-01-11 22:01     ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 57+ messages in thread
From: Stephen Rothwell @ 2022-01-11 21:45 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: kajoljain, Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 3828 bytes --]

Hi all,

On Fri, 7 Jan 2022 14:28:37 +0530 kajoljain <kjain@linux.ibm.com> wrote:
>
> On 1/6/22 3:49 AM, Stephen Rothwell wrote:
> > 
> > After merging the perf tree, today's linux-next build (powerpc
> > ppc64_defconfig) failed like this:
> > 
> > In file included from include/linux/perf_event.h:17,
> >                  from arch/powerpc/perf/isa207-common.h:12,
> >                  from arch/powerpc/perf/isa207-common.c:9:
> > arch/powerpc/perf/isa207-common.c: In function 'isa207_find_source':
> > include/uapi/linux/perf_event.h:1339:11: error: 'PERF_MEM_HOPS_2' undeclared (first use in this function); did you mean 'PERF_MEM_HOPS_0'?
> >  1339 |  (((__u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT)
> >       |           ^~~~~~~~~
> > arch/powerpc/perf/isa207-common.h:273:20: note: in expansion of macro 'PERF_MEM_S'
> >   273 | #define P(a, b)    PERF_MEM_S(a, b)
> >       |                    ^~~~~~~~~~
> > arch/powerpc/perf/isa207-common.c:240:51: note: in expansion of macro 'P'
> >   240 |     ret |= PH(LVL, REM_RAM1) | REM | LEVEL(RAM) | P(HOPS, 2);
> >       |                                                   ^
> > include/uapi/linux/perf_event.h:1339:11: note: each undeclared identifier is reported only once for each function it appears in
> >  1339 |  (((__u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT)
> >       |           ^~~~~~~~~
> > arch/powerpc/perf/isa207-common.h:273:20: note: in expansion of macro 'PERF_MEM_S'
> >   273 | #define P(a, b)    PERF_MEM_S(a, b)
> >       |                    ^~~~~~~~~~
> > arch/powerpc/perf/isa207-common.c:240:51: note: in expansion of macro 'P'
> >   240 |     ret |= PH(LVL, REM_RAM1) | REM | LEVEL(RAM) | P(HOPS, 2);
> >       |                                                   ^
> > include/uapi/linux/perf_event.h:1339:11: error: 'PERF_MEM_HOPS_3' undeclared (first use in this function); did you mean 'PERF_MEM_HOPS_0'?
> >  1339 |  (((__u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT)
> >       |           ^~~~~~~~~
> > arch/powerpc/perf/isa207-common.h:273:20: note: in expansion of macro 'PERF_MEM_S'
> >   273 | #define P(a, b)    PERF_MEM_S(a, b)
> >       |                    ^~~~~~~~~~
> > arch/powerpc/perf/isa207-common.c:244:51: note: in expansion of macro 'P'
> >   244 |     ret |= PH(LVL, REM_RAM2) | REM | LEVEL(RAM) | P(HOPS, 3);
> >       |                                                   ^
> > 
> > Caused by commit
> > 
> >   af2b24f228a0 ("perf powerpc: Add data source encodings for power10 platform")
> > 
> > It looks like patch 1/4 of this series is missing ...  
> 
> Hi Stephen,
>      Yes you are right, original patch series contain 4 patches, where
> 1/4 patch contain kernel side changes for the same. Hence we are getting
> this error, as that patch is missing in the Arnaldo tree.
> 
> Link to the patchset: https://lkml.org/lkml/2021/12/6/143
> 
> That kernel side patch is taken by Michael Ellermen via powerpc git.
> 
> Link to the patchset on powerpc/next:
> 
> [1/4] perf: Add new macros for mem_hops field
> https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id=cb1c4aba055f928ffae0c868e8dfe08eeab302e7
> 
> 
> [3/4] powerpc/perf: Add encodings to represent data based on newer
> composite PERF_MEM_LVLNUM* fields
>  https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id=4a20ee106154ac1765dea97932faad29f0ba57fc
> 
> [4/4] powerpc/perf: Add data source encodings for power10 platform
> https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id=6ed05a8efda56e5be11081954929421de19cce88
> 
> Thanks,
> Kajol Jain
> 
> > 
> > I have used the perf tree from next-20220105 for today.
> >   

I am still getting this build failure.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: linux-next: build failure after merge of the perf tree
  2022-01-05 22:19 Stephen Rothwell
@ 2022-01-07  8:58 ` kajoljain
  2022-01-11 21:45   ` Stephen Rothwell
  0 siblings, 1 reply; 57+ messages in thread
From: kajoljain @ 2022-01-07  8:58 UTC (permalink / raw)
  To: Stephen Rothwell, Arnaldo Carvalho de Melo
  Cc: Linux Kernel Mailing List, Linux Next Mailing List



On 1/6/22 3:49 AM, Stephen Rothwell wrote:
> Hi all,
> 
> After merging the perf tree, today's linux-next build (powerpc
> ppc64_defconfig) failed like this:
> 
> In file included from include/linux/perf_event.h:17,
>                  from arch/powerpc/perf/isa207-common.h:12,
>                  from arch/powerpc/perf/isa207-common.c:9:
> arch/powerpc/perf/isa207-common.c: In function 'isa207_find_source':
> include/uapi/linux/perf_event.h:1339:11: error: 'PERF_MEM_HOPS_2' undeclared (first use in this function); did you mean 'PERF_MEM_HOPS_0'?
>  1339 |  (((__u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT)
>       |           ^~~~~~~~~
> arch/powerpc/perf/isa207-common.h:273:20: note: in expansion of macro 'PERF_MEM_S'
>   273 | #define P(a, b)    PERF_MEM_S(a, b)
>       |                    ^~~~~~~~~~
> arch/powerpc/perf/isa207-common.c:240:51: note: in expansion of macro 'P'
>   240 |     ret |= PH(LVL, REM_RAM1) | REM | LEVEL(RAM) | P(HOPS, 2);
>       |                                                   ^
> include/uapi/linux/perf_event.h:1339:11: note: each undeclared identifier is reported only once for each function it appears in
>  1339 |  (((__u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT)
>       |           ^~~~~~~~~
> arch/powerpc/perf/isa207-common.h:273:20: note: in expansion of macro 'PERF_MEM_S'
>   273 | #define P(a, b)    PERF_MEM_S(a, b)
>       |                    ^~~~~~~~~~
> arch/powerpc/perf/isa207-common.c:240:51: note: in expansion of macro 'P'
>   240 |     ret |= PH(LVL, REM_RAM1) | REM | LEVEL(RAM) | P(HOPS, 2);
>       |                                                   ^
> include/uapi/linux/perf_event.h:1339:11: error: 'PERF_MEM_HOPS_3' undeclared (first use in this function); did you mean 'PERF_MEM_HOPS_0'?
>  1339 |  (((__u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT)
>       |           ^~~~~~~~~
> arch/powerpc/perf/isa207-common.h:273:20: note: in expansion of macro 'PERF_MEM_S'
>   273 | #define P(a, b)    PERF_MEM_S(a, b)
>       |                    ^~~~~~~~~~
> arch/powerpc/perf/isa207-common.c:244:51: note: in expansion of macro 'P'
>   244 |     ret |= PH(LVL, REM_RAM2) | REM | LEVEL(RAM) | P(HOPS, 3);
>       |                                                   ^
> 
> Caused by commit
> 
>   af2b24f228a0 ("perf powerpc: Add data source encodings for power10 platform")
> 
> It looks like patch 1/4 of this series is missing ...

Hi Stephen,
     Yes you are right, original patch series contain 4 patches, where
1/4 patch contain kernel side changes for the same. Hence we are getting
this error, as that patch is missing in the Arnaldo tree.

Link to the patchset: https://lkml.org/lkml/2021/12/6/143

That kernel side patch is taken by Michael Ellermen via powerpc git.

Link to the patchset on powerpc/next:

[1/4] perf: Add new macros for mem_hops field
https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id=cb1c4aba055f928ffae0c868e8dfe08eeab302e7


[3/4] powerpc/perf: Add encodings to represent data based on newer
composite PERF_MEM_LVLNUM* fields
 https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id=4a20ee106154ac1765dea97932faad29f0ba57fc

[4/4] powerpc/perf: Add data source encodings for power10 platform
https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id=6ed05a8efda56e5be11081954929421de19cce88

Thanks,
Kajol Jain

> 
> I have used the perf tree from next-20220105 for today.
> 

^ permalink raw reply	[flat|nested] 57+ messages in thread

* linux-next: build failure after merge of the perf tree
@ 2022-01-05 22:19 Stephen Rothwell
  2022-01-07  8:58 ` kajoljain
  0 siblings, 1 reply; 57+ messages in thread
From: Stephen Rothwell @ 2022-01-05 22:19 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Kajol Jain, Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 2424 bytes --]

Hi all,

After merging the perf tree, today's linux-next build (powerpc
ppc64_defconfig) failed like this:

In file included from include/linux/perf_event.h:17,
                 from arch/powerpc/perf/isa207-common.h:12,
                 from arch/powerpc/perf/isa207-common.c:9:
arch/powerpc/perf/isa207-common.c: In function 'isa207_find_source':
include/uapi/linux/perf_event.h:1339:11: error: 'PERF_MEM_HOPS_2' undeclared (first use in this function); did you mean 'PERF_MEM_HOPS_0'?
 1339 |  (((__u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT)
      |           ^~~~~~~~~
arch/powerpc/perf/isa207-common.h:273:20: note: in expansion of macro 'PERF_MEM_S'
  273 | #define P(a, b)    PERF_MEM_S(a, b)
      |                    ^~~~~~~~~~
arch/powerpc/perf/isa207-common.c:240:51: note: in expansion of macro 'P'
  240 |     ret |= PH(LVL, REM_RAM1) | REM | LEVEL(RAM) | P(HOPS, 2);
      |                                                   ^
include/uapi/linux/perf_event.h:1339:11: note: each undeclared identifier is reported only once for each function it appears in
 1339 |  (((__u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT)
      |           ^~~~~~~~~
arch/powerpc/perf/isa207-common.h:273:20: note: in expansion of macro 'PERF_MEM_S'
  273 | #define P(a, b)    PERF_MEM_S(a, b)
      |                    ^~~~~~~~~~
arch/powerpc/perf/isa207-common.c:240:51: note: in expansion of macro 'P'
  240 |     ret |= PH(LVL, REM_RAM1) | REM | LEVEL(RAM) | P(HOPS, 2);
      |                                                   ^
include/uapi/linux/perf_event.h:1339:11: error: 'PERF_MEM_HOPS_3' undeclared (first use in this function); did you mean 'PERF_MEM_HOPS_0'?
 1339 |  (((__u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT)
      |           ^~~~~~~~~
arch/powerpc/perf/isa207-common.h:273:20: note: in expansion of macro 'PERF_MEM_S'
  273 | #define P(a, b)    PERF_MEM_S(a, b)
      |                    ^~~~~~~~~~
arch/powerpc/perf/isa207-common.c:244:51: note: in expansion of macro 'P'
  244 |     ret |= PH(LVL, REM_RAM2) | REM | LEVEL(RAM) | P(HOPS, 3);
      |                                                   ^

Caused by commit

  af2b24f228a0 ("perf powerpc: Add data source encodings for power10 platform")

It looks like patch 1/4 of this series is missing ...

I have used the perf tree from next-20220105 for today.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 57+ messages in thread

end of thread, other threads:[~2024-04-19  1:06 UTC | newest]

Thread overview: 57+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-01 22:41 linux-next: build failure after merge of the perf tree Stephen Rothwell
2024-04-02 20:17 ` Arnaldo Carvalho de Melo
2024-04-12 15:22 ` Arnaldo Carvalho de Melo
2024-04-13  2:43   ` Stephen Rothwell
2024-04-18 21:31     ` [PATCH][RFT] " Arnaldo Carvalho de Melo
2024-04-18 23:17       ` Stephen Rothwell
2024-04-19  0:54         ` Arnaldo Carvalho de Melo
2024-04-19  1:06           ` Arnaldo Carvalho de Melo
  -- strict thread matches above, loose matches on Subject: below --
2024-03-21 21:41 Stephen Rothwell
2024-03-21 23:18 ` Arnaldo Carvalho de Melo
2024-03-21 23:19   ` Arnaldo Carvalho de Melo
2024-03-21 23:32     ` Stephen Rothwell
2024-03-22  2:13       ` Stephen Rothwell
2024-03-22 14:32         ` Arnaldo Carvalho de Melo
2024-03-21 23:36   ` Stephen Rothwell
2024-03-21 23:40     ` arnaldo.melo
2024-03-21 23:48     ` Arnaldo Carvalho de Melo
2024-02-21 23:06 Stephen Rothwell
2024-02-23 19:50 ` Arnaldo Carvalho de Melo
2024-02-06 23:40 Stephen Rothwell
2024-02-07  0:02 ` Ian Rogers
2023-10-24 23:26 Stephen Rothwell
2023-10-25  0:34 ` Namhyung Kim
2023-05-29 23:05 Stephen Rothwell
2023-05-30  2:16 ` Ian Rogers
2023-03-16 22:50 Stephen Rothwell
2023-03-16 23:11 ` Arnaldo Carvalho de Melo
2023-03-16 23:55   ` Stephen Rothwell
2023-03-17  3:23     ` Ian Rogers
2023-03-21 21:39 ` Stephen Rothwell
2023-03-22 18:37   ` Ian Rogers
2023-03-22 22:54     ` Stephen Rothwell
2023-03-23 13:27       ` Arnaldo Carvalho de Melo
2023-03-27 20:31         ` Ian Rogers
2023-03-28  1:33         ` Stephen Rothwell
2023-03-28 19:47           ` Arnaldo Carvalho de Melo
2023-03-28 23:06             ` Stephen Rothwell
2023-03-29 12:28               ` Arnaldo Carvalho de Melo
2023-04-03  5:15                 ` Stephen Rothwell
2022-08-30 22:34 Stephen Rothwell
2022-09-01  5:11 ` Anshuman Khandual
2022-09-06 19:05 ` Stephen Rothwell
2022-09-07  2:31   ` Anshuman Khandual
2022-09-07  3:00     ` Stephen Rothwell
2022-09-07  4:22       ` Anshuman Khandual
2022-09-08 15:21         ` Arnaldo Carvalho de Melo
2022-07-20 23:05 Stephen Rothwell
2022-07-21  2:35 ` Ian Rogers
2022-07-21  3:55   ` Stephen Rothwell
2022-07-21  5:33     ` Ian Rogers
2022-01-05 22:19 Stephen Rothwell
2022-01-07  8:58 ` kajoljain
2022-01-11 21:45   ` Stephen Rothwell
2022-01-11 22:01     ` Arnaldo Carvalho de Melo
2022-01-12  5:30       ` kajoljain
2022-01-12  6:16       ` Stephen Rothwell
2022-01-14 12:03       ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).