DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net, ferruh.yigit@intel.com,
	bruce.richardson@intel.com, Ray Kinsella <mdr@ashroe.eu>,
	Neil Horman <nhorman@tuxdriver.com>
Subject: [dpdk-dev] [PATCH v2 2/2] buildtools: check symbol maps in developer mode
Date: Wed,  5 May 2021 16:30:01 +0200	[thread overview]
Message-ID: <20210505143001.14178-2-david.marchand@redhat.com> (raw)
In-Reply-To: <20210505143001.14178-1-david.marchand@redhat.com>

Hook check-symbol-maps.sh in the symbol check when in developer mode to
help developers catch issues before submitting their changes.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
Changes since v1:
- now that we have the developer mode, added this check in the build
  process,

---
 buildtools/check-symbols.sh   |  9 ++++++++-
 devtools/check-symbol-maps.sh | 12 ++++++++----
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/buildtools/check-symbols.sh b/buildtools/check-symbols.sh
index 83b3a0182f..e458c0af72 100755
--- a/buildtools/check-symbols.sh
+++ b/buildtools/check-symbols.sh
@@ -5,7 +5,9 @@
 MAPFILE=$1
 OBJFILE=$2
 
-LIST_SYMBOL=$(dirname $(readlink -f $0))/map-list-symbol.sh
+ROOTDIR=$(readlink -f $(dirname $(readlink -f $0))/..)
+LIST_SYMBOL=$ROOTDIR/buildtools/map-list-symbol.sh
+CHECK_SYMBOL_MAPS=$ROOTDIR/devtools/check-symbol-maps.sh
 
 # added check for "make -C test/" usage
 if [ ! -e $MAPFILE ] || [ ! -f $OBJFILE ]
@@ -23,6 +25,11 @@ trap 'rm -f "$DUMPFILE"' EXIT
 objdump -t $OBJFILE >$DUMPFILE
 
 ret=0
+
+if ! $CHECK_SYMBOL_MAPS $MAPFILE; then
+	ret=1
+fi
+
 for SYM in `$LIST_SYMBOL -S EXPERIMENTAL $MAPFILE |cut -d ' ' -f 3`
 do
 	if grep -q "\.text.*[[:space:]]$SYM$" $DUMPFILE &&
diff --git a/devtools/check-symbol-maps.sh b/devtools/check-symbol-maps.sh
index f2c7d29663..c52e28bd69 100755
--- a/devtools/check-symbol-maps.sh
+++ b/devtools/check-symbol-maps.sh
@@ -7,11 +7,15 @@ cd $(dirname $0)/..
 # speed up by ignoring Unicode details
 export LC_ALL=C
 
+if [ $# = 0 ] ; then
+    set -- $(find lib drivers -name '*.map')
+fi
+
 ret=0
 
 find_orphan_symbols ()
 {
-    for map in $(find lib drivers -name '*.map') ; do
+    for map in $@ ; do
         for sym in $(sed -rn 's,^([^}]*_.*);.*$,\1,p' $map) ; do
             if echo $sym | grep -q '^per_lcore_' ; then
                 symsrc=${sym#per_lcore_}
@@ -28,7 +32,7 @@ find_orphan_symbols ()
     done
 }
 
-orphan_symbols=$(find_orphan_symbols)
+orphan_symbols=$(find_orphan_symbols $@)
 if [ -n "$orphan_symbols" ] ; then
     echo "Found only in symbol map file:"
     echo "$orphan_symbols" | sed 's,^,\t,'
@@ -37,13 +41,13 @@ fi
 
 find_duplicate_symbols ()
 {
-    for map in $(find lib drivers -name '*.map') ; do
+    for map in $@ ; do
         buildtools/map-list-symbol.sh $map | \
             sort | uniq -c | grep -v " 1 $map" || true
     done
 }
 
-duplicate_symbols=$(find_duplicate_symbols)
+duplicate_symbols=$(find_duplicate_symbols $@)
 if [ -n "$duplicate_symbols" ] ; then
     echo "Found duplicates in symbol map file:"
     echo "$duplicate_symbols"
-- 
2.23.0


  reply	other threads:[~2021-05-05 14:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-25 11:14 [dpdk-dev] [PATCH] devtools: catch symbol duplicates in version map David Marchand
2021-02-25 11:41 ` Thomas Monjalon
2021-02-25 11:57   ` Bruce Richardson
2021-02-25 12:01     ` Thomas Monjalon
2021-02-25 12:05       ` Bruce Richardson
2021-02-25 13:14         ` Thomas Monjalon
2021-05-05 14:30 ` [dpdk-dev] [PATCH v2 1/2] " David Marchand
2021-05-05 14:30   ` David Marchand [this message]
2021-05-06  9:31     ` [dpdk-dev] [PATCH v2 2/2] buildtools: check symbol maps in developer mode Kinsella, Ray
2021-05-12 20:24       ` Thomas Monjalon
2021-05-12 20:38         ` Thomas Monjalon
2021-05-13  7:06           ` David Marchand
2021-05-13  8:34 ` [dpdk-dev] [PATCH v3 1/3] devtools: fix orphan symbols check with busybox David Marchand
2021-05-13  8:34   ` [dpdk-dev] [PATCH v3 2/3] devtools: catch symbol duplicates in version map David Marchand
2021-05-13  8:34   ` [dpdk-dev] [PATCH v3 3/3] build: check symbol maps in developer mode David Marchand
2021-05-19 10:52     ` 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=20210505143001.14178-2-david.marchand@redhat.com \
    --to=david.marchand@redhat.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=mdr@ashroe.eu \
    --cc=nhorman@tuxdriver.com \
    --cc=thomas@monjalon.net \
    /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).