[PATCH 3/3] perf beauty: Move arch/x86/include/asm/irq_vectors.h copy out of the directory used to build perf

From: Arnaldo Carvalho de Melo
Date: Thu Mar 14 2024 - 10:44:20 EST


From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>

It is used only to generate string tables, not to build perf, so move it
to the tools/perf/trace/beauty/include/ hierarchy, that is used just for
scrapping.

This is a something that should've have happened, as happened with the
linux/socket.h scrapper, do it now as Ian suggested while doing an
audit/refactor session in the headers used by perf.

No other tools/ living code uses it.

Suggested-by: Ian Rogers <irogers@xxxxxxxxxx>
Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
Link: https://lore.kernel.org/lkml/CAP-5=fWZVrpRufO4w-S4EcSi9STXcTAN2ERLwTSN7yrSSA-otQ@xxxxxxxxxxxxxx
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/Makefile.perf | 6 ++++--
tools/perf/check-headers.sh | 2 +-
.../trace/beauty}/arch/x86/include/asm/irq_vectors.h | 0
tools/perf/trace/beauty/tracepoints/x86_irq_vectors.sh | 6 +++---
4 files changed, 8 insertions(+), 6 deletions(-)
rename tools/{ => perf/trace/beauty}/arch/x86/include/asm/irq_vectors.h (100%)

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 757777d968602ded..c75342b21089fc6f 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -474,6 +474,8 @@ arm64-sysreg-defs-clean:
beauty_linux_dir := $(srctree)/tools/perf/trace/beauty/include/linux/
beauty_uapi_linux_dir := $(srctree)/tools/perf/trace/beauty/include/uapi/linux/
beauty_uapi_sound_dir := $(srctree)/tools/perf/trace/beauty/include/uapi/sound/
+beauty_arch_asm_dir := $(srctree)/tools/perf/trace/beauty/arch/x86/include/asm/
+
linux_uapi_dir := $(srctree)/tools/include/uapi/linux
asm_generic_uapi_dir := $(srctree)/tools/include/uapi/asm-generic
arch_asm_uapi_dir := $(srctree)/tools/arch/$(SRCARCH)/include/uapi/asm/
@@ -636,8 +638,8 @@ $(x86_arch_prctl_code_array): $(x86_arch_asm_uapi_dir)/prctl.h $(x86_arch_prctl_
x86_arch_irq_vectors_array := $(beauty_outdir)/x86_arch_irq_vectors_array.c
x86_arch_irq_vectors_tbl := $(srctree)/tools/perf/trace/beauty/tracepoints/x86_irq_vectors.sh

-$(x86_arch_irq_vectors_array): $(x86_arch_asm_dir)/irq_vectors.h $(x86_arch_irq_vectors_tbl)
- $(Q)$(SHELL) '$(x86_arch_irq_vectors_tbl)' $(x86_arch_asm_dir) > $@
+$(x86_arch_irq_vectors_array): $(beauty_arch_asm_dir)/irq_vectors.h $(x86_arch_irq_vectors_tbl)
+ $(Q)$(SHELL) '$(x86_arch_irq_vectors_tbl)' $(beauty_arch_asm_dir) > $@

x86_arch_MSRs_array := $(beauty_outdir)/x86_arch_MSRs_array.c
x86_arch_MSRs_tbl := $(srctree)/tools/perf/trace/beauty/tracepoints/x86_msr.sh
diff --git a/tools/perf/check-headers.sh b/tools/perf/check-headers.sh
index 93ad7a787a19d550..b35eba5e99c8d91f 100755
--- a/tools/perf/check-headers.sh
+++ b/tools/perf/check-headers.sh
@@ -34,7 +34,6 @@ FILES=(
"arch/x86/include/asm/cpufeatures.h"
"arch/x86/include/asm/inat_types.h"
"arch/x86/include/asm/emulate_prefix.h"
- "arch/x86/include/asm/irq_vectors.h"
"arch/x86/include/asm/msr-index.h"
"arch/x86/include/uapi/asm/prctl.h"
"arch/x86/lib/x86-opcode-map.txt"
@@ -93,6 +92,7 @@ SYNC_CHECK_FILES=(

declare -a BEAUTY_FILES
BEAUTY_FILES=(
+ "arch/x86/include/asm/irq_vectors.h"
"include/linux/socket.h"
"include/uapi/linux/fs.h"
"include/uapi/linux/mount.h"
diff --git a/tools/arch/x86/include/asm/irq_vectors.h b/tools/perf/trace/beauty/arch/x86/include/asm/irq_vectors.h
similarity index 100%
rename from tools/arch/x86/include/asm/irq_vectors.h
rename to tools/perf/trace/beauty/arch/x86/include/asm/irq_vectors.h
diff --git a/tools/perf/trace/beauty/tracepoints/x86_irq_vectors.sh b/tools/perf/trace/beauty/tracepoints/x86_irq_vectors.sh
index 87dc68c7de0c297e..d8e927dd2bb75c41 100755
--- a/tools/perf/trace/beauty/tracepoints/x86_irq_vectors.sh
+++ b/tools/perf/trace/beauty/tracepoints/x86_irq_vectors.sh
@@ -3,12 +3,12 @@
# (C) 2019, Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>

if [ $# -ne 1 ] ; then
- arch_x86_header_dir=tools/arch/x86/include/asm/
+ beauty_arch_asm_dir=tools/perf/trace/beauty/arch/x86/include/asm/
else
- arch_x86_header_dir=$1
+ beauty_arch_asm_dir=$1
fi

-x86_irq_vectors=${arch_x86_header_dir}/irq_vectors.h
+x86_irq_vectors=${beauty_arch_asm_dir}/irq_vectors.h

# FIRST_EXTERNAL_VECTOR is not that useful, find what is its number
# and then replace whatever is using it and that is useful, which at
--
2.43.2