Commit Graph

1 Commits

Author SHA1 Message Date
Ian Rogers
4e3fe6987c perf python: Port failed-syscalls from Perl to perf module
Replace the legacy Perl script failed-syscalls.pl with a standalone
Python script in tools/perf/python/failed-syscalls.py using the perf
Python module.

Improvements compared to the legacy Perl script:
- Remove the dependency on libperl and Perf::Trace::Util.
- Support both syscalls:sys_exit_* and raw_syscalls:sys_exit events (the
  legacy script only handled raw_syscalls::sys_exit).
- Use session.is_64_bit to distinguish 32-bit vs 64-bit unsigned error
  return ranges (0xfffff000..0xffffffff vs >= 0xfffffffffffff000) so
  valid 64-bit syscalls returning ~4GB values are not misclassified as
  32-bit negative errors.
- Add argparse CLI support (-i/--input and optional comm filter) and
  full type annotations.

Add a shell test
(test_failed_syscalls_python.sh) to verify the standalone script.

Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2026-09-26 20:49:29 +02:00