From patchwork Tue Mar 29 16:15:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 11787 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 1FCEA56A0; Tue, 29 Mar 2016 18:18:17 +0200 (CEST) Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by dpdk.org (Postfix) with ESMTP id DD1905689 for ; Tue, 29 Mar 2016 18:18:10 +0200 (CEST) Received: by mail-wm0-f52.google.com with SMTP id p65so146727385wmp.1 for ; Tue, 29 Mar 2016 09:18:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=Ygnee2Nwvd/tvh3arH9FnrkbeMf6ljvwoaIjZmrQy1k=; b=lo3c0eGSuCUgpchXl4YURIBitjvJZGe0bxpDnOFK1Qhm8nKdSwBUipNRVX/mPHdSw7 Z6qKlkory4szGPtGyXOZp8J4AggsuJQoo4TKEwUFxKQB+GnDWeo0d8tCENv1gRC2zzwY jCW51CF0o2k/1j3o2Alx9dpxUz/vm2MkBtoUEks6QNqo5puXRP2L+SWZ+aJZVnX6VCc9 e9ONLMRURVgHSLoPPtixjXwbrJVnsVMEEFO36Ld1axtFdS7aw3EDi9iQWiJYrizUyq6A lSv6vGH5Lo10ZmuoIFX/Zg/ySBpy0vA1PSJGApsskWmVZSUbegD/NfeJPfpH8Lkf3NBM iwzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=Ygnee2Nwvd/tvh3arH9FnrkbeMf6ljvwoaIjZmrQy1k=; b=KlF/4BMTwzYCElKri2VqKT6zReiowh0Q3eHsPGe5QciHRzhT3gv778mZbOYUHWR/fh EbMNs+qyzWSKVdAIDJjUfK4Yk+cpKmE/JM/XIjcdHND+FDc2PZsxbGDBEnBldDVIntNy jNl20Nc7nncK1HufSJ9caGcZsVwMIKRfN3SJZLyV7MjRjBaW/v9NckeeljhG/damTxO3 DLLESXbDlg+7GVaznFh4dQIgJGBzK9ojtqsMhVH6Rp2jOkMTnPA1lMHz5u5qzWXW0dyx nSGAjTR2r8R3YXLwVBnLv1t732a//eCZd6AqVMQ5lYlaD3Mm8rYmrCJWlIPtDYC4F7Of RwIQ== X-Gm-Message-State: AD7BkJJnTsoOq4fbfaWNBS8Gqu75hFIIFCJ5CeM8JNqioWUHYqR70gP4dzlXlPBAQ4Jk50D2 X-Received: by 10.28.174.72 with SMTP id x69mr17237876wme.68.1459268290784; Tue, 29 Mar 2016 09:18:10 -0700 (PDT) Received: from XPS13.dev.6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id jf6sm30004635wjb.2.2016.03.29.09.18.09 for (version=TLSv1/SSLv3 cipher=OTHER); Tue, 29 Mar 2016 09:18:10 -0700 (PDT) From: Thomas Monjalon To: dev@dpdk.org Date: Tue, 29 Mar 2016 18:15:52 +0200 Message-Id: <1459268154-29558-7-git-send-email-thomas.monjalon@6wind.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1459268154-29558-1-git-send-email-thomas.monjalon@6wind.com> References: <1459268154-29558-1-git-send-email-thomas.monjalon@6wind.com> Subject: [dpdk-dev] [PATCH 6/8] scripts: allow tuning any test build option X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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 () # 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 () # 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"