[PATCH v2 3/7] perf syscalltbl: Remove struct syscalltbl

Arnd Bergmann arnd at arndb.de
Tue Feb 11 08:34:14 PST 2025


On Tue, Feb 11, 2025, at 17:18, Ian Rogers wrote:
> On Mon, Feb 10, 2025 at 11:48 PM Arnd Bergmann <arnd at arndb.de> wrote:

>> The syscall numbers on mips (and previously on ia64) are offset by
>> a large number depending on the ABI (o32/n32/n64). I assume what
>> we want here is to have the small numbers without the offset in
>> syscall_num_to_name[], but that requires adding the offset during
>> the lookup. Can you check if this is handled correctly?
>
> Thanks Arnd! I agree the tables are large and can be sparse, they'll
> also be full of relocations. MIPS doesn't look like an outlier to me
> here:

Sorry, I should have been clearer what I meant, see
arch/mips/include/uapi/asm/unistd.h:

#if _MIPS_SIM == _MIPS_SIM_NABI32
#define __NR_Linux      6000
#include <asm/unistd_n32.h>
#endif

and
arch/mips/include/generated/uapi/asm/unistd_n32.h

#define __NR_read (__NR_Linux + 0)
#define __NR_write (__NR_Linux + 1)
#define __NR_open (__NR_Linux + 2)

These offsets are 4000/5000/6000 respectively.

> ```
> #if defined(ALL_SYSCALLTBL) || defined(__mips__)
> static const char *const syscall_num_to_name_EM_MIPS[] = {
>        [0] = "read",
>        [1] = "write",
>        [2] = "open",
> ...
>         [465] = "listxattrat",
>         [466] = "removexattrat",
> };

This means the array is not sparse, but the numbers
here do not match the syscall number argument register.

The question is whether tracing on mips adds the same
per-ABI offset again, or if it tries and fails to look
up index 6002 for 'open'.

       Arnd



More information about the linux-riscv mailing list