mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Breno Rodrigues Alves <breno3011alves@gmail.com>
To: irogers@google.com
Cc: acme@kernel.org, namhyung@kernel.org, shuah@kernel.org,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	linux-kselftest@vger.kernel.org,
	Breno Rodrigues Alves <breno3011alves@gmail.com>
Subject: [RFC PATCH v4 0/2] perf/kselftest: convert Perl test helpers to Python
Date: Wed, 21 Oct 2026 17:55:04 -0300	[thread overview]
Message-ID: <20261021205506.26736-1-breno3011alves@gmail.com> (raw)
In-Reply-To: <20261018134322.26445-1-breno3011alves@gmail.com>

This is v4 of the series converting the Perl test helpers to Python.

Changes since v3:
 - Fixed pylint W1514 in check_errors_whitelisted.py by passing an
   explicit encoding to open():
     open(path, encoding="utf-8", errors="surrogateescape")
   "surrogateescape" preserves the byte-for-byte behavior of the Perl
   original, which reads raw bytes.

 - Also fixed two issues found while testing the series locally:
   * open() failures on the whitelist now exit with the underlying
     errno (matching Perl's die), e.g. ENOENT -> rc 2, instead of
     always rc 1.
   * stdin/stdout are reconfigured with surrogateescape so that
     non-UTF-8 bytes in the log (e.g. oops/KASAN output) do not
     raise UnicodeDecodeError/UnicodeEncodeError, preserving the
     byte-for-byte behavior of the Perl originals.

 - The series is split by tree, addressing Ian's suggestion:
   * Patch 1 (kselftest:) touches only tools/testing/selftests/ and can
     go through the kselftest tree.
   * Patch 2 (perf/tests:) touches only tools/perf/ and can go through
     the perf tree.

 - Note on pylint-tests: it fails on tools/perf/tests/shell/lib/
   perf_json_output_lint.py with:
     W4904: Using deprecated class FileType of module argparse
   This is pre-existing in perf-tools-next and reproduces on the base
   commit without this series. The four files touched by this series
   pass pylint 10/10 with the flags used by Makefile.perf.

Signed-off-by: Breno Rodrigues Alves <breno3011alves@gmail.com>


Breno Rodrigues Alves (2):
  kselftest: convert prefix.pl to Python
  perf/tests: convert check_*.pl helpers to Python

 tools/perf/Makefile.perf                      |  2 +-
 .../base_probe/test_adding_blacklisted.sh     |  6 +-
 .../shell/base_probe/test_adding_kernel.sh    | 44 +++++++-------
 .../perf/tests/shell/base_probe/test_basic.sh | 12 ++--
 .../shell/base_probe/test_invalid_options.sh  |  4 +-
 tools/perf/tests/shell/base_report/setup.sh   |  4 +-
 .../tests/shell/base_report/test_basic.sh     | 54 ++++++++---------
 .../shell/common/check_all_lines_matched.pl   | 39 -------------
 .../shell/common/check_all_lines_matched.py   | 47 +++++++++++++++
 .../shell/common/check_all_patterns_found.pl  | 34 -----------
 .../shell/common/check_all_patterns_found.py  | 37 ++++++++++++
 .../shell/common/check_errors_whitelisted.pl  | 51 ----------------
 .../shell/common/check_errors_whitelisted.py  | 58 +++++++++++++++++++
 .../shell/common/check_no_patterns_found.pl   | 34 -----------
 .../shell/common/check_no_patterns_found.py   | 37 ++++++++++++
 tools/testing/selftests/Makefile              |  2 +-
 tools/testing/selftests/kselftest/prefix.pl   | 24 --------
 tools/testing/selftests/kselftest/prefix.py   | 24 ++++++++
 tools/testing/selftests/kselftest/runner.sh   |  4 +-
 19 files changed, 269 insertions(+), 248 deletions(-)
 delete mode 100755 tools/perf/tests/shell/common/check_all_lines_matched.pl
 create mode 100755 tools/perf/tests/shell/common/check_all_lines_matched.py
 delete mode 100755 tools/perf/tests/shell/common/check_all_patterns_found.pl
 create mode 100755 tools/perf/tests/shell/common/check_all_patterns_found.py
 delete mode 100755 tools/perf/tests/shell/common/check_errors_whitelisted.pl
 create mode 100755 tools/perf/tests/shell/common/check_errors_whitelisted.py
 delete mode 100755 tools/perf/tests/shell/common/check_no_patterns_found.pl
 create mode 100755 tools/perf/tests/shell/common/check_no_patterns_found.py
 delete mode 100755 tools/testing/selftests/kselftest/prefix.pl
 create mode 100755 tools/testing/selftests/kselftest/prefix.py

-- 
2.56.0


  parent reply	other threads:[~2026-10-21 20:55 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-18 12:56 [RFC PATCH 0/5] perf/tests: " Breno Rodrigues Alves
2026-10-18 12:56 ` [RFC PATCH 1/5] perf/kselftest: convert prefix.pl " Breno Rodrigues Alves
2026-10-18 12:56 ` [RFC PATCH 2/5] perf/tests: convert check_all_patterns_found.pl " Breno Rodrigues Alves
2026-10-18 12:56 ` [RFC PATCH 3/5] perf/tests: convert check_no_patterns_found.pl " Breno Rodrigues Alves
2026-10-18 12:56 ` [RFC PATCH 4/5] perf/tests: convert check_all_lines_matched.pl " Breno Rodrigues Alves
2026-10-18 12:56 ` [RFC PATCH 5/5] perf/tests: convert check_errors_whitelisted.pl " Breno Rodrigues Alves
2026-10-18 13:30 ` [RFC PATCH v2 0/2] perf: convert Perl test helpers " Breno Rodrigues Alves
2026-10-18 13:30   ` [RFC PATCH v2 1/2] perf/kselftest: convert prefix.pl " Breno Rodrigues Alves
2026-10-18 13:30   ` [RFC PATCH v2 2/2] perf/tests: convert check_*.pl helpers " Breno Rodrigues Alves
2026-10-18 13:43   ` [RFC PATCH v3 0/2] perf: convert Perl test " Breno Rodrigues Alves
2026-10-18 13:43     ` [RFC PATCH v3 1/2] perf/kselftest: convert prefix.pl " Breno Rodrigues Alves
2026-10-18 13:43     ` [RFC PATCH v3 2/2] perf/tests: convert check_*.pl helpers " Breno Rodrigues Alves
2026-10-21 16:10       ` Ian Rogers
2026-10-21 20:55     ` Breno Rodrigues Alves [this message]
2026-10-21 20:55       ` [RFC PATCH v4 1/2] kselftest: convert prefix.pl " Breno Rodrigues Alves
2026-10-21 20:55       ` [RFC PATCH v4 2/2] perf/tests: convert check_*.pl helpers " Breno Rodrigues Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261021205506.26736-1-breno3011alves@gmail.com \
    --to=breno3011alves@gmail.com \
    --cc=acme@kernel.org \
    --cc=irogers@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=namhyung@kernel.org \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®