devtools: catch empty symbol maps

Message ID 20221114141651.1255306-1-david.marchand@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series devtools: catch empty symbol maps |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS

Commit Message

David Marchand Nov. 14, 2022, 2:16 p.m. UTC
  version.map are now optional for drivers if no symbol is exported.
Having no symbol exported from a library does not make sense.

Catch all empty maps and warn about them.

Example:
$ ./devtools/check-symbol-maps.sh
Found empty maps:
drivers/crypto/uadk/version.map
drivers/net/gve/version.map
drivers/net/idpf/version.map

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 devtools/check-symbol-maps.sh | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
  

Comments

Bruce Richardson Nov. 14, 2022, 2:31 p.m. UTC | #1
On Mon, Nov 14, 2022 at 03:16:51PM +0100, David Marchand wrote:
> version.map are now optional for drivers if no symbol is exported.
> Having no symbol exported from a library does not make sense.
> 
> Catch all empty maps and warn about them.
> 
> Example:
> $ ./devtools/check-symbol-maps.sh
> Found empty maps:
> drivers/crypto/uadk/version.map
> drivers/net/gve/version.map
> drivers/net/idpf/version.map
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---

Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  
Ferruh Yigit Nov. 14, 2022, 3:10 p.m. UTC | #2
On 11/14/2022 2:31 PM, Bruce Richardson wrote:
> On Mon, Nov 14, 2022 at 03:16:51PM +0100, David Marchand wrote:
>> version.map are now optional for drivers if no symbol is exported.
>> Having no symbol exported from a library does not make sense.
>>
>> Catch all empty maps and warn about them.
>>
>> Example:
>> $ ./devtools/check-symbol-maps.sh
>> Found empty maps:
>> drivers/crypto/uadk/version.map
>> drivers/net/gve/version.map
>> drivers/net/idpf/version.map
>>
>> Signed-off-by: David Marchand <david.marchand@redhat.com>
>> ---
> 
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>


+1 to have automated checks,
Tested-by: Ferruh Yigit <ferruh.yigit@amd.com>
  
Thomas Monjalon Nov. 15, 2022, 5:20 p.m. UTC | #3
14/11/2022 16:10, Ferruh Yigit:
> On 11/14/2022 2:31 PM, Bruce Richardson wrote:
> > On Mon, Nov 14, 2022 at 03:16:51PM +0100, David Marchand wrote:
> >> version.map are now optional for drivers if no symbol is exported.
> >> Having no symbol exported from a library does not make sense.
> >>
> >> Catch all empty maps and warn about them.
> >>
> >> Example:
> >> $ ./devtools/check-symbol-maps.sh
> >> Found empty maps:
> >> drivers/crypto/uadk/version.map
> >> drivers/net/gve/version.map
> >> drivers/net/idpf/version.map
> >>
> >> Signed-off-by: David Marchand <david.marchand@redhat.com>
> > 
> > Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> 
> +1 to have automated checks,
> Tested-by: Ferruh Yigit <ferruh.yigit@amd.com>

Applied, thanks.
  

Patch

diff --git a/devtools/check-symbol-maps.sh b/devtools/check-symbol-maps.sh
index 32e1fa5c8f..0a6062de26 100755
--- a/devtools/check-symbol-maps.sh
+++ b/devtools/check-symbol-maps.sh
@@ -60,4 +60,18 @@  if [ -n "$local_miss_maps" ] ; then
     ret=1
 fi
 
+find_empty_maps ()
+{
+    for map in $@ ; do
+        [ $(buildtools/map-list-symbol.sh $map | wc -l) != '0' ] || echo $map
+    done
+}
+
+empty_maps=$(find_empty_maps $@)
+if [ -n "$empty_maps" ] ; then
+    echo "Found empty maps:"
+    echo "$empty_maps"
+    ret=1
+fi
+
 exit $ret