x86/syscalls: shrink entry/syscall_32.i via IWYU
Subsystems (2)
PATCH v2 1/1 x86/syscalls: shrink entry/syscall_32.i via IWYU
This diff uses an open source tool include-what-you-use (IWYU) to modify the include list, changing indirect includes to direct includes. IWYU is implemented using the IWYUScripts github repository which is a tool that is currently undergoing development. These changes seek to improve build times.
pt_regs has been used because it is the only part of ptrace that is necessary for the build of this file.
This change to entry/syscall_32.c resulted in a preprocessed size of entry/syscall_32.i from 64002 lines to 24506 lines (-62%) for the x86 defconfig.
---
Changes in v2:
- added pt_regs which was all that was needed from ptrace
- Link to v1: https://lore.kernel.org/r/[email protected]
--- arch/x86/entry/syscall_32.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
arch/x86/entry/syscall_32.c +14 -4
@@ -1,12 +1,22 @@// SPDX-License-Identifier: GPL-2.0 /* System call table for i386. */ -#include <linux/linkage.h> -#include <linux/sys.h> -#include <linux/cache.h> -#include <linux/syscalls.h> #include <asm/syscall.h> +struct pt_regs ; +typedef long (*sys_call_ptr_t )(const struct pt_regs *); +extern const sys_call_ptr_t sys_call_table[]; +#if defined(CONFIG_X86_32 ) +#define ia32_sys_call_table sys_call_table +#else +/* +* These may not exist, but still put the prototypes in so we +* can use IS_ENABLED(). +*/ +extern const sys_call_ptr_t ia32_sys_call_table[]; +extern const sys_call_ptr_t x32_sys_call_table[]; +#endif +#ifdef CONFIG_IA32_EMULATION #define __SYSCALL_WITH_COMPAT (nr, native, compat) __SYSCALL(nr, compat)#else
---
base-commit: fbafc3e621c3f4ded43720fdb1d6ce1728ec664e
change-id: 20231227-syscall32-2c6d62fe51c9
Best regards,
Signature · 1 line
Tanzir Hasan <[email protected]>