]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
perf: make bpf asm include arch conditional
authorBruce Ashfield <bruce.ashfield@gmail.com>
Fri, 5 Apr 2024 13:15:16 +0000 (09:15 -0400)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 8 Apr 2024 22:33:03 +0000 (23:33 +0100)
To keep the perf source copying as small as possible, we can
further refine the arch/uapi copy to the single file that we
currently need.

To avoid a warning from the general perf source copy routine,
we make the .h conditional based on the architecture.

The supported architectures will not change often, so updating
this arch list is very minimal effort. Alternatively, we could
add a PERF_OPTIONAL_SRC variable and not warn if a file isn't
available for a given architecture.

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-kernel/perf/perf.bb

index fe96e1012b8d007d0a1622f39c9ac00c50c8491a..11fa91764906c503a10f2e93525aefde87bb4d75 100644 (file)
@@ -129,7 +129,10 @@ EXTRA_OEMAKE += "\
 # honour a JOBS variable.
 EXTRA_OEMAKE:append:task-configure = " JOBS=1"
 
-# include/uapi/asm is for: include/uapi/asm/bpf_perf_event.h
+# the architectures that need this file can be found in
+#    tools/include/uapi/asm/bpf_perf_event.h
+# We are only listing supported arches at the moment
+PERF_BPF_EVENT_SRC ?= '${@bb.utils.contains_any("ARCH", [ "riscv", "arm64" ], "arch/${ARCH}/include/uapi/asm/bpf_perf_event.h", "", d)}'
 PERF_SRC ?= "Makefile \
              tools/arch \
              tools/build \
@@ -140,7 +143,7 @@ PERF_SRC ?= "Makefile \
              tools/scripts \
              scripts/ \
              arch/arm64/tools \
-             arch/${ARCH}/include/uapi/asm/ \
+             ${PERF_BPF_EVENT_SRC} \
              arch/${ARCH}/Makefile \
 "