[PATCH v1 4/7] DCE/DSE: mips: add HAVE_TRIM_UNUSED_SYSCALLS support

Arnd Bergmann arnd at arndb.de
Mon Sep 25 23:07:40 PDT 2023


On Tue, Sep 26, 2023, at 00:40, Zhangjin Wu wrote:
> For HAVE_TRIM_UNUSED_SYSCALLS, the syscall tables are hacked with the
> input used syscalls.
>
> Based on the used syscalls information, a new version of tbl file is
> generated from the original tbl file and named with a 'used' suffix.
>
> With this new tbl file, both unistd_nr_*.h and syscall_table_*.h files
> are updated to only include the used syscalls.
>
>     $ grep _Linux_syscalls -ur arch/mips/include/generated/asm/
>     arch/mips/include/generated/asm/unistd_nr_n64.h:#define 
> __NR_64_Linux_syscalls	165
>     arch/mips/include/generated/asm/unistd_nr_n32.h:#define 
> __NR_N32_Linux_syscalls	165
>     arch/mips/include/generated/asm/unistd_nr_o32.h:#define 
> __NR_O32_Linux_syscalls	89
>
>     $ grep -vr sys_ni_syscall 
> arch/mips/include/generated/asm/syscall_table_*.h
>     arch/mips/include/generated/asm/syscall_table_n32.h:__SYSCALL(58, 
> sys_exit)
>     arch/mips/include/generated/asm/syscall_table_n32.h:__SYSCALL(164, 
> sys_reboot)
>     arch/mips/include/generated/asm/syscall_table_n64.h:__SYSCALL(58, 
> sys_exit)

My feeling is that instead of postprocessing the generated files,
it would be much better to make the elimination part of the
existing infrastructure that generates the files from syscall.tbl,
and finally change the include/asm-generic/unistd.h to the
same format, as we had planned for a long time.

I should be able to help out with that part.

      Arnd



More information about the linux-riscv mailing list