All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] get_abi.pl: some fixes
@ 2021-09-30  9:39 Mauro Carvalho Chehab
  2021-09-30  9:39 ` [PATCH 1/2] scripts: get_abi.pl: fix fallback rule for undefined symbols Mauro Carvalho Chehab
  2021-09-30  9:40 ` [PATCH 2/2] scripts: get_abi.pl: better generate regex from what fields Mauro Carvalho Chehab
  0 siblings, 2 replies; 3+ messages in thread
From: Mauro Carvalho Chehab @ 2021-09-30  9:39 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Linux Doc Mailing List
  Cc: Mauro Carvalho Chehab, linux-kernel, Jonathan Corbet

Hi Greg,

This small series contain:

patch 1: 
  - fixes a rule that searches for some additional regexes.
    This will make the script slower but will avoid some false-positives
    (10 seconds instead of 6 seconds here)

patch 2:
  - contain some cleanups to the regexes. That will likely make
    some regular expressions to run faster.

I have an idea that might speedup the script again, but I need
to do some tests.

Mauro Carvalho Chehab (2):
  scripts: get_abi.pl: fix fallback rule for undefined symbols
  scripts: get_abi.pl: better generate regex from what fields

 scripts/get_abi.pl | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

-- 
2.31.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] scripts: get_abi.pl: fix fallback rule for undefined symbols
  2021-09-30  9:39 [PATCH 0/2] get_abi.pl: some fixes Mauro Carvalho Chehab
@ 2021-09-30  9:39 ` Mauro Carvalho Chehab
  2021-09-30  9:40 ` [PATCH 2/2] scripts: get_abi.pl: better generate regex from what fields Mauro Carvalho Chehab
  1 sibling, 0 replies; 3+ messages in thread
From: Mauro Carvalho Chehab @ 2021-09-30  9:39 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Linux Doc Mailing List
  Cc: Mauro Carvalho Chehab, Jonathan Corbet, linux-kernel

The rule that falls back to the long regex list is wrong:
it is just running again the same loop it did before.

change it to look at the "others" table.

That slows the processing speed, but provides a better
list of undefined symbols.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---

To mailbombing on a large number of people, only mailing lists were C/C on the cover.
See [PATCH 0/2] at: https://lore.kernel.org/all/cover.1632994565.git.mchehab+huawei@kernel.org/

 scripts/get_abi.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl
index d32dcd7cca5d..2f3674bb3c9e 100755
--- a/scripts/get_abi.pl
+++ b/scripts/get_abi.pl
@@ -746,7 +746,7 @@ sub check_file($$)
 	}
 
 	if ($leave ne "others") {
-		my @expr = @{$leaf{$leave}->{expr}};
+		my @expr = @{$leaf{"others"}->{expr}};
 		for (my $i = 0; $i < @names; $i++) {
 			foreach my $re (@expr) {
 				print STDERR "$names[$i] =~ /^$re\$/\n" if ($debug && $dbg_undefined);
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] scripts: get_abi.pl: better generate regex from what fields
  2021-09-30  9:39 [PATCH 0/2] get_abi.pl: some fixes Mauro Carvalho Chehab
  2021-09-30  9:39 ` [PATCH 1/2] scripts: get_abi.pl: fix fallback rule for undefined symbols Mauro Carvalho Chehab
@ 2021-09-30  9:40 ` Mauro Carvalho Chehab
  1 sibling, 0 replies; 3+ messages in thread
From: Mauro Carvalho Chehab @ 2021-09-30  9:40 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Linux Doc Mailing List
  Cc: Mauro Carvalho Chehab, Jonathan Corbet, linux-kernel

Using repeating sequencies of .* seem to slow down the
processing speed on some cases. Also, currently, a "."
character is not properly handled as such.

Change the way regexes are created, in order to produce
better search expressions.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---

To mailbombing on a large number of people, only mailing lists were C/C on the cover.
See [PATCH 0/2] at: https://lore.kernel.org/all/cover.1632994565.git.mchehab+huawei@kernel.org/

 scripts/get_abi.pl | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl
index 2f3674bb3c9e..6212f58b69c6 100755
--- a/scripts/get_abi.pl
+++ b/scripts/get_abi.pl
@@ -842,8 +842,8 @@ sub undefined_symbols {
 
 			# Convert what into regular expressions
 
-			$what =~ s,/\.\.\./,/*/,g;
-			$what =~ s,\*,.*,g;
+			# Escape dot characters
+			$what =~ s/\./\xf6/g;
 
 			# Temporarily change [0-9]+ type of patterns
 			$what =~ s/\[0\-9\]\+/\xff/g;
@@ -859,6 +859,8 @@ sub undefined_symbols {
 			$what =~ s/[\{\<\[]([\w_]+)(?:[,|]+([\w_]+)){1,}[\}\>\]]/($1|$2)/g;
 
 			# Handle wildcards
+			$what =~ s,\*,.*,g;
+			$what =~ s,/\xf6..,/.*,g;
 			$what =~ s/\<[^\>]+\>/.*/g;
 			$what =~ s/\{[^\}]+\}/.*/g;
 			$what =~ s/\[[^\]]+\]/.*/g;
@@ -891,6 +893,13 @@ sub undefined_symbols {
 			# Special case: IIO ABI which a parenthesis.
 			$what =~ s/sqrt(.*)/sqrt\(.*\)/;
 
+			# Simplify regexes with multiple .*
+			$what =~ s#(?:\.\*){2,}##g;
+#			$what =~ s#\.\*/\.\*#.*#g;
+
+			# Recover dot characters
+			$what =~ s/\xf6/\./g;
+
 			my $leave = get_leave($what);
 
 			my $added = 0;
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-30  9:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-30  9:39 [PATCH 0/2] get_abi.pl: some fixes Mauro Carvalho Chehab
2021-09-30  9:39 ` [PATCH 1/2] scripts: get_abi.pl: fix fallback rule for undefined symbols Mauro Carvalho Chehab
2021-09-30  9:40 ` [PATCH 2/2] scripts: get_abi.pl: better generate regex from what fields Mauro Carvalho Chehab

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.