Skip to content

Commit 95b802c

Browse files
captain5050namhyung
authored andcommitted
perf syscalltbl: Mask off ABI type for MIPS system calls
Arnd Bergmann described that MIPS system calls don't necessarily start from 0 as an ABI prefix is applied: https://lore.kernel.org/lkml/[email protected]/ When decoding the "id" (aka system call number) for MIPS ignore values greater-than 1000. Signed-off-by: Ian Rogers <[email protected]> Reviewed-by: Namhyung Kim <[email protected]> Acked-by: Arnaldo Carvalho de Melo <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Namhyung Kim <[email protected]>
1 parent 16ab5c7 commit 95b802c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tools/perf/util/syscalltbl.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ const char *syscalltbl__name(int e_machine, int id)
4646
{
4747
const struct syscalltbl *table = find_table(e_machine);
4848

49+
if (e_machine == EM_MIPS && id > 1000) {
50+
/*
51+
* MIPS may encode the N32/64/O32 type in the high part of
52+
* syscall number. Mask this off if present. See the values of
53+
* __NR_N32_Linux, __NR_64_Linux, __NR_O32_Linux and __NR_Linux.
54+
*/
55+
id = id % 1000;
56+
}
4957
if (table && id >= 0 && id < table->num_to_name_len)
5058
return table->num_to_name[id];
5159
return NULL;

0 commit comments

Comments
 (0)