linux/tools/perf/arch
Martin Kaiser 8d28a56cae perf riscv: fix register name strings
On risc-v, pref probe generates an invalid syntax for a named register in
a kprobe.

$ perf probe --debug verbose --add "n_tty_write tty"
...
Writing event: p:probe/n_tty_write _text+8922528 tty=%"%a0":x64
Failed to write event: Invalid argument

The problem is the combination of

   #define REG_DWARFNUM_NAME(reg, idx) [idx] = "%" #reg

and entries such as

   REG_DWARFNUM_NAME("%a0", 10)

where #reg will escape the quotes of the first macro parameter.

Update the macro definition to produce the correct syntax for a named
register in a kprobe, i.e. the unquoted register name with only one
leading %.

Fixes: a90c451918 ("perf riscv: Remove dwarf-regs.c and add dwarf-regs-table.h")
Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Cc: Ian Rogers <irogers@google.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2026-06-10 16:54:41 -03:00
..
alpha perf build: Remove Makefile.syscalls 2025-03-20 22:58:20 -07:00
arm perf arch arm: Sort includes and add missed explicit dependencies 2026-05-27 08:18:12 -03:00
arm64 perf arm-spe: Don't warn about the discard bit if it doesn't exist 2026-05-29 21:20:50 -03:00
csky/include perf regs: Remove __weak attributive arch__xxx_reg_mask() functions 2026-02-06 12:16:09 -03:00
loongarch perf unwind-libunwind: Make libunwind register reading cross platform 2026-05-15 16:18:36 -03:00
mips perf unwind-libunwind: Make libunwind register reading cross platform 2026-05-15 16:18:36 -03:00
parisc perf build: Remove Makefile.syscalls 2025-03-20 22:58:20 -07:00
powerpc perf dwarf: Avoid redefinition warnings for REG_DWARFNUM_NAME 2026-06-10 16:53:35 -03:00
riscv perf riscv: fix register name strings 2026-06-10 16:54:41 -03:00
s390 perf dwarf: Avoid redefinition warnings for REG_DWARFNUM_NAME 2026-06-10 16:53:35 -03:00
sh perf tools: Make more global variables static 2026-04-08 19:21:04 -07:00
sparc tools headers: Update the syscall tables and unistd.h, to support the new 'rseq_slice_yield' syscall 2026-03-05 17:20:23 -03:00
x86 perf arch x86: Sort includes and add missed explicit dependencies 2026-05-27 08:20:14 -03:00
xtensa tools headers: Update the syscall tables and unistd.h, to support the new 'rseq_slice_yield' syscall 2026-03-05 17:20:23 -03:00
Build perf util: Make util its own library 2024-06-26 11:07:42 -07:00
common.c perf arch common: Use perf_env e_machine rather than arch 2026-06-03 16:48:23 -03:00
common.h perf annotate: Own objdump_path and disassembler_style strings 2023-04-04 09:39:56 -03:00