DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 6/8] scripts: allow tuning any test build option
Date: Tue, 29 Mar 2016 18:15:52 +0200	[thread overview]
Message-ID: <1459268154-29558-7-git-send-email-thomas.monjalon@6wind.com> (raw)
In-Reply-To: <1459268154-29558-1-git-send-email-thomas.monjalon@6wind.com>

Any build option can be enabled or disabled by appending the end
of its name to the config name.
Examples:
	+INTRINSICS to enable CONFIG_RTE_FORCE_INTRINSICS
	~RXTX_CALLBACKS to disable CONFIG_RTE_ETHDEV_RXTX_CALLBACKS

These builtin (lowercase) options are also added for convenience:
	+debug to enable every debug options
	+default to set target machine as default

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 scripts/test-build.sh | 46 ++++++++++++++++++++++++++++++++--------------
 1 file changed, 32 insertions(+), 14 deletions(-)

diff --git a/scripts/test-build.sh b/scripts/test-build.sh
index f28c289..bd4b501 100755
--- a/scripts/test-build.sh
+++ b/scripts/test-build.sh
@@ -34,7 +34,7 @@ default_path=$PATH
 
 # Load config options:
 # - AESNI_MULTI_BUFFER_LIB_PATH
-# - DPDK_BUILD_TEST_CONFIGS (target1+option1+option2 target2)
+# - DPDK_BUILD_TEST_CONFIGS (defconfig1+option1+option2 defconfig2)
 # - DPDK_DEP_CFLAGS
 # - DPDK_DEP_LDFLAGS
 # - DPDK_DEP_MOFED (y/[n])
@@ -61,10 +61,14 @@ print_help () {
 	        -jX   use X parallel jobs in "make"
 	        -s    short test with only first config without examples/doc
 
-	config: defconfig name followed by switches delimited with "+" sign
-	        Example: x86_64-native-linuxapp-gcc+next+shared
-	        Default is to enable most of the options.
+	config: defconfig[[~][+]option1[[~][+]option2...]]
+	        Example: x86_64-native-linuxapp-gcc+debug~RXTX_CALLBACKS
+	        The lowercase options are defined inside $(basename $0).
+	        The uppercase options can be the end of a defconfig option
+	        to enable if prefixed with '+' or to disable if prefixed with '~'.
+	        Default is to automatically enable most of the options.
 	        The external dependencies are setup with DPDK_DEP_* variables.
+	        If no config on command line, DPDK_BUILD_TEST_CONFIGS is used.
 	END_OF_HELP
 }
 
@@ -120,10 +124,19 @@ config () # <directory> <target> <options>
 	if [ ! -e $1/.config ] ; then
 		echo "================== Configure $1"
 		make T=$2 O=$1 config
-		echo $3 | grep -q next || \
+
+		echo 'Customize configuration'
+		# Built-in options (lowercase)
+		! echo $3 | grep -q '+default' || \
+		sed -ri 's,(RTE_MACHINE=")native,\1default,' $1/.config
+		echo $3 | grep -q '+next' || \
 		sed -ri           's,(NEXT_ABI=)y,\1n,' $1/.config
-		! echo $3 | grep -q shared || \
+		! echo $3 | grep -q '+shared' || \
 		sed -ri         's,(SHARED_LIB=)n,\1y,' $1/.config
+		! echo $3 | grep -q '+debug' || \
+		sed -ri            's,(DEBUG.*=)n,\1y,' $1/.config
+
+		# Automatic configuration
 		! echo $2 | grep -q '^x86_64' || \
 		sed -ri               's,(NUMA=)n,\1y,' $1/.config
 		sed -ri         's,(PCI_CONFIG=)n,\1y,' $1/.config
@@ -147,23 +160,28 @@ config () # <directory> <target> <options>
 		sed -ri        's,(KNI_VHOST.*=)n,\1y,' $1/.config
 		sed -ri           's,(SCHED_.*=)n,\1y,' $1/.config
 		sed -ri 's,(TEST_PMD_RECORD_.*=)n,\1y,' $1/.config
-		sed -ri            's,(DEBUG.*=)n,\1y,' $1/.config
+
+		# Explicit enabler/disabler (uppercase)
+		for option in $(echo $3 | sed 's,[~+], &,g') ; do
+			pattern=$(echo $option | cut -c2-)
+			if echo $option | grep -q '^~' ; then
+				sed -ri "s,($pattern=)y,\1n," $1/.config
+			elif echo $option | grep -q '^+' ; then
+				sed -ri "s,($pattern=)n,\1y," $1/.config
+			fi
+		done
 	fi
 }
 
 for conf in $configs ; do
-	target=$(echo $conf | cut -d'+' -f1)
+	target=$(echo $conf | sed 's,[~+].*,,')
 	# reload config with DPDK_TARGET set
 	DPDK_TARGET=$target
 	reset_env
 	. $(dirname $(readlink -e $0))/load-devel-config.sh
 
-	options=$(echo $conf | cut -d'+' -sf2- --output-delimiter='-')
-	if [ -z "$options" ] ; then
-		dir=$target
-	else
-		dir=$target-$options
-	fi
+	options=$(echo $conf | sed 's,[^~+]*,,')
+	dir=$conf
 	config $dir $target $options
 
 	echo "================== Build $dir"
-- 
2.7.0

  parent reply	other threads:[~2016-03-29 16:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-29 16:15 [dpdk-dev] [PATCH 0/8] simpler and better build test Thomas Monjalon
2016-03-29 16:15 ` [dpdk-dev] [PATCH 1/8] scripts: fix run in any directory Thomas Monjalon
2016-03-29 16:15 ` [dpdk-dev] [PATCH 2/8] scripts: remove legacy build method test Thomas Monjalon
2016-03-29 16:15 ` [dpdk-dev] [PATCH 3/8] scripts: test build of performance-thread example Thomas Monjalon
2016-03-29 16:15 ` [dpdk-dev] [PATCH 4/8] scripts: stop build test after first error Thomas Monjalon
2016-03-29 16:15 ` [dpdk-dev] [PATCH 5/8] scripts: allow tuning build options per test target Thomas Monjalon
2016-03-29 16:15 ` Thomas Monjalon [this message]
2016-03-29 16:15 ` [dpdk-dev] [PATCH 7/8] scripts: hook build test config Thomas Monjalon
2016-03-29 16:15 ` [dpdk-dev] [PATCH 8/8] scripts: add verbose test build option Thomas Monjalon
2016-04-07 21:08 ` [dpdk-dev] [PATCH 0/8] simpler and better build test Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1459268154-29558-7-git-send-email-thomas.monjalon@6wind.com \
    --to=thomas.monjalon@6wind.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).