[PATCH v7 00/16] perf test: Parallel harness optimizations, summary & JUnit XML

From: Ian Rogers

Date: Tue Jun 02 2026 - 03:38:40 EST


This patch series dramatically improves the speed, usability, and test
reporting of the Linux perf test suite (`perf test`). It optimizes the
parallel execution harness, introduces automated summary reporting, adds
standardized JUnit XML report generation, and removes runtime external C
compiler dependencies for continuous integration environments.

1. Parallel execution optimizations:
- When running in parallel verbose mode (-v), the parent test harness
previously only polled the pipe of the current active test wait-loop,
blocking other children once they filled their 64KB pipe buffer.
This series refactors the loop to drain all children's output pipes
simultaneously, reducing parallel execution times for high-output
suites (like PMU events) from ~35 seconds down to ~5.9 seconds.
- Hardens `check_if_command_finished()` and `wait_or_whine()` inside
`tools/lib/subcmd` to safely handle invalid PIDs, using a robust
waitpid fallback when procfs limits are hit to prevent zombie leak
loops and PID reuse hazards.
- Fixes race conditions and concurrent process reaping hazards inside
the Intel TPEBS driver (`intel-tpebs.c`).

2. Improved Console Summary and Failure Snippets:
- Shows context failure snippets for failed tests in moderate verbose
mode (-v) without requiring extremely verbose output (-vv).
- Prints a concise, colored console execution summary showing passed,
skipped, and failed counts for main tests and individual subtests at
the absolute tail of the run, together with the indices of all
failed tests.

3. Automated JUnit XML Reports:
- Adds a `-j/--junit [filename]` option to generate standardized XML
test reports, capturing execution duration and XML-escaped failure
logs or skip reasons for each test.
- Includes a dedicated shell validation test validating XML report
structure via Python's ElementTree parser.

4. PMU Events & Monolithic Suite Splitting:
- Generates dynamic sub-tests for each PMU event metric table instead
of a single monolithic sanity test, enabling fine-grained tracing.
- Splits the monolithic `util` test suite into independent sub-tests
for easier failure isolation.

5. CI & Environmental Hardening:
- Removes runtime dependency on `/usr/bin/cc` inside the Intel PT
shell test by introducing a built-in `jitdump` C workload that
generates JIT self-modifying code natively across x86, ARM, RISC-V,
MIPS, and others.

Ian Rogers (16):
perf tpebs: Fix concurrent stop races and PID reuse hazards in
tpebs_stop
perf jevents.py: Make generated C code more kernel style
perf pmu-events: Add API to get metric table name and iterate tables
perf test: Drain pipe after child finishes to avoid losing output
perf test: Support dynamic test suites with setup callback and private
data
perf test pmu-events: A sub-test per metric table
tools subcmd: Robust fallback and existence checks for process reaping
perf test: Refactor parallel poll loop to drain all pipes
simultaneously
perf test: Show snippet failure output for verbose=1
perf test: Add summary reporting
perf test: Fix subtest status alignment for multi-digit indexes
perf test: Skip shebang and SPDX comments in shell test descriptions
perf test: Split monolithic 'util' test suite into sub-tests
perf test: Add -j/--junit option for JUnit XML test reports
perf test: Add shell test to validate JUnit XML reporting output
perf test: Remove /usr/bin/cc dependency from Intel PT shell test

tools/lib/subcmd/run-command.c | 69 +-
tools/perf/pmu-events/empty-pmu-events.c | 8821 +++++++++++------
tools/perf/pmu-events/jevents.py | 847 +-
tools/perf/pmu-events/pmu-events.h | 5 +
tools/perf/tests/builtin-test.c | 711 +-
tools/perf/tests/pmu-events.c | 156 +-
tools/perf/tests/shell/test_intel_pt.sh | 169 +-
.../tests/shell/test_test_junit_output.sh | 63 +
tools/perf/tests/tests-scripts.c | 82 +-
tools/perf/tests/tests.h | 3 +
tools/perf/tests/util.c | 20 +-
tools/perf/tests/workloads/Build | 1 +
tools/perf/tests/workloads/jitdump.c | 201 +
tools/perf/util/intel-tpebs.c | 9 +
tools/perf/util/jitdump.h | 3 +-
15 files changed, 7451 insertions(+), 3709 deletions(-)
create mode 100755 tools/perf/tests/shell/test_test_junit_output.sh
create mode 100644 tools/perf/tests/workloads/jitdump.c

--
2.54.0.929.g9b7fa37559-goog