scripts/tags.sh: improve compiled sources generation
authorJialu Xu <xujialu@vimux.org>
Thu, 1 Jun 2023 01:04:02 +0000 (09:04 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Jun 2023 18:01:57 +0000 (19:01 +0100)
Use grep instead of sed for all compiled sources generation, it is three
times more efficient.

Signed-off-by: Jialu Xu <xujialu@vimux.org>
Tested-by: Carlos Llamas <cmllamas@google.com>
Link: https://lore.kernel.org/r/20230601010402.71040-1-xujialu@vimux.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
scripts/tags.sh

index ea31640..938dba2 100755 (executable)
@@ -98,7 +98,7 @@ all_compiled_sources()
        {
                echo include/generated/autoconf.h
                find $ignore -name "*.cmd" -exec \
-                       sed -n -E 's/^source_.* (.*)/\1/p; s/^  (\S.*) \\/\1/p' {} \+ |
+                       grep -Poh '(?<=^  )\S+|(?<== )\S+[^\\](?=$)' {} \+ |
                awk '!a[$0]++'
        } | xargs realpath -esq $([ -z "$KBUILD_ABS_SRCTREE" ] && echo --relative-to=.) |
        sort -u