[PATCH v1 09/23] perf dwarf-regs: Add util/dwarf-regs-arch for consistency with perf-regs

Ian Rogers
2026-01-17T05:29:36Z

perf_regs.h has cross architecture functions for operating with the
differing perf register constants. dwarf-regs.h is similar but for
cross architecture dwarf notions of registers. For consistency move
the arch parts of dwarf-regs out of util and into its own directory.

Signed-off-by: Ian Rogers <irogers@google.com>
---
tools/perf/util/Build | 4 +---
tools/perf/util/dwarf-regs-arch/Build | 3 +++
tools/perf/util/{ => dwarf-regs-arch}/dwarf-regs-csky.c | 0
tools/perf/util/{ => dwarf-regs-arch}/dwarf-regs-powerpc.c | 0
tools/perf/util/{ => dwarf-regs-arch}/dwarf-regs-x86.c | 0
5 files changed, 4 insertions(+), 3 deletions(-)
create mode 100644 tools/perf/util/dwarf-regs-arch/Build
rename tools/perf/util/{ => dwarf-regs-arch}/dwarf-regs-csky.c (100%)
rename tools/perf/util/{ => dwarf-regs-arch}/dwarf-regs-powerpc.c (100%)
rename tools/perf/util/{ => dwarf-regs-arch}/dwarf-regs-x86.c (100%)

diff --git a/tools/perf/util/Build b/tools/perf/util/Build
index 5efec73be474..3cb1edd263cf 100644
--- a/tools/perf/util/Build
+++ b/tools/perf/util/Build
@@ -219,9 +219,7 @@ endif
perf-util-$(CONFIG_LIBDW) += probe-finder.o
perf-util-$(CONFIG_LIBDW) += dwarf-aux.o
perf-util-$(CONFIG_LIBDW) += dwarf-regs.o
-perf-util-$(CONFIG_LIBDW) += dwarf-regs-csky.o
-perf-util-$(CONFIG_LIBDW) += dwarf-regs-powerpc.o
-perf-util-$(CONFIG_LIBDW) += dwarf-regs-x86.o
+perf-util-$(CONFIG_LIBDW) += dwarf-regs-arch/
perf-util-$(CONFIG_LIBDW) += debuginfo.o
perf-util-$(CONFIG_LIBDW) += annotate-data.o
perf-util-$(CONFIG_LIBDW) += libdw.o
diff --git a/tools/perf/util/dwarf-regs-arch/Build b/tools/perf/util/dwarf-regs-arch/Build
new file mode 100644
index 000000000000..98bec0032606
--- /dev/null
+++ b/tools/perf/util/dwarf-regs-arch/Build
@@ -0,0 +1,3 @@
+perf-util-$(CONFIG_LIBDW) += dwarf-regs-csky.o
+perf-util-$(CONFIG_LIBDW) += dwarf-regs-powerpc.o
+perf-util-$(CONFIG_LIBDW) += dwarf-regs-x86.o
diff --git a/tools/perf/util/dwarf-regs-csky.c b/tools/perf/util/dwarf-regs-arch/dwarf-regs-csky.c
similarity index 100%
rename from tools/perf/util/dwarf-regs-csky.c
rename to tools/perf/util/dwarf-regs-arch/dwarf-regs-csky.c
diff --git a/tools/perf/util/dwarf-regs-powerpc.c b/tools/perf/util/dwarf-regs-arch/dwarf-regs-powerpc.c
similarity index 100%
rename from tools/perf/util/dwarf-regs-powerpc.c
rename to tools/perf/util/dwarf-regs-arch/dwarf-regs-powerpc.c
diff --git a/tools/perf/util/dwarf-regs-x86.c b/tools/perf/util/dwarf-regs-arch/dwarf-regs-x86.c
similarity index 100%
rename from tools/perf/util/dwarf-regs-x86.c
rename to tools/perf/util/dwarf-regs-arch/dwarf-regs-x86.c
--
2.52.0.457.g6b5491de43-goog