Skip to contentSkip to conversation

buildtools: fix experimental symbols listing

PATCH In review David Marchand 3 participants 7 messages Nov 25, 2019 – Nov 26, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 buildtools: fix experimental symbols listing

The map-list-symbol.sh script displays the filename, section and symbol names of map files.

Example:

$ buildtools/map-list-symbol.sh -S EXPERIMENTAL \
    lib/librte_ethdev/rte_ethdev_version.map |grep rte_mtr_create
lib/librte_ethdev/rte_ethdev_version.map EXPERIMENTAL rte_mtr_create

The experimental symbol check should only consider the symbol name.

Fixes 3290ac14eb94 ("buildtools: detect discrepancies for experimental symbols")
---
 buildtools/check-experimental-syms.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
buildtools/check-experimental-syms.sh +1 -1
index 145dd70ebf..abebb89f12 100755
@@ -23,7 +23,7 @@ trap 'rm -f "$DUMPFILE"' EXIT
 objdump -t $OBJFILE >$DUMPFILE
 
 ret=0
-for SYM in `$LIST_SYMBOL -S EXPERIMENTAL $MAPFILE`
+for SYM in `$LIST_SYMBOL -S EXPERIMENTAL $MAPFILE |cut -d ' ' -f 3`
 do
 	if grep -q "\.text.*$SYM$" $DUMPFILE &&
 		! grep -q "\.text\.experimental.*$SYM$" $DUMPFILE
Signature · 1 line
2.23.0
#1 lore raw

PATCH 2/2 buildtools: fix build with coverage enabled

A compiler can reuse a variable name and prefix it when instrumenting with coverage.

Example:

$ make defconfig T=x86_64-native-linux-gcc O=master
$ make EXTRA_CFLAGS='--coverage' O=master
[...]
    CC rte_flow.o
 rte_flow_dynf_metadata_offs is not flagged as experimental but is listed
 in version map
 Please add __rte_experimental to the definition of
 rte_flow_dynf_metadata_offs
$ objdump -t master/build/lib/librte_ethdev/rte_flow.o |grep _offs$
0000000000000000 l     F .text.startup	000000000000000a
  _GLOBAL__sub_I_65535_0_rte_flow_dynf_metadata_offs
0000000000000620 g     O .data	0000000000000004
  rte_flow_dynf_metadata_offs

Protect against this by adding a space character in the pattern.

Fixes a4bcd61de82d ("buildtools: add script to check experimental API exports")
---
 buildtools/check-experimental-syms.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
buildtools/check-experimental-syms.sh +2 -2
index abebb89f12..f3603e5bac 100755
@@ -25,8 +25,8 @@ objdump -t $OBJFILE >$DUMPFILE
 ret=0
 for SYM in `$LIST_SYMBOL -S EXPERIMENTAL $MAPFILE |cut -d ' ' -f 3`
 do
-	if grep -q "\.text.*$SYM$" $DUMPFILE &&
-		! grep -q "\.text\.experimental.*$SYM$" $DUMPFILE
+	if grep -q "\.text.*[[:space:]]$SYM$" $DUMPFILE &&
+		! grep -q "\.text\.experimental.*[[:space:]]$SYM$" $DUMPFILE
 	then
 		cat >&2 <<- END_OF_MESSAGE
 		$SYM is not flagged as experimental
Signature · 1 line
2.23.0
Tested-by on v1 2/2
#2 lore raw

Re: [dpdk-dev] [PATCH 2/2] buildtools: fix build with coverage enabled

Quoted 19 lines · David Marchand

A compiler can reuse a variable name and prefix it when instrumenting with coverage.

Example:

$ make defconfig T=x86_64-native-linux-gcc O=master
$ make EXTRA_CFLAGS='--coverage' O=master
[...]
    CC rte_flow.o
 rte_flow_dynf_metadata_offs is not flagged as experimental but is listed
 in version map
 Please add __rte_experimental to the definition of
 rte_flow_dynf_metadata_offs
$ objdump -t master/build/lib/librte_ethdev/rte_flow.o |grep _offs$
0000000000000000 l     F .text.startup	000000000000000a
  _GLOBAL__sub_I_65535_0_rte_flow_dynf_metadata_offs
0000000000000620 g     O .data	0000000000000004
  rte_flow_dynf_metadata_offs
Quoted 7 lines

Protect against this by adding a space character in the pattern.

Fixes a4bcd61de82d ("buildtools: add script to check experimental API exports")

David,

thanks a lot, it solves build problem.

It does not solve experimental symbol inconsistency problem in markup and map file, but it is a separate less critical problem.

#3 lore raw

Re: [dpdk-dev] [PATCH 2/2] buildtools: fix build with coverage enabled

Quoted 29 lines · Andrew Rybchenko
Quoted 19 lines · David Marchand

A compiler can reuse a variable name and prefix it when instrumenting with coverage.

Example:

$ make defconfig T=x86_64-native-linux-gcc O=master
$ make EXTRA_CFLAGS='--coverage' O=master
[...]
    CC rte_flow.o
 rte_flow_dynf_metadata_offs is not flagged as experimental but is listed
 in version map
 Please add __rte_experimental to the definition of
 rte_flow_dynf_metadata_offs
$ objdump -t master/build/lib/librte_ethdev/rte_flow.o |grep _offs$
0000000000000000 l     F .text.startup        000000000000000a
  _GLOBAL__sub_I_65535_0_rte_flow_dynf_metadata_offs
0000000000000620 g     O .data        0000000000000004
  rte_flow_dynf_metadata_offs
Quoted 7 lines

Protect against this by adding a space character in the pattern.

Fixes a4bcd61de82d ("buildtools: add script to check experimental API exports")
Quoted 7 lines

David,

thanks a lot, it solves build problem.

It does not solve experimental symbol inconsistency problem in markup and map file, but it is a separate less critical problem.

We have lived with this situation on experimental variables. So yes, the priority is to fix compilation.

I will see if you can do/need something about the variables.

Thanks for the tests Andrew.

Signature · 1 line
David Marchand
Tested-by on v1 1/2
#4 lore raw
In reply to David Marchand
Quoted 8 lines · David Marchand

The map-list-symbol.sh script displays the filename, section and symbol names of map files.

Example:

$ buildtools/map-list-symbol.sh -S EXPERIMENTAL \
    lib/librte_ethdev/rte_ethdev_version.map |grep rte_mtr_create
lib/librte_ethdev/rte_ethdev_version.map EXPERIMENTAL rte_mtr_create
Quoted 6 lines

The experimental symbol check should only consider the symbol name.

Fixes 3290ac14eb94 ("buildtools: detect discrepancies for experimental symbols")
Acked-by on v1 1/2
#5 lore raw
In reply to David Marchand
Quoted 35 lines · David Marchand

The map-list-symbol.sh script displays the filename, section and symbol names of map files.

Example:

$ buildtools/map-list-symbol.sh -S EXPERIMENTAL \
    lib/librte_ethdev/rte_ethdev_version.map |grep rte_mtr_create
lib/librte_ethdev/rte_ethdev_version.map EXPERIMENTAL rte_mtr_create

The experimental symbol check should only consider the symbol name.

Fixes 3290ac14eb94 ("buildtools: detect discrepancies for experimental symbols")
---
 buildtools/check-experimental-syms.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
buildtools/check-experimental-syms.sh +1 -1
index 145dd70ebf..abebb89f12 100755
@@ -23,7 +23,7 @@ trap 'rm -f "$DUMPFILE"' EXIT
 objdump -t $OBJFILE >$DUMPFILE
 
 ret=0
-for SYM in `$LIST_SYMBOL -S EXPERIMENTAL $MAPFILE`
+for SYM in `$LIST_SYMBOL -S EXPERIMENTAL $MAPFILE |cut -d ' ' -f 3`
 do
 	if grep -q "\.text.*$SYM$" $DUMPFILE &&
 		! grep -q "\.text\.experimental.*$SYM$" $DUMPFILE
Signature · 1 line
2.23.0

Series

author Tested-by Andrew Rybchenko
#6 lore raw
Quoted 25 lines · Neil Horman
Quoted 8 lines · David Marchand

The map-list-symbol.sh script displays the filename, section and symbol names of map files.

Example:

$ buildtools/map-list-symbol.sh -S EXPERIMENTAL \
    lib/librte_ethdev/rte_ethdev_version.map |grep rte_mtr_create
lib/librte_ethdev/rte_ethdev_version.map EXPERIMENTAL rte_mtr_create
Quoted 6 lines

The experimental symbol check should only consider the symbol name.

Fixes 3290ac14eb94 ("buildtools: detect discrepancies for experimental symbols")

On 11/25/19 11:10 AM, David Marchand wrote:
The map-list-symbol.sh script displays the filename, section and symbol names of map files.

Example:

$ buildtools/map-list-symbol.sh -S EXPERIMENTAL \
    lib/librte_ethdev/rte_ethdev_version.map |grep rte_mtr_create
lib/librte_ethdev/rte_ethdev_version.map EXPERIMENTAL rte_mtr_create
Quoted 6 lines

The experimental symbol check should only consider the symbol name.

Fixes 3290ac14eb94 ("buildtools: detect discrepancies for experimental symbols")
Quoted 1 line

Series applied.

--
David Marchand