From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: Thomas Monjalon <thomas@monjalon.net>
Subject: [PATCH v5 1/2] devtools: add check on symbol maps format
Date: Wed, 15 Nov 2023 11:42:58 +0100 [thread overview]
Message-ID: <20231115104259.3045847-1-david.marchand@redhat.com> (raw)
In-Reply-To: <20230811154944.2947783-1-david.marchand@redhat.com>
Add a check on symbol maps format.
This will be required by a next commit.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
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
next prev parent reply other threads:[~2023-11-15 10:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-11 15:49 [PATCH] devtools: list symbols by version David Marchand
2023-08-11 17:13 ` Stephen Hemminger
2023-08-14 9:48 ` Thomas Monjalon
2023-08-15 10:01 ` David Marchand
2023-08-15 10:36 ` [PATCH v2 1/2] devtools: add check on symbol maps format David Marchand
2023-08-15 10:36 ` [PATCH v2 2/2] devtools: list symbols by version David Marchand
2023-08-15 17:42 ` [PATCH v3 1/2] devtools: add check on symbol maps format David Marchand
2023-08-15 17:42 ` [PATCH v3 2/2] devtools: list symbols by version David Marchand
2023-08-16 7:16 ` [PATCH v4 1/2] devtools: add check on symbol maps format David Marchand
2023-08-16 7:16 ` [PATCH v4 2/2] devtools: list symbols by version David Marchand
2023-11-15 10:42 ` David Marchand [this message]
2023-11-15 10:42 ` [PATCH v5 " David Marchand
2023-11-27 7:37 ` David Marchand
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=20231115104259.3045847-1-david.marchand@redhat.com \
--to=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--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).