From patchwork Thu May 13 08:34:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 93248 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D3C5EA0A0C; Thu, 13 May 2021 10:34:40 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 540774067E; Thu, 13 May 2021 10:34:40 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id A55094003F for ; Thu, 13 May 2021 10:34:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620894878; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IPV/gDD44Slmme2G2s3cJFSCFtiECsMw3ZLu/GST+ys=; b=KGNaYRvxAnoliPX5hKQg44CGhC/LZ8iOxYnYzD4cO+n55rN66XjhaP48V9erJU98wIgBCK sqb8WXFLNM6l6dVsh3eFDDZAfC/HHe5J/zKx+4Mf/mnlaQupVkpx4NymoGMdJg0dSaJhC9 hQcORHQPl3C/F9Hob7f+wOPWXxWhmdY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-164-2bkF0pKaORKcubRKDtBAow-1; Thu, 13 May 2021 04:34:34 -0400 X-MC-Unique: 2bkF0pKaORKcubRKDtBAow-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 13EDB9F92D; Thu, 13 May 2021 08:34:33 +0000 (UTC) Received: from dmarchan.remote.csb (unknown [10.40.192.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id E7B9C60937; Thu, 13 May 2021 08:34:30 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@intel.com, bruce.richardson@intel.com, mdr@ashroe.eu Date: Thu, 13 May 2021 10:34:13 +0200 Message-Id: <20210513083415.32187-1-david.marchand@redhat.com> In-Reply-To: <20210225111457.32540-1-david.marchand@redhat.com> References: <20210225111457.32540-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [dpdk-dev] [PATCH v3 1/3] devtools: fix orphan symbols check with busybox X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Avoid relying on GNU grep --exclude option. Fixes: f8ad40dc998c ("devtools: check orphan symbols in map files") Signed-off-by: David Marchand --- devtools/check-symbol-maps.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/devtools/check-symbol-maps.sh b/devtools/check-symbol-maps.sh index f06353fc75..08451ef5aa 100755 --- a/devtools/check-symbol-maps.sh +++ b/devtools/check-symbol-maps.sh @@ -20,8 +20,7 @@ find_orphan_symbols () else symsrc=$sym fi - if ! grep -q -r --exclude=$(basename $map) \ - -w $symsrc $(dirname $map) ; then + if [ -z "$(grep -rlw $symsrc $(dirname $map) |grep -v $map)" ] ; then echo "$map: $sym" fi done From patchwork Thu May 13 08:34:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 93249 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7FAB6A0A0C; Thu, 13 May 2021 10:34:45 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 684E1410FE; Thu, 13 May 2021 10:34:45 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id A6338410FD for ; Thu, 13 May 2021 10:34:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620894883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QZU1T/8rbKPnkEv034RTRWpAP+RzICjU/p+DsEi+mCY=; b=MxFygCo86t9ZnqJ0xetSeVPTKQb+mQ42PRWAuQOx7v0OqOc0cqUQWlFXORhpPtVg+u9iV7 YQIFayB1GclioTIssx9OnFUbTuT5ChLzzah37VbRbUZit7J9dVxWkGurVZNlx4Q3xPn+7i +xCy5NBYumKTGp0GX26mm3kKf04zpS0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-588-C9zrfKe6Oa2lDsRM-r2O8g-1; Thu, 13 May 2021 04:34:41 -0400 X-MC-Unique: C9zrfKe6Oa2lDsRM-r2O8g-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 22D2D107ACF3; Thu, 13 May 2021 08:34:40 +0000 (UTC) Received: from dmarchan.remote.csb (unknown [10.40.192.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id EDA036E407; Thu, 13 May 2021 08:34:37 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@intel.com, bruce.richardson@intel.com, mdr@ashroe.eu Date: Thu, 13 May 2021 10:34:14 +0200 Message-Id: <20210513083415.32187-2-david.marchand@redhat.com> In-Reply-To: <20210513083415.32187-1-david.marchand@redhat.com> References: <20210225111457.32540-1-david.marchand@redhat.com> <20210513083415.32187-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [dpdk-dev] [PATCH v3 2/3] devtools: catch symbol duplicates in version map X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add a check on versioned symbol duplicates in map files. Signed-off-by: David Marchand --- Changes since v1: - rebased, --- devtools/check-symbol-maps.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/devtools/check-symbol-maps.sh b/devtools/check-symbol-maps.sh index 08451ef5aa..8a976dc97f 100755 --- a/devtools/check-symbol-maps.sh +++ b/devtools/check-symbol-maps.sh @@ -34,4 +34,19 @@ if [ -n "$orphan_symbols" ] ; then ret=1 fi +find_duplicate_symbols () +{ + for map in $(find lib drivers -name '*.map') ; do + buildtools/map-list-symbol.sh $map | \ + sort | uniq -c | grep -v " 1 $map" || true + done +} + +duplicate_symbols=$(find_duplicate_symbols) +if [ -n "$duplicate_symbols" ] ; then + echo "Found duplicates in symbol map file:" + echo "$duplicate_symbols" + ret=1 +fi + exit $ret From patchwork Thu May 13 08:34:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 93250 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B3262A0A0C; Thu, 13 May 2021 10:34:52 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9B8DE410FF; Thu, 13 May 2021 10:34:52 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 675F24003F for ; Thu, 13 May 2021 10:34:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620894889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EJ41g7KxnBqXJWeG6O/Y4d1QIaQa3bKRn6gentvnAI4=; b=SdhstDmFVR0LvHHw0jhfkSpBkT76lVGu4ZeUb8dOHN5hWEU7bOctkRFnePvVrOCcvrU4Xv bmn5p510gzxJ4cbN8noKbl6nX2H5oZFgUX/eXTuXx2iUDqMsaBeTLe2Bb1H1GJWDEWudBh 4eWvz0Bx+o9xRDwTbKl+ECXChCwkDFM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-358-S_n4PiqQOC69k0-7SA7b7w-1; Thu, 13 May 2021 04:34:47 -0400 X-MC-Unique: S_n4PiqQOC69k0-7SA7b7w-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 349BA1083E9B; Thu, 13 May 2021 08:34:46 +0000 (UTC) Received: from dmarchan.remote.csb (unknown [10.40.192.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1CD271B49D; Thu, 13 May 2021 08:34:43 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@intel.com, bruce.richardson@intel.com, mdr@ashroe.eu Date: Thu, 13 May 2021 10:34:15 +0200 Message-Id: <20210513083415.32187-3-david.marchand@redhat.com> In-Reply-To: <20210513083415.32187-1-david.marchand@redhat.com> References: <20210225111457.32540-1-david.marchand@redhat.com> <20210513083415.32187-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [dpdk-dev] [PATCH v3 3/3] build: check symbol maps in developer mode X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Reviewed-by: Ray Kinsella --- 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 8a976dc97f..23b0a05f78 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_} @@ -27,7 +31,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,' @@ -36,13 +40,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"