summaryrefslogtreecommitdiffstats
path: root/src/spdk/dpdk/devtools/check-symbol-maps.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
commite6918187568dbd01842d8d1d2c808ce16a894239 (patch)
tree64f88b554b444a49f656b6c656111a145cbbaa28 /src/spdk/dpdk/devtools/check-symbol-maps.sh
parentInitial commit. (diff)
downloadceph-e6918187568dbd01842d8d1d2c808ce16a894239.tar.xz
ceph-e6918187568dbd01842d8d1d2c808ce16a894239.zip
Adding upstream version 18.2.2.upstream/18.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/spdk/dpdk/devtools/check-symbol-maps.sh')
-rwxr-xr-xsrc/spdk/dpdk/devtools/check-symbol-maps.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/spdk/dpdk/devtools/check-symbol-maps.sh b/src/spdk/dpdk/devtools/check-symbol-maps.sh
new file mode 100755
index 000000000..7fdfaa11c
--- /dev/null
+++ b/src/spdk/dpdk/devtools/check-symbol-maps.sh
@@ -0,0 +1,34 @@
+#! /bin/sh -e
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2018 Mellanox Technologies, Ltd
+
+cd $(dirname $0)/..
+
+# speed up by ignoring Unicode details
+export LC_ALL=C
+
+find_orphan_symbols ()
+{
+ for map in $(find lib drivers -name '*.map') ; do
+ for sym in $(sed -rn 's,^([^}]*_.*);,\1,p' $map) ; do
+ if echo $sym | grep -q '^per_lcore_' ; then
+ symsrc=${sym#per_lcore_}
+ elif echo $sym | grep -q '^__rte_.*_trace_' ; then
+ symsrc=${sym#__}
+ else
+ symsrc=$sym
+ fi
+ if ! grep -q -r --exclude=$(basename $map) \
+ -w $symsrc $(dirname $map) ; then
+ echo "$map: $sym"
+ fi
+ done
+ done
+}
+
+orphan_symbols=$(find_orphan_symbols)
+if [ -n "$orphan_symbols" ] ; then
+ echo "Found only in symbol map file:"
+ echo "$orphan_symbols" | sed 's,^,\t,'
+ exit 1
+fi