Skip to contentSkip to conversation

merge_config.sh: Use the first file as the initial config

PATCH In review Josh Boyer 4 participants 4 messages Feb 1, 2012 – Mar 24, 2012 Kconfig

lore
Share & tools
lore

Josh Boyer

author
#0 lore raw

PATCH 1/1 merge_config.sh: Use the first file as the initial config

Take the first config fragment and use it verbatim as the initial config set. This avoids running the verification loop for the first file, as nothing has actually been merged at this point. This significantly increases performance for large config fragments.

---

When experimenting with merge_config.sh on the Fedora config fragments, this cut the execution time of a single invocation with all the config fragments in half (from 28 seconds to 13 seconds).

 scripts/kconfig/merge_config.sh |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
scripts/kconfig/merge_config.sh +5 -1
index ceadf0e..23d738a 100644
@@ -58,12 +58,16 @@ while true; do
 	esac
 done
 
-
+INITFILE=$1
+shift;
 
 MERGE_LIST=$*
 SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(CONFIG_[a-zA-Z0-9_]*\)[= ].*/\2/p"
 TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX)
 
+echo "Using $INITFILE as base"
+cat $INITFILE > $TMP_FILE
+
 # Merge files, printing warnings on overrided values
 for MERGE_FILE in $MERGE_LIST ; do
 	echo "Merging $MERGE_FILE"
Signature · 1 line
1.7.8.4
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Josh Boyer

Take the first config fragment and use it verbatim as the initial config set. This avoids running the verification loop for the first file, as nothing has actually been merged at this point. This significantly increases performance for large config fragments.

---

When experimenting with merge_config.sh on the Fedora config fragments, this cut the execution time of a single invocation with all the config fragments in half (from 28 seconds to 13 seconds).

Adding Darren to the CC.

Nice! Looks ok to me.

Quoted 25 lines
 scripts/kconfig/merge_config.sh |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
scripts/kconfig/merge_config.sh +5 -1
index ceadf0e..23d738a 100644
@@ -58,12 +58,16 @@ while true; do
 	esac
 done
 
-
+INITFILE=$1
+shift;
 
 MERGE_LIST=$*
 SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(CONFIG_[a-zA-Z0-9_]*\)[= ].*/\2/p"
 TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX)
 
+echo "Using $INITFILE as base"
+cat $INITFILE > $TMP_FILE
+
 # Merge files, printing warnings on overrided values
 for MERGE_FILE in $MERGE_LIST ; do
 	echo "Merging $MERGE_FILE"
Acked-by
#2 lore raw
Quoted 13 lines · John Stultz
Quoted 11 lines · Josh Boyer

Take the first config fragment and use it verbatim as the initial config set. This avoids running the verification loop for the first file, as nothing has actually been merged at this point. This significantly increases performance for large config fragments.

---

When experimenting with merge_config.sh on the Fedora config fragments, this cut the execution time of a single invocation with all the config fragments in half (from 28 seconds to 13 seconds).

Quoted 5 lines

Adding Darren to the CC.

Nice! Looks ok to me.

Thanks Josh,

Quoted 28 lines
Quoted 26 lines
 scripts/kconfig/merge_config.sh |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
scripts/kconfig/merge_config.sh +5 -1
index ceadf0e..23d738a 100644
@@ -58,12 +58,16 @@ while true; do
 	esac
 done
 
-
+INITFILE=$1
+shift;
 
 MERGE_LIST=$*
 SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(CONFIG_[a-zA-Z0-9_]*\)[= ].*/\2/p"
 TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX)
 
+echo "Using $INITFILE as base"
+cat $INITFILE > $TMP_FILE
+
 # Merge files, printing warnings on overrided values
 for MERGE_FILE in $MERGE_LIST ; do
 	echo "Merging $MERGE_FILE"
Signature · 3 lines
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
#3 lore raw
In reply to Josh Boyer
Quoted 6 lines · Josh Boyer

Take the first config fragment and use it verbatim as the initial config set. This avoids running the verification loop for the first file, as nothing has actually been merged at this point. This significantly increases performance for large config fragments.

Applied to kbuild.git#kconfig, thanks.

Michal