linux/tools/perf/arch/riscv/include/dwarf-regs-table.h
Ian Rogers a90c451918 perf riscv: Remove dwarf-regs.c and add dwarf-regs-table.h
The file just provides the function get_arch_regstr, however, if in
the only caller get_dwarf_regstr EM_HOST is used for the EM_NONE case,
and the register table is provided in a header file, the function can
never be called. So remove as dead code. Tidy up the EM_NONE cases for
riscv in dwarf-regs.c.

Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Ian Rogers <irogers@google.com>
Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
Cc: Anup Patel <anup@brainfault.org>
Cc: Yang Jihong <yangjihong@bytedance.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Shenlin Liang <liangshenlin@eswincomputing.com>
Cc: Nick Terrell <terrelln@fb.com>
Cc: Guilherme Amadio <amadio@gentoo.org>
Cc: Steinar H. Gunderson <sesse@google.com>
Cc: Changbin Du <changbin.du@huawei.com>
Cc: Alexander Lobakin <aleksander.lobakin@intel.com>
Cc: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Guo Ren <guoren@kernel.org>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Will Deacon <will@kernel.org>
Cc: James Clark <james.clark@linaro.org>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Chen Pei <cp0613@linux.alibaba.com>
Cc: Leo Yan <leo.yan@linux.dev>
Cc: Oliver Upton <oliver.upton@linux.dev>
Cc: Aditya Gupta <adityag@linux.ibm.com>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-riscv@lists.infradead.org
Cc: Bibo Mao <maobibo@loongson.cn>
Cc: John Garry <john.g.garry@oracle.com>
Cc: Atish Patra <atishp@rivosinc.com>
Cc: Dima Kogan <dima@secretsauce.net>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Dr. David Alan Gilbert <linux@treblig.org>
Cc: linux-csky@vger.kernel.org
Link: https://lore.kernel.org/r/20241108234606.429459-15-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
2024-11-09 08:39:13 -08:00

42 lines
1.2 KiB
C

/* SPDX-License-Identifier: GPL-2.0 */
#ifdef DEFINE_DWARF_REGSTR_TABLE
/* This is included in perf/util/dwarf-regs.c */
#define REG_DWARFNUM_NAME(reg, idx) [idx] = "%" #reg
static const char * const riscv_regstr_tbl[] = {
REG_DWARFNUM_NAME("%zero", 0),
REG_DWARFNUM_NAME("%ra", 1),
REG_DWARFNUM_NAME("%sp", 2),
REG_DWARFNUM_NAME("%gp", 3),
REG_DWARFNUM_NAME("%tp", 4),
REG_DWARFNUM_NAME("%t0", 5),
REG_DWARFNUM_NAME("%t1", 6),
REG_DWARFNUM_NAME("%t2", 7),
REG_DWARFNUM_NAME("%s0", 8),
REG_DWARFNUM_NAME("%s1", 9),
REG_DWARFNUM_NAME("%a0", 10),
REG_DWARFNUM_NAME("%a1", 11),
REG_DWARFNUM_NAME("%a2", 12),
REG_DWARFNUM_NAME("%a3", 13),
REG_DWARFNUM_NAME("%a4", 14),
REG_DWARFNUM_NAME("%a5", 15),
REG_DWARFNUM_NAME("%a6", 16),
REG_DWARFNUM_NAME("%a7", 17),
REG_DWARFNUM_NAME("%s2", 18),
REG_DWARFNUM_NAME("%s3", 19),
REG_DWARFNUM_NAME("%s4", 20),
REG_DWARFNUM_NAME("%s5", 21),
REG_DWARFNUM_NAME("%s6", 22),
REG_DWARFNUM_NAME("%s7", 23),
REG_DWARFNUM_NAME("%s8", 24),
REG_DWARFNUM_NAME("%s9", 25),
REG_DWARFNUM_NAME("%s10", 26),
REG_DWARFNUM_NAME("%s11", 27),
REG_DWARFNUM_NAME("%t3", 28),
REG_DWARFNUM_NAME("%t4", 29),
REG_DWARFNUM_NAME("%t5", 30),
REG_DWARFNUM_NAME("%t6", 31),
};
#endif