diff options
author | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2016-07-06 09:22:35 +0200 |
---|---|---|
committer | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2016-07-06 16:09:40 +0200 |
commit | 8b25d1ad5d2264bdfc2818c7bda74ee2697df6db (patch) | |
tree | 8c3c769777f7e66a2d1ba7dd7651b563cfde370b /scripts | |
parent | 97f17497d162afdb82c8704bf097f0fee3724b2e (diff) |
Imported Upstream version 16.07-rc1
Change-Id: I40a523e52f12e8496fdd69e902824b0226c303de
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/check-git-log.sh | 24 | ||||
-rwxr-xr-x | scripts/checkpatches.sh | 47 | ||||
-rwxr-xr-x | scripts/merge-maps.sh | 29 | ||||
-rwxr-xr-x | scripts/test-build.sh | 25 | ||||
-rwxr-xr-x | scripts/test-null.sh | 1 |
5 files changed, 75 insertions, 51 deletions
diff --git a/scripts/check-git-log.sh b/scripts/check-git-log.sh index ce6c15ea..7d2c7ee8 100755 --- a/scripts/check-git-log.sh +++ b/scripts/check-git-log.sh @@ -55,7 +55,7 @@ tags=$(git log --format='%b' $range | grep -i -e 'by *:' -e 'fix.*:') fixes=$(git log --format='%h %s' $range | grep -i ': *fix' | cut -d' ' -f1) # check headline format (spacing, no punctuation, no code) -bad=$(echo "$headlines" | grep \ +bad=$(echo "$headlines" | grep --color=always \ -e ' ' \ -e '^ ' \ -e ' $' \ @@ -69,7 +69,7 @@ bad=$(echo "$headlines" | grep \ [ -z "$bad" ] || printf "Wrong headline format:\n$bad\n" # check headline label for common typos -bad=$(echo "$headlines" | grep \ +bad=$(echo "$headlines" | grep --color=always \ -e '^example[:/]' \ -e '^apps/' \ -e '^testpmd' \ @@ -79,15 +79,15 @@ bad=$(echo "$headlines" | grep \ [ -z "$bad" ] || printf "Wrong headline label:\n$bad\n" # check headline lowercase for first words -bad=$(echo "$headlines" | grep \ +bad=$(echo "$headlines" | grep --color=always \ -e '^.*[A-Z].*:' \ -e ': *[A-Z]' \ | sed 's,^,\t,') [ -z "$bad" ] || printf "Wrong headline uppercase:\n$bad\n" # check headline uppercase (Rx/Tx, VF, L2, MAC, Linux, ARM...) -bad=$(echo "$headlines" | grep \ - -e 'rx\|tx\|RX\|TX' \ +bad=$(echo "$headlines" | grep -E --color=always \ + -e '\<(rx|tx|RX|TX)\>' \ -e '\<[pv]f\>' \ -e '\<l[234]\>' \ -e ':.*\<dma\>' \ @@ -111,9 +111,15 @@ bad=$(echo "$headlines" | awk 'length>60 {print}' | sed 's,^,\t,') [ -z "$bad" ] || printf "Headline too long:\n$bad\n" # check body lines length (75 max) -bad=$(echo "$bodylines" | awk 'length>75 {print}' | sed 's,^,\t,') +bad=$(echo "$bodylines" | grep -v '^Fixes:' | awk 'length>75 {print}' | sed 's,^,\t,') [ -z "$bad" ] || printf "Line too long:\n$bad\n" +# check starting commit message with "It" +bad=$(echo "$bodylines" | head -n1 | grep -E --color=always \ + -ie '^It ' \ + | sed 's,^,\t,') +[ -z "$bad" ] || printf "Wrong beginning of commit message:\n$bad\n" + # check tags spelling bad=$(echo "$tags" | grep -v '^\(Reported\|Suggested\|Signed-off\|Acked\|Reviewed\|Tested\)-by: [^,]* <.*@.*>$' | @@ -134,7 +140,11 @@ IFS=' fixtags=$(echo "$tags" | grep '^Fixes: ') bad=$(for fixtag in $fixtags ; do hash=$(echo "$fixtag" | sed 's,^Fixes: \([0-9a-f]*\).*,\1,') - good="Fixes: $hash "$(git log --format='("%s")' -1 $hash 2>&-) + if git branch --contains $hash | grep -q '^\*' ; then + good="Fixes: $hash "$(git log --format='("%s")' -1 $hash 2>&-) + else + good="reference not in current branch" + fi printf "$fixtag" | grep -v "^$good$" done | sed 's,^,\t,') [ -z "$bad" ] || printf "Wrong 'Fixes' reference:\n$bad\n" diff --git a/scripts/checkpatches.sh b/scripts/checkpatches.sh index 5c58a202..7111558f 100755 --- a/scripts/checkpatches.sh +++ b/scripts/checkpatches.sh @@ -42,23 +42,25 @@ options="--no-tree" options="$options --max-line-length=$length" options="$options --show-types" options="$options --ignore=LINUX_VERSION_CODE,FILE_PATH_CHANGES,\ -VOLATILE,PREFER_PACKED,PREFER_ALIGNED,PREFER_PRINTF,PREFER_KERNEL_TYPES,\ +VOLATILE,PREFER_PACKED,PREFER_ALIGNED,PREFER_PRINTF,PREFER_KERNEL_TYPES,BIT_MACRO,\ SPLIT_STRING,LINE_SPACING,PARENTHESIS_ALIGNMENT,NETWORKING_BLOCK_COMMENT_STYLE,\ NEW_TYPEDEFS,COMPARISON_TO_NULL" print_usage () { cat <<- END_OF_HELP - usage: $(basename $0) [-q] [-v] [patch1 [patch2] ...]] + usage: $(basename $0) [-q] [-v] [-nX|patch1 [patch2] ...]] Run Linux kernel checkpatch.pl with DPDK options. The environment variable DPDK_CHECKPATCH_PATH must be set. END_OF_HELP } +number=0 quiet=false verbose=false -while getopts hqv ARG ; do +while getopts hn:qv ARG ; do case $ARG in + n ) number=$OPTARG ;; q ) quiet=true && options="$options --no-summary" ;; v ) verbose=true ;; h ) print_usage ; exit 0 ;; @@ -74,17 +76,42 @@ if [ ! -x "$DPDK_CHECKPATCH_PATH" ] ; then exit 1 fi +total=0 status=0 -for p in "$@" ; do - ! $verbose || printf '\n### %s\n\n' "$p" - report=$($DPDK_CHECKPATCH_PATH $options "$p" 2>/dev/null) + +check () { # <patch> <commit> <title> + total=$(($total + 1)) + ! $verbose || printf '\n### %s\n\n' "$3" + if [ -n "$1" ] ; then + report=$($DPDK_CHECKPATCH_PATH $options "$1" 2>/dev/null) + elif [ -n "$2" ] ; then + report=$(git format-patch --no-stat --stdout -1 $commit | + $DPDK_CHECKPATCH_PATH $options - 2>/dev/null) + fi [ $? -ne 0 ] || continue - $verbose || printf '\n### %s\n\n' "$p" + $verbose || printf '\n### %s\n\n' "$3" printf '%s\n' "$report" | head -n -6 status=$(($status + 1)) -done -pass=$(($# - $status)) -$quiet || printf '%d/%d valid patch' $pass $# +} + +if [ -z "$1" ] ; then + if [ $number -eq 0 ] ; then + commits=$(git rev-list origin/master..) + else + commits=$(git rev-list --max-count=$number HEAD) + fi + for commit in $commits ; do + subject=$(git log --format='%s' -1 $commit) + check '' $commit "$subject" + done +else + for patch in "$@" ; do + subject=$(sed -n 's,^Subject: ,,p' "$patch") + check "$patch" '' "$subject" + done +fi +pass=$(($total - $status)) +$quiet || printf '%d/%d valid patch' $pass $total $quiet || [ $pass -le 1 ] || printf 'es' $quiet || printf '\n' exit $status diff --git a/scripts/merge-maps.sh b/scripts/merge-maps.sh deleted file mode 100755 index edc88dea..00000000 --- a/scripts/merge-maps.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh - -FILES=$(find "$RTE_SDK"/lib "$RTE_SDK"/drivers -name "*_version.map") -SYMBOLS=$(grep -h "{" $FILES | sort -u | sed 's/{//') - -first=0 -prev_sym="none" - -for s in $SYMBOLS; do - echo "$s {" - echo " global:" - echo "" - for f in $FILES; do - sed -n "/$s {/,/}/p" "$f" | sed '/^$/d' | grep -v global | grep -v local | sed -e '1d' -e '$d' - done | sort -u - echo "" - if [ $first -eq 0 ]; then - first=1; - echo " local: *;"; - fi - if [ "$prev_sym" = "none" ]; then - echo "};"; - prev_sym=$s; - else - echo "} $prev_sym;"; - prev_sym=$s; - fi - echo "" -done diff --git a/scripts/test-build.sh b/scripts/test-build.sh index f7ba1fbb..5bcecfc3 100755 --- a/scripts/test-build.sh +++ b/scripts/test-build.sh @@ -35,6 +35,7 @@ default_path=$PATH # Load config options: # - AESNI_MULTI_BUFFER_LIB_PATH # - DPDK_BUILD_TEST_CONFIGS (defconfig1+option1+option2 defconfig2) +# - DPDK_DEP_ARCHIVE # - DPDK_DEP_CFLAGS # - DPDK_DEP_LDFLAGS # - DPDK_DEP_MOFED (y/[n]) @@ -44,7 +45,8 @@ default_path=$PATH # - DPDK_DEP_ZLIB (y/[n]) # - DPDK_MAKE_JOBS (int) # - DPDK_NOTIFY (notify-send) -# - LIBSSO_PATH +# - LIBSSO_SNOW3G_PATH +# - LIBSSO_KASUMI_PATH . $(dirname $(readlink -e $0))/load-devel-config.sh print_usage () { @@ -61,6 +63,7 @@ print_help () { -h this help -jX use X parallel jobs in "make" -s short test with only first config without examples/doc + -v verbose build config: defconfig[[~][+]option1[[~][+]option2...]] Example: x86_64-native-linuxapp-gcc+debug~RXTX_CALLBACKS @@ -111,6 +114,7 @@ reset_env () { export PATH=$default_path unset CROSS + unset DPDK_DEP_ARCHIVE unset DPDK_DEP_CFLAGS unset DPDK_DEP_LDFLAGS unset DPDK_DEP_MOFED @@ -119,13 +123,19 @@ reset_env () unset DPDK_DEP_SZE unset DPDK_DEP_ZLIB unset AESNI_MULTI_BUFFER_LIB_PATH - unset LIBSSO_PATH + unset LIBSSO_SNOW3G_PATH + unset LIBSSO_KASUMI_PATH unset PQOS_INSTALL_PATH } config () # <directory> <target> <options> { - if [ ! -e $1/.config ] ; then + reconfig=false + if git rev-parse 2>&- && [ -n "$(git diff HEAD~ -- config)" ] ; then + echo 'Default config may have changed' + reconfig=true + fi + if [ ! -e $1/.config ] || $reconfig ; then echo "================== Configure $1" make T=$2 O=$1 config @@ -138,6 +148,7 @@ config () # <directory> <target> <options> ! echo $3 | grep -q '+shared' || \ sed -ri 's,(SHARED_LIB=)n,\1y,' $1/.config ! echo $3 | grep -q '+debug' || ( \ + sed -ri 's,(RTE_LOG_LEVEL=).*,\1RTE_LOG_DEBUG,' $1/.config sed -ri 's,(_DEBUG.*=)n,\1y,' $1/.config sed -ri 's,(_STAT.*=)n,\1y,' $1/.config sed -ri 's,(TEST_PMD_RECORD_.*=)n,\1y,' $1/.config ) @@ -148,12 +159,16 @@ config () # <directory> <target> <options> sed -ri 's,(PCI_CONFIG=)n,\1y,' $1/.config sed -ri 's,(LIBRTE_IEEE1588=)n,\1y,' $1/.config sed -ri 's,(BYPASS=)n,\1y,' $1/.config + test "$DPDK_DEP_ARCHIVE" != y || \ + sed -ri 's,(RESOURCE_TAR=)n,\1y,' $1/.config test "$DPDK_DEP_MOFED" != y || \ sed -ri 's,(MLX._PMD=)n,\1y,' $1/.config test "$DPDK_DEP_SZE" != y || \ sed -ri 's,(PMD_SZEDATA2=)n,\1y,' $1/.config test "$DPDK_DEP_ZLIB" != y || \ sed -ri 's,(BNX2X_PMD=)n,\1y,' $1/.config + test "$DPDK_DEP_ZLIB" != y || \ + sed -ri 's,(QEDE_PMD=)n,\1y,' $1/.config sed -ri 's,(NFP_PMD=)n,\1y,' $1/.config test "$DPDK_DEP_PCAP" != y || \ sed -ri 's,(PCAP=)n,\1y,' $1/.config @@ -161,8 +176,10 @@ config () # <directory> <target> <options> sed -ri 's,(PMD_AESNI_MB=)n,\1y,' $1/.config test -z "$AESNI_MULTI_BUFFER_LIB_PATH" || \ sed -ri 's,(PMD_AESNI_GCM=)n,\1y,' $1/.config - test -z "$LIBSSO_PATH" || \ + test -z "$LIBSSO_SNOW3G_PATH" || \ sed -ri 's,(PMD_SNOW3G=)n,\1y,' $1/.config + test -z "$LIBSSO_KASUMI_PATH" || \ + sed -ri 's,(PMD_KASUMI=)n,\1y,' $1/.config test "$DPDK_DEP_SSL" != y || \ sed -ri 's,(PMD_QAT=)n,\1y,' $1/.config sed -ri 's,(KNI_VHOST.*=)n,\1y,' $1/.config diff --git a/scripts/test-null.sh b/scripts/test-null.sh index ef6d800d..32a47b17 100755 --- a/scripts/test-null.sh +++ b/scripts/test-null.sh @@ -36,7 +36,6 @@ build=${1:-build} coremask=${2:-3} # default using cores 0 and 1 if grep -q SHARED_LIB=y $build/.config; then - export LD_LIBRARY_PATH=$build/lib:$LD_LIBRARY_PATH pmd='-d librte_pmd_null.so' fi |