diff mbox series

[v2] perf: fix build with latest kernel

Message ID 20231107090852.1478021-1-max.oss.09@gmail.com
State Accepted, archived
Commit 432b4ac20dadb9c08596266fce4f3941d4856c7e
Headers show
Series [v2] perf: fix build with latest kernel | expand

Commit Message

Max Krummenacher Nov. 7, 2023, 9:08 a.m. UTC
From: Max Krummenacher <max.krummenacher@toradex.com>

Kernel 6.7-rc1 commit 02e85f74668e ("tools: arm64: Add a Makefile for
generating sysreg-defs.h") uses files from arch/arm64/tools/,
gen-sysreg.awk and sysreg.
Without the files the build of perf fails independent of the used
architecture (confirmed with armv7 and qemux86_64).

As arch/arm64/tools/ has been added with 5.13 allow perf to build
even it that directory does not exist.

Add arch/arm64/tools/ to PERF_SRC.

Fixes:
| make[3]: *** No rule to make target '.../qemux86_64-tdx-linux/perf/1.0/perf-1.0/arch/arm64/tools/gen-sysreg.awk', needed by '.../qemux86_64-tdx-linux/perf/1.0/perf-1.0/tools/arch/arm64/include/generated/asm/sysreg-defs.h'.  Stop.
| make[2]: *** [Makefile.perf:456: arm64-sysreg-defs] Error 2

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
---
 meta/recipes-kernel/perf/perf.bb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Changes in v2:
- drop distinction between needed and optional files in PERF_SRC
- allow all file paths in PERF_SRC to not exist, but bb.warn about them

Comments

Bruce Ashfield Nov. 7, 2023, 1:08 p.m. UTC | #1
On Tue, Nov 7, 2023 at 4:09 AM Max Krummenacher <max.oss.09@gmail.com> wrote:
>
> From: Max Krummenacher <max.krummenacher@toradex.com>
>
> Kernel 6.7-rc1 commit 02e85f74668e ("tools: arm64: Add a Makefile for
> generating sysreg-defs.h") uses files from arch/arm64/tools/,
> gen-sysreg.awk and sysreg.
> Without the files the build of perf fails independent of the used
> architecture (confirmed with armv7 and qemux86_64).
>
> As arch/arm64/tools/ has been added with 5.13 allow perf to build
> even it that directory does not exist.
>
> Add arch/arm64/tools/ to PERF_SRC.
>
> Fixes:
> | make[3]: *** No rule to make target '.../qemux86_64-tdx-linux/perf/1.0/perf-1.0/arch/arm64/tools/gen-sysreg.awk', needed by '.../qemux86_64-tdx-linux/perf/1.0/perf-1.0/tools/arch/arm64/include/generated/asm/sysreg-defs.h'.  Stop.
> | make[2]: *** [Makefile.perf:456: arm64-sysreg-defs] Error 2
>
> Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
> ---
>  meta/recipes-kernel/perf/perf.bb | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> Changes in v2:
> - drop distinction between needed and optional files in PERF_SRC
> - allow all file paths in PERF_SRC to not exist, but bb.warn about them

Looks good to me.

Bruce

>
> diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb
> index a392166e73..287d3e68f7 100644
> --- a/meta/recipes-kernel/perf/perf.bb
> +++ b/meta/recipes-kernel/perf/perf.bb
> @@ -135,6 +135,7 @@ PERF_SRC ?= "Makefile \
>               tools/perf \
>               tools/scripts \
>               scripts/ \
> +             arch/arm64/tools \
>               arch/${ARCH}/Makefile \
>  "
>
> @@ -180,7 +181,8 @@ python copy_perf_source_from_kernel() {
>          src = oe.path.join(src_dir, s)
>          dest = oe.path.join(dest_dir, s)
>          if not os.path.exists(src):
> -            bb.fatal("Path does not exist: %s. Maybe PERF_SRC does not match the kernel version." % src)
> +            bb.warn("Path does not exist: %s. Maybe PERF_SRC lists more files than what your kernel version provides and needs." % src)
> +            continue
>          if os.path.isdir(src):
>              oe.path.copyhardlinktree(src, dest)
>          else:
> --
> 2.35.3
>
diff mbox series

Patch

diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb
index a392166e73..287d3e68f7 100644
--- a/meta/recipes-kernel/perf/perf.bb
+++ b/meta/recipes-kernel/perf/perf.bb
@@ -135,6 +135,7 @@  PERF_SRC ?= "Makefile \
              tools/perf \
              tools/scripts \
              scripts/ \
+             arch/arm64/tools \
              arch/${ARCH}/Makefile \
 "
 
@@ -180,7 +181,8 @@  python copy_perf_source_from_kernel() {
         src = oe.path.join(src_dir, s)
         dest = oe.path.join(dest_dir, s)
         if not os.path.exists(src):
-            bb.fatal("Path does not exist: %s. Maybe PERF_SRC does not match the kernel version." % src)
+            bb.warn("Path does not exist: %s. Maybe PERF_SRC lists more files than what your kernel version provides and needs." % src)
+            continue
         if os.path.isdir(src):
             oe.path.copyhardlinktree(src, dest)
         else: