2 # SPDX-License-Identifier: BSD-3-Clause
3 # Copyright 2018 Mellanox Technologies, Ltd
7 # speed up by ignoring Unicode details
12 find_orphan_symbols ()
14 for map in $(find lib drivers -name '*.map') ; do
15 for sym in $(sed -rn 's,^([^}]*_.*);,\1,p' $map) ; do
16 if echo $sym | grep -q '^per_lcore_' ; then
17 symsrc=${sym#per_lcore_}
18 elif echo $sym | grep -q '^__rte_.*_trace_' ; then
23 if ! grep -q -r --exclude=$(basename $map) \
24 -w $symsrc $(dirname $map) ; then
31 orphan_symbols=$(find_orphan_symbols)
32 if [ -n "$orphan_symbols" ] ; then
33 echo "Found only in symbol map file:"
34 echo "$orphan_symbols" | sed 's,^,\t,'
38 find_orphan_windows_symbols ()
40 for def in $(find lib drivers -name '*_exports.def') ; do
41 map=$(dirname $def)/version.map
42 for sym in $(grep -v ^EXPORTS $def); do
43 grep -q $sym $map || echo $sym
48 orphan_windows_symbols=$(find_orphan_windows_symbols)
49 if [ -n "$orphan_windows_symbols" ] ; then
50 echo "Found only in Windows export file:"
51 echo "$orphan_windows_symbols" | sed 's,^,\t,'