Skip to contentSkip to conversation

devtools: do not complain when reordering symbols

PATCH In review David Marchand 4 participants 11 messages May 3, 2019 – May 9, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 devtools: do not complain when reordering symbols

No need to shout when we are just reordering symbols in a section.

---
 devtools/check-symbol-change.sh | 6 ++++++
 1 file changed, 6 insertions(+)
devtools/check-symbol-change.sh +6 -0
index 40eb953..8da7650 100755
@@ -121,6 +121,12 @@ check_for_rule_violations()
 				continue
 			fi
 
+			# This symbol is moving inside a section, nothing to do
+			if [ "$oldsecname" = "$secname" ]
+			then
+				continue
+			fi
+
 			# This symbol is moving between two sections (the
 			# original section is not experimental).
 			# This can be legit, just warn.
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 2/4 devtools: handle section suppression

Even if rare, the check script should handle removing a section.

Fixes 4bec48184e33 ("devtools: add checks for ABI symbol addition")
---
 devtools/check-symbol-change.sh | 1 +
 1 file changed, 1 insertion(+)
devtools/check-symbol-change.sh +1 -0
index 8da7650..d5fad04 100755
@@ -32,6 +32,7 @@ build_map_changes()
 		# symbol rule below
 		/^.*{/ {
 			gsub("+", "");
+			gsub("-", "");
 			if (in_map == 1) {
 				sec=$(NF-1); in_sec=1;
 			}
Signature · 1 line
1.8.3.1
#2 lore raw

Re: [dpdk-dev] [PATCH 2/4] devtools: handle section suppression

Quoted 26 lines · David Marchand

Even if rare, the check script should handle removing a section.

Fixes 4bec48184e33 ("devtools: add checks for ABI symbol addition")
---
 devtools/check-symbol-change.sh | 1 +
 1 file changed, 1 insertion(+)
devtools/check-symbol-change.sh +1 -0
index 8da7650..d5fad04 100755
@@ -32,6 +32,7 @@ build_map_changes()
 		# symbol rule below
 		/^.*{/ {
 			gsub("+", "");
+			gsub("-", "");
 			if (in_map == 1) {
 				sec=$(NF-1); in_sec=1;
 			}
Signature · 1 line
1.8.3.1

Don't you also need to add some logic in the symbol detection match rule to print an appropriate indicator that a symbol is being removed? With just this change, you will note that you are parsing a section, but you will never trigger a symbol match

Neil

#3 lore raw

Re: [dpdk-dev] [PATCH 2/4] devtools: handle section suppression

Quoted 26 lines · Neil Horman

Review

Quoted 11 lines · David Marchand

Even if rare, the check script should handle removing a section.

Fixes 4bec48184e33 ("devtools: add checks for ABI symbol addition")
---
 devtools/check-symbol-change.sh | 1 +
 1 file changed, 1 insertion(+)
(quoted diff) +0 -0

b/devtools/check-symbol-change.sh

Quoted 13 lines

index 8da7650..d5fad04 100755

devtools/check-symbol-change.sh +1 -1
@@ -32,6 +32,7 @@ build_map_changes()
              # symbol rule below
              /^.*{/ {
                      gsub("+", "");
+                     gsub("-", "");
                      if (in_map == 1) {
                              sec=$(NF-1); in_sec=1;
                      }
--

1.8.3.1

Quoted 9 lines
Quoted 2 lines

Don't you also need to add some logic in the symbol detection match rule to print an appropriate indicator that a symbol is being removed? With just this
change, you will note that you are parsing a section, but you will never trigger
a symbol match

I do remember seeing a warning about the "-EXPERIMENTAL" section. And this is why I added this.
But since then I reorganised my series and eliminated some parts... so you are most likely right.
I will double check and repost.

Signature · 1 line
David Marchand
#4 lore raw

Re: [dpdk-dev] [PATCH 2/4] devtools: handle section suppression

Quoted 39 lines · David Marchand
Quoted 27 lines · Neil Horman

Review

Quoted 11 lines · David Marchand

Even if rare, the check script should handle removing a section.

Fixes 4bec48184e33 ("devtools: add checks for ABI symbol addition")
---
 devtools/check-symbol-change.sh | 1 +
 1 file changed, 1 insertion(+)
(quoted diff) +0 -0

b/devtools/check-symbol-change.sh

Quoted 14 lines

index 8da7650..d5fad04 100755

devtools/check-symbol-change.sh +1 -1
@@ -32,6 +32,7 @@ build_map_changes()
              # symbol rule below
              /^.*{/ {
                      gsub("+", "");
+                     gsub("-", "");
                      if (in_map == 1) {
                              sec=$(NF-1); in_sec=1;
                      }
--

1.8.3.1

Quoted 9 lines
Quoted 1 line

Don't you also need to add some logic in the symbol detection match rule to
print an appropriate indicator that a symbol is being removed? With just this
change, you will note that you are parsing a section, but you will never trigger
a symbol match

Quoted 7 lines

I do remember seeing a warning about the "-EXPERIMENTAL" section. And this is why I added this.
But since then I reorganised my series and eliminated some parts... so you are most likely right.
I will double check and repost.

Yes, you are right, I moved this out of another patch that I ended up not sending.
But it makes no sense by itself.
I will drop this in v2.

Any comments on the other patches ?
Thanks Neil.

Signature · 1 line
David Marchand
#5 lore raw

Re: [dpdk-dev] [PATCH 2/4] devtools: handle section suppression

Quoted 49 lines · David Marchand
Quoted 39 lines · David Marchand
Quoted 27 lines · Neil Horman

Review

Quoted 11 lines · David Marchand

Even if rare, the check script should handle removing a section.

Fixes 4bec48184e33 ("devtools: add checks for ABI symbol addition")
---
 devtools/check-symbol-change.sh | 1 +
 1 file changed, 1 insertion(+)
(quoted diff) +0 -0

b/devtools/check-symbol-change.sh

Quoted 14 lines

index 8da7650..d5fad04 100755

devtools/check-symbol-change.sh +1 -1
@@ -32,6 +32,7 @@ build_map_changes()
              # symbol rule below
              /^.*{/ {
                      gsub("+", "");
+                     gsub("-", "");
                      if (in_map == 1) {
                              sec=$(NF-1); in_sec=1;
                      }
--

1.8.3.1

Quoted 9 lines
Quoted 1 line

Don't you also need to add some logic in the symbol detection match rule to
print an appropriate indicator that a symbol is being removed? With just this
change, you will note that you are parsing a section, but you will never trigger
a symbol match

Quoted 7 lines

I do remember seeing a warning about the "-EXPERIMENTAL" section. And this is why I added this.
But since then I reorganised my series and eliminated some parts... so you are most likely right.
I will double check and repost.

Quoted 8 lines

Yes, you are right, I moved this out of another patch that I ended up not sending.
But it makes no sense by itself.
I will drop this in v2.

Any comments on the other patches ?
Thanks Neil.

No, I don't think I do, thanks for checking though! Neil

Quoted 3 lines
Signature · 2 lines
-- 
David Marchand
#6 lore raw

PATCH 3/4 devtools: fix symbol name in log message

In reply to David Marchand

We have an incorrect variable name in this log.

Fixes 4bec48184e33 ("devtools: add checks for ABI symbol addition")
---
 devtools/check-symbol-change.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
devtools/check-symbol-change.sh +1 -1
index d5fad04..9ada81e 100755
@@ -98,7 +98,7 @@ check_for_rule_violations()
 			then
 				# Just inform the user of this occurrence, but
 				# don't flag it as an error
-				echo -n "INFO: symbol $syname is added but "
+				echo -n "INFO: symbol $symname is added but "
 				echo -n "patch has insuficient context "
 				echo -n "to determine the section name "
 				echo -n "please ensure the version is "
Signature · 1 line
1.8.3.1
#7 lore raw

PATCH 4/4 devtools: fix direct additions to stable API

In reply to David Marchand

The incriminated commit broke the detection of new symbols skipping the EXPERIMENTAL step before entering a stable abi section.
sed won't return an error, check a null output instead.

Fixes 3630757803ab ("devtools: accept experimental symbol promotion")
---
 devtools/check-symbol-change.sh | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)
devtools/check-symbol-change.sh +17 -8
index 9ada81e..116c311 100755
@@ -111,15 +111,24 @@ check_for_rule_violations()
 
 			# A symbol can not enter a non experimental
 			# section directly
-			if [ $? -ne 0 ] && [ "$secname" != 'EXPERIMENTAL' ]
+			if [ -z "$oldsecname" ]
 			then
-				echo -n "ERROR: symbol $symname "
-				echo -n "is added in the $secname "
-				echo -n "section, but is expected to "
-				echo -n "be added in the EXPERIMENTAL "
-				echo "section of the version map"
-				ret=1
-				continue
+				if [ "$secname" = 'EXPERIMENTAL' ]
+				then
+					echo -n "INFO: symbol $symname has "
+					echo -n "been added to the "
+					echo -n "EXPERIMENTAL section of the "
+					echo "version map"
+					continue
+				else
+					echo -n "ERROR: symbol $symname "
+					echo -n "is added in the $secname "
+					echo -n "section, but is expected to "
+					echo -n "be added in the EXPERIMENTAL "
+					echo "section of the version map"
+					ret=1
+					continue
+				fi
 			fi
 
 			# This symbol is moving inside a section, nothing to do
Signature · 1 line
1.8.3.1
#8 lore raw

Re: [dpdk-dev] [dpdk-stable] [PATCH 4/4] devtools: fix direct additions to stable API

03/05/2019 16:34, David Marchand:

Quoted 8 lines

The incriminated commit broke the detection of new symbols skipping the EXPERIMENTAL step before entering a stable abi section.
sed won't return an error, check a null output instead.

Fixes 3630757803ab ("devtools: accept experimental symbol promotion")

Series applied (without patch 2), thanks

#9 lore raw
In reply to David Marchand

Hi David,

Do you have this script wired into the DPDK CI?
Or is this purely for testing before packaging?

Ray K

Quoted 25 lines · David Marchand

No need to shout when we are just reordering symbols in a section.

---
 devtools/check-symbol-change.sh | 6 ++++++
 1 file changed, 6 insertions(+)
devtools/check-symbol-change.sh +6 -0
index 40eb953..8da7650 100755
@@ -121,6 +121,12 @@ check_for_rule_violations()
 				continue
 			fi
 
+			# This symbol is moving inside a section, nothing to do
+			if [ "$oldsecname" = "$secname" ]
+			then
+				continue
+			fi
+
 			# This symbol is moving between two sections (the
 			# original section is not experimental).
 			# This can be legit, just warn.
#10 lore raw

Hello Ray,

Quoted 3 lines · Ray Kinsella

Do you have this script wired into the DPDK CI?
Or is this purely for testing before packaging?

Iirc, Thomas has this script running on the server side.

See for example the report for this very patch on the dpdk-test ml:
http://mails.dpdk.org/archives/test-report/2019-May/081948.html

Which is seen in patchwork as:
http://patchwork.dpdk.org/patch/53255/

"ci/checkpatch success coding style OK"

Signature · 1 line
David Marchand