Skip to content

Commit d21832e

Browse files
arndbmasahir0y
authored andcommitted
kbuild: speed up checksyscalls.sh
checksyscalls.sh is run at every "make" run while building the kernel, even if no files have changed. I looked at where we spend time in a trivial empty rebuild and found checksyscalls.sh to be a source of noticeable overhead, as it spawns a lot of child processes just to call 'cat' copying from stdin to stdout, once for each of the over 400 x86 syscalls. Using a shell-builtin (echo) instead of the external command gives us a 13x speedup: Before After real 0m1.018s real 0m0.077s user 0m0.068s user 0m0.048s sys 0m0.156s sys 0m0.024s The time it took to rebuild a single file on my machine dropped from 5.5 seconds to 4.5 seconds. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
1 parent 6f0fa58 commit d21832e

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

scripts/checksyscalls.sh

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -202,15 +202,12 @@ EOF
202202
}
203203

204204
syscall_list() {
205-
grep '^[0-9]' "$1" | sort -n | (
205+
grep '^[0-9]' "$1" | sort -n |
206206
while read nr abi name entry ; do
207-
cat <<EOF
208-
#if !defined(__NR_${name}) && !defined(__IGNORE_${name})
209-
#warning syscall ${name} not implemented
210-
#endif
211-
EOF
207+
echo "#if !defined(__NR_${name}) && !defined(__IGNORE_${name})"
208+
echo "#warning syscall ${name} not implemented"
209+
echo "#endif"
212210
done
213-
)
214211
}
215212

216213
(ignore_list && syscall_list $(dirname $0)/../arch/x86/entry/syscalls/syscall_32.tbl) | \

0 commit comments

Comments
 (0)