From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DDBDF43337; Wed, 15 Nov 2023 11:43:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7B7A240285; Wed, 15 Nov 2023 11:43:31 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id CA3AB40268 for ; Wed, 15 Nov 2023 11:43:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700045009; 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=PCK+/3HxL1c5pPJikedDhfw376P/m6mp12bA15jJeRI=; b=KUUiCP8laOORp3GV9PtV64zYiYRo6aCqwybNiULHmve1yCrH3vzjyGp6iAco/TUivfhW0f XcLhMtTeTZxzhh8VP7mty7kp0mrPJ8VyS5x7kmKskTC9VS4mncuqn/YBy5dcFAQ57uEn+v LwnK6Ak31eYtORJ6eTOzwta9EUojk+k= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-25-GOPw7_DHO-6FQ8uGpvzr7w-1; Wed, 15 Nov 2023 05:43:25 -0500 X-MC-Unique: GOPw7_DHO-6FQ8uGpvzr7w-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4782381F448; Wed, 15 Nov 2023 10:43:25 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.224.38]) by smtp.corp.redhat.com (Postfix) with ESMTP id 98DAC40C6EBB; Wed, 15 Nov 2023 10:43:24 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Thomas Monjalon Subject: [PATCH v5 1/2] devtools: add check on symbol maps format Date: Wed, 15 Nov 2023 11:42:58 +0100 Message-ID: <20231115104259.3045847-1-david.marchand@redhat.com> In-Reply-To: <20230811154944.2947783-1-david.marchand@redhat.com> References: <20230811154944.2947783-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 Add a check on symbol maps format. This will be required by a next commit. Signed-off-by: David Marchand --- Changes since v4: - rebased, - handled next abi version in the check, Changes since v3: - fixed Alpine build (same issue with { in awk expression than commit e1ab26df4862 ("buildtools: fix build with busybox")), Changes since v2: - fixed FreeBSD build by replacing (|pattern) with (pattern)?, Changes since v1: - moved this check in a separate patch, - fixed ethdev map file, --- devtools/check-symbol-maps.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/devtools/check-symbol-maps.sh b/devtools/check-symbol-maps.sh index 8c116bfa9c..ba2f892f56 100755 --- a/devtools/check-symbol-maps.sh +++ b/devtools/check-symbol-maps.sh @@ -74,4 +74,27 @@ if [ -n "$empty_maps" ] ; then ret=1 fi +find_bad_format_maps () +{ + abi_version=$(cut -d'.' -f 1 ABI_VERSION) + next_abi_version=$((abi_version + 1)) + for map in $@ ; do + cat $map | awk ' + /^(DPDK_('$abi_version'|'$next_abi_version')|EXPERIMENTAL|INTERNAL) \{$/ { next; } # start of a section + /^}( DPDK_'$abi_version')?;$/ { next; } # end of a section + /^$/ { next; } # empty line + /^\t(global:|local: \*;)$/ { next; } # qualifiers + /^\t[a-zA-Z_0-9]*;( # WINDOWS_NO_EXPORT)?$/ { next; } # symbols + /^\t# added in [0-9]*\.[0-9]*$/ { next; } # version comments + { print $0; }' || echo $map + done +} + +bad_format_maps=$(find_bad_format_maps $@) +if [ -n "$bad_format_maps" ] ; then + echo "Found badly formatted maps:" + echo "$bad_format_maps" + ret=1 +fi + exit $ret -- 2.41.0