kbuild: rewrite check-local-export in sh/awk
authorOwen Rafferty <owen@owenrafferty.com>
Wed, 31 Aug 2022 20:57:08 +0000 (15:57 -0500)
committerMasahiro Yamada <masahiroy@kernel.org>
Wed, 28 Sep 2022 19:40:15 +0000 (04:40 +0900)
commit033a52d033607dab1c9b93962921dc6a9a9146b3
tree52e63ec6397b42b31f8f66ef6af5ceea9fb36b45
parenta6c26e38aa45c4732aeebb3203120aaf4997fc00
kbuild: rewrite check-local-export in sh/awk

Remove the bash build dependency for those who otherwise do not
have it installed. This also provides a significant speedup:

$ make defconfig
$ make yes2modconfig

...

$ find  .  -name "*.o" | grep -v vmlinux | wc
     3169      3169     89615
$ export NM=nm
$ time sh -c 'find . -name "*.o" | grep -v vmlinux | xargs -n1
./scripts/check-local-export'

Without patch:
    0m15.90s real     0m12.17s user     0m05.28s system

With patch:
dash + nawk
    0m02.16s real     0m02.92s user     0m00.34s system

dash + busybox awk
    0m02.36s real     0m03.36s user     0m00.34s system

dash + gawk
    0m02.07s real     0m03.26s user     0m00.32s system

bash + gawk
    0m03.55s real     0m05.00s user     0m00.54s system

Signed-off-by: Owen Rafferty <owen@owenrafferty.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/check-local-export