[RFC PATCH 3/5] perf/tests: convert check_no_patterns_found.pl to Python

From: Breno Rodrigues Alves

Date: Sun Oct 18 2026 - 08:58:05 EST


Faithful re-implementation of tools/perf/tests/shell/common/
check_no_patterns_found.pl in Python 3 (stdlib only). Same
regex matching, same environment handling, same exit codes.

Verified byte-for-byte identical to the Perl version.

Signed-off-by: Breno Rodrigues Alves <breno3011alves@xxxxxxxxx>
---
.../shell/common/check_no_patterns_found.py | 35 +++++++++++++++++++
1 file changed, 35 insertions(+)
create mode 100755 tools/perf/tests/shell/common/check_no_patterns_found.py

diff --git a/tools/perf/tests/shell/common/check_no_patterns_found.py b/tools/perf/tests/shell/common/check_no_patterns_found.py
new file mode 100755
index 000000000..0e5d931b9
--- /dev/null
+++ b/tools/perf/tests/shell/common/check_no_patterns_found.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: GPL-2.0
+
+import os
+import re
+import sys
+
+
+def main(argv):
+ quiet = True
+ try:
+ if int(os.environ.get("TESTLOG_VERBOSITY", "0")) >= 2:
+ quiet = False
+ except ValueError:
+ pass
+
+ found = set()
+ for line in sys.stdin:
+ line = line.rstrip("\n")
+ for r in argv:
+ if re.search(r, line):
+ found.add(r)
+
+ passed = True
+ for r in argv:
+ if r in found:
+ if not quiet:
+ print(f'Regexp found: "{r}"')
+ passed = False
+
+ return 0 if passed else 1
+
+
+if __name__ == "__main__":
+ sys.exit(main(sys.argv[1:]))
\ No newline at end of file
--
2.43.0