net/ice/base: handle error gracefully in HW table calloc
[dpdk.git] / devtools / check-symbol-maps.sh
1 #! /bin/sh -e
2 # SPDX-License-Identifier: BSD-3-Clause
3 # Copyright 2018 Mellanox Technologies, Ltd
4
5 cd $(dirname $0)/..
6
7 # speed up by ignoring Unicode details
8 export LC_ALL=C
9
10 find_orphan_symbols ()
11 {
12     for map in $(find lib drivers -name '*.map') ; do
13         for sym in $(sed -rn 's,^([^}]*_.*);,\1,p' $map) ; do
14             if echo $sym | grep -q '^per_lcore_' ; then
15                 symsrc=${sym#per_lcore_}
16             elif echo $sym | grep -q '^__rte_.*_trace_' ; then
17                 symsrc=${sym#__}
18             else
19                 symsrc=$sym
20             fi
21             if ! grep -q -r --exclude=$(basename $map) \
22                     -w $symsrc $(dirname $map) ; then
23                 echo "$map: $sym"
24             fi
25         done
26     done
27 }
28
29 orphan_symbols=$(find_orphan_symbols)
30 if [ -n "$orphan_symbols" ] ; then
31     echo "Found only in symbol map file:"
32     echo "$orphan_symbols" | sed 's,^,\t,'
33     exit 1
34 fi