lkml.org 
[lkml]   [2017]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] kbuild: speed up checksyscalls.sh
Date
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>
---
scripts/checksyscalls.sh | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/scripts/checksyscalls.sh b/scripts/checksyscalls.sh
index 0cce56da3706..b8c9d2b04ffc 100755
--- a/scripts/checksyscalls.sh
+++ b/scripts/checksyscalls.sh
@@ -231,15 +231,12 @@ EOF
}

syscall_list() {
- grep '^[0-9]' "$1" | sort -n | (
+ grep '^[0-9]' "$1" | sort -n |
while read nr abi name entry ; do
- cat <<EOF
-#if !defined(__NR_${name}) && !defined(__IGNORE_${name})
-#warning syscall ${name} not implemented
-#endif
-EOF
+ echo "#if !defined(__NR_${name}) && !defined(__IGNORE_${name})"
+ echo "#warning syscall ${name} not implemented"
+ echo "#endif"
done
- )
}

(ignore_list && syscall_list $(dirname $0)/../arch/x86/entry/syscalls/syscall_32.tbl) | \
--
2.9.0
\
 
 \ /
  Last update: 2017-06-01 16:58    [W:0.241 / U:0.636 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site