summaryrefslogtreecommitdiffstats
path: root/devtools
diff options
context:
space:
mode:
Diffstat (limited to 'devtools')
-rwxr-xr-xdevtools/check-forbidden-tokens.awk74
-rwxr-xr-xdevtools/check-git-log.sh3
-rwxr-xr-xdevtools/check-includes.sh4
-rwxr-xr-xdevtools/check-symbol-change.sh8
-rwxr-xr-xdevtools/checkpatches.sh92
-rwxr-xr-xdevtools/cocci.sh2
-rwxr-xr-xdevtools/test-build.sh8
-rwxr-xr-xdevtools/test-meson-builds.sh9
8 files changed, 110 insertions, 90 deletions
diff --git a/devtools/check-forbidden-tokens.awk b/devtools/check-forbidden-tokens.awk
new file mode 100755
index 00000000..fd77cdd8
--- /dev/null
+++ b/devtools/check-forbidden-tokens.awk
@@ -0,0 +1,74 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2018 Arnon Warshavsky <arnon@qwilt.com>
+
+# This awk script receives a list of expressions to monitor
+# and a list of folders to search these expressions in
+# - No search is done inside comments
+# - Both additions and removals of the expressions are checked
+# A positive balance of additions fails the check
+
+BEGIN {
+ split(FOLDERS,deny_folders," ");
+ split(EXPRESSIONS,deny_expr," ");
+ in_file=0;
+ in_comment=0;
+ count=0;
+ comment_start="/*"
+ comment_end="*/"
+}
+# search for add/remove instances in current file
+# state machine assumes the comments structure is enforced by
+# checkpatches.pl
+(in_file) {
+ # comment start
+ if (index($0,comment_start) > 0) {
+ in_comment = 1
+ }
+ # non comment code
+ if (in_comment == 0) {
+ for (i in deny_expr) {
+ forbidden_added = "^\\+.*" deny_expr[i];
+ forbidden_removed="^-.*" deny_expr[i];
+ current = expressions[deny_expr[i]]
+ if ($0 ~ forbidden_added) {
+ count = count + 1;
+ expressions[deny_expr[i]] = current + 1
+ }
+ if ($0 ~ forbidden_removed) {
+ count = count - 1;
+ expressions[deny_expr[i]] = current - 1
+ }
+ }
+ }
+ # comment end
+ if (index($0,comment_end) > 0) {
+ in_comment = 0
+ }
+}
+# switch to next file , check if the balance of add/remove
+# of previous filehad new additions
+($0 ~ "^\\+\\+\\+ b/") {
+ in_file = 0;
+ if (count > 0) {
+ exit;
+ }
+ for (i in deny_folders) {
+ re = "^\\+\\+\\+ b/" deny_folders[i];
+ if ($0 ~ deny_folders[i]) {
+ in_file = 1
+ last_file = $0
+ }
+ }
+}
+END {
+ if (count > 0) {
+ print "Warning in " substr(last_file,6) ":"
+ print "are you sure you want to add the following:"
+ for (key in expressions) {
+ if (expressions[key] > 0) {
+ print key
+ }
+ }
+ exit RET_ON_FAIL
+ }
+}
diff --git a/devtools/check-git-log.sh b/devtools/check-git-log.sh
index 97dae4be..85d67fb9 100755
--- a/devtools/check-git-log.sh
+++ b/devtools/check-git-log.sh
@@ -108,6 +108,7 @@ bad=$(echo "$headlines" | grep -E --color=always \
-e ':.*\<nvm\>' \
-e ':.*\<numa\>' \
-e ':.*\<pci\>' \
+ -e ':.*\<phy\>' \
-e ':.*\<pmd\>' \
-e ':.*\<rss\>' \
-e ':.*\<sctp\>' \
@@ -116,6 +117,8 @@ bad=$(echo "$headlines" | grep -E --color=always \
-e ':.*\<[Vv]lan\>' \
-e ':.*\<vdpa\>' \
-e ':.*\<vsi\>' \
+ | grep \
+ -v ':.*\<OCTEON\ TX\>' \
| sed 's,^,\t,')
[ -z "$bad" ] || printf "Wrong headline lowercase:\n$bad\n"
diff --git a/devtools/check-includes.sh b/devtools/check-includes.sh
index 9057633e..ba9d00ba 100755
--- a/devtools/check-includes.sh
+++ b/devtools/check-includes.sh
@@ -90,11 +90,11 @@ include_dir=${1:-build/include}
'rte_eth_vhost.h' \
}
-temp_cc=/tmp/${0##*/}.$$.c
+temp_cc=$(mktemp -t dpdk.${0##*/}.XXX.c)
pass_cc=
failures_cc=0
-temp_cxx=/tmp/${0##*/}.$$.cc
+temp_cxx=$(mktemp -t dpdk.${0##*/}.XXX.cc)
pass_cxx=
failures_cxx=0
diff --git a/devtools/check-symbol-change.sh b/devtools/check-symbol-change.sh
index daaf45e1..c0d2a6da 100755
--- a/devtools/check-symbol-change.sh
+++ b/devtools/check-symbol-change.sh
@@ -25,14 +25,14 @@ build_map_changes()
# supresses the subordonate rules below
/[-+] a\/.*\.^(map)/ {in_map=0}
- # Triggering this rule, which starts a line with a + and ends it
+ # Triggering this rule, which starts a line and ends it
# with a { identifies a versioned section. The section name is
# the rest of the line with the + and { symbols remvoed.
# Triggering this rule sets in_sec to 1, which actives the
# symbol rule below
- /+.*{/ {gsub("+","");
+ /^.*{/ {
if (in_map == 1) {
- sec=$1; in_sec=1;
+ sec=$(NF-1); in_sec=1;
}
}
@@ -140,7 +140,7 @@ check_for_rule_violations()
trap clean_and_exit_on_sig EXIT
-mapfile=`mktemp mapdb.XXXXXX`
+mapfile=`mktemp -t dpdk.mapdb.XXXXXX`
patch=$1
exit_code=1
diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
index ba795ad1..bf3114f9 100755
--- a/devtools/checkpatches.sh
+++ b/devtools/checkpatches.sh
@@ -44,85 +44,12 @@ print_usage () {
}
check_forbidden_additions() {
- # This awk script receives a list of expressions to monitor
- # and a list of folders to search these expressions in
- # - No search is done inside comments
- # - Both additions and removals of the expressions are checked
- # A positive balance of additions fails the check
- read -d '' awk_script << 'EOF'
- BEGIN {
- split(FOLDERS,deny_folders," ");
- split(EXPRESSIONS,deny_expr," ");
- in_file=0;
- in_comment=0;
- count=0;
- comment_start="/*"
- comment_end="*/"
- }
- # search for add/remove instances in current file
- # state machine assumes the comments structure is enforced by
- # checkpatches.pl
- (in_file) {
- # comment start
- if (index($0,comment_start) > 0) {
- in_comment = 1
- }
- # non comment code
- if (in_comment == 0) {
- for (i in deny_expr) {
- forbidden_added = "^\+.*" deny_expr[i];
- forbidden_removed="^-.*" deny_expr[i];
- current = expressions[deny_expr[i]]
- if ($0 ~ forbidden_added) {
- count = count + 1;
- expressions[deny_expr[i]] = current + 1
- }
- if ($0 ~ forbidden_removed) {
- count = count - 1;
- expressions[deny_expr[i]] = current - 1
- }
- }
- }
- # comment end
- if (index($0,comment_end) > 0) {
- in_comment = 0
- }
- }
- # switch to next file , check if the balance of add/remove
- # of previous filehad new additions
- ($0 ~ "^\+\+\+ b/") {
- in_file = 0;
- if (count > 0) {
- exit;
- }
- for (i in deny_folders) {
- re = "^\+\+\+ b/" deny_folders[i];
- if ($0 ~ deny_folders[i]) {
- in_file = 1
- last_file = $0
- }
- }
- }
- END {
- if (count > 0) {
- print "Warning in " substr(last_file,6) ":"
- print "are you sure you want to add the following:"
- for (key in expressions) {
- if (expressions[key] > 0) {
- print key
- }
- }
- exit RET_ON_FAIL
- }
- }
-EOF
- # ---------------------------------
# refrain from new additions of rte_panic() and rte_exit()
# multiple folders and expressions are separated by spaces
awk -v FOLDERS="lib drivers" \
-v EXPRESSIONS="rte_panic\\\( rte_exit\\\(" \
-v RET_ON_FAIL=1 \
- "$awk_script" -
+ -f $(dirname $(readlink -e $0))/check-forbidden-tokens.awk -
}
number=0
@@ -146,28 +73,35 @@ if [ ! -f "$DPDK_CHECKPATCH_PATH" ] || [ ! -x "$DPDK_CHECKPATCH_PATH" ] ; then
exit 1
fi
+print_headline() { # <title>
+ printf '\n### %s\n\n' "$1"
+ headline_printed=true
+}
+
total=0
status=0
check () { # <patch> <commit> <title>
local ret=0
+ headline_printed=false
total=$(($total + 1))
- ! $verbose || printf '\n### %s\n\n' "$3"
+ ! $verbose || print_headline "$3"
if [ -n "$1" ] ; then
tmpinput=$1
elif [ -n "$2" ] ; then
- tmpinput=$(mktemp checkpatches.XXXXXX)
+ tmpinput=$(mktemp -t dpdk.checkpatches.XXXXXX)
git format-patch --find-renames \
--no-stat --stdout -1 $commit > "$tmpinput"
else
- tmpinput=$(mktemp checkpatches.XXXXXX)
+ tmpinput=$(mktemp -t dpdk.checkpatches.XXXXXX)
cat > "$tmpinput"
fi
+ ! $verbose || printf 'Running checkpatch.pl:\n'
report=$($DPDK_CHECKPATCH_PATH $options "$tmpinput" 2>/dev/null)
if [ $? -ne 0 ] ; then
- $verbose || printf '\n### %s\n\n' "$3"
+ $headline_printed || print_headline "$3"
printf '%s\n' "$report" | sed -n '1,/^total:.*lines checked$/p'
ret=1
fi
@@ -175,6 +109,7 @@ check () { # <patch> <commit> <title>
! $verbose || printf '\nChecking API additions/removals:\n'
report=$($VALIDATE_NEW_API "$tmpinput")
if [ $? -ne 0 ] ; then
+ $headline_printed || print_headline "$3"
printf '%s\n' "$report"
ret=1
fi
@@ -182,6 +117,7 @@ check () { # <patch> <commit> <title>
! $verbose || printf '\nChecking forbidden tokens additions:\n'
report=$(check_forbidden_additions <"$tmpinput")
if [ $? -ne 0 ] ; then
+ $headline_printed || print_headline "$3"
printf '%s\n' "$report"
ret=1
fi
diff --git a/devtools/cocci.sh b/devtools/cocci.sh
index 4ca5025f..8b17a8ce 100755
--- a/devtools/cocci.sh
+++ b/devtools/cocci.sh
@@ -44,7 +44,7 @@ PATCH_LIST="$@"
exit 1
)
-tmp=$(mktemp)
+tmp=$(mktemp -t dpdk.cocci.XXX)
for c in $PATCH_LIST; do
while true; do
diff --git a/devtools/test-build.sh b/devtools/test-build.sh
index 1eee2417..42f4ad00 100755
--- a/devtools/test-build.sh
+++ b/devtools/test-build.sh
@@ -10,6 +10,7 @@ default_path=$PATH
# - DPDK_DEP_ARCHIVE
# - DPDK_DEP_CFLAGS
# - DPDK_DEP_ISAL (y/[n])
+# - DPDK_DEP_JSON (y/[n])
# - DPDK_DEP_LDFLAGS
# - DPDK_DEP_MLX (y/[n])
# - DPDK_DEP_NUMA ([y]/n)
@@ -96,6 +97,7 @@ reset_env ()
unset DPDK_DEP_ARCHIVE
unset DPDK_DEP_CFLAGS
unset DPDK_DEP_ISAL
+ unset DPDK_DEP_JSON
unset DPDK_DEP_LDFLAGS
unset DPDK_DEP_MLX
unset DPDK_DEP_NUMA
@@ -179,9 +181,13 @@ config () # <directory> <target> <options>
sed -ri 's,(BBDEV_TURBO_SW=)n,\1y,' $1/.config
sed -ri 's,(SCHED_.*=)n,\1y,' $1/.config
test -z "$LIBMUSDK_PATH" || \
- sed -ri 's,(PMD_MVSAM_CRYPTO=)n,\1y,' $1/.config
+ sed -ri 's,(PMD_MVSAM_CRYPTO=)n,\1y,' $1/.config
test -z "$LIBMUSDK_PATH" || \
sed -ri 's,(MVPP2_PMD=)n,\1y,' $1/.config
+ test -z "$LIBMUSDK_PATH" || \
+ sed -ri 's,(MVNETA_PMD=)n,\1y,' $1/.config
+ test -z "$DPDK_DEP_JSON" || \
+ sed -ri 's,(TELEMETRY=)n,\1y,' $1/.config
build_config_hook $1 $2 $3
# Explicit enabler/disabler (uppercase)
diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index 951c9067..79109b75 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -9,6 +9,7 @@
srcdir=$(dirname $(readlink -m $0))/..
MESON=${MESON:-meson}
+use_shared="--default-library=shared"
if command -v ninja >/dev/null 2>&1 ; then
ninja_cmd=ninja
@@ -42,19 +43,19 @@ for c in gcc clang ; do
done
# test compilation with minimal x86 instruction set
-build build-x86-default -Dmachine=nehalem
+build build-x86-default -Dmachine=nehalem $use_shared
# enable cross compilation if gcc cross-compiler is found
c=aarch64-linux-gnu-gcc
if command -v $c >/dev/null 2>&1 ; then
# compile the general v8a also for clang to increase coverage
export CC="ccache clang"
- build build-arm64-host-clang --cross-file \
- config/arm/arm64_armv8_linuxapp_gcc
+ build build-arm64-host-clang $use_shared \
+ --cross-file config/arm/arm64_armv8_linuxapp_gcc
for f in config/arm/arm*gcc ; do
export CC="ccache gcc"
build build-$(basename $f | tr '_' '-' | cut -d'-' -f-2) \
- --cross-file $f
+ $use_shared --cross-file $f
done
fi