perf test: Parallel harness optimizations, summary, JUnit XML & PMU fixes
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v8 Latest18 patches 4 repliesIn review
- v71 patch 0 repliesSuperseded
Changes in v8 from the cover letter
----------
- Treat "default_core" as a core PMU to avoid slow and unnecessary scanning of other PMUs.
- Dynamically truncate long test descriptions to fit within terminal columns to prevent visual wrapping.
- Remove unnecessary padding from suite header prints to prevent colon wrapping on newlines (resolves visual glitch in perf test -v).
Patches in v8 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/18 | perf tpebs: Fix concurrent stop races and PID reuse hazards in tpebs_stoptools/ | +80 | 0 replies | |
| 2/18 | perf jevents.py: Make generated C code more kernel styletools/ tools/ | +6094 | 0 replies | |
| 3/18 | perf pmu-events: Add API to get metric table name and iterate tablestools/ tools/ tools/ | +103 | 0 replies | |
| 4/18 | perf test: Drain pipe after child finishes to avoid losing outputtools/ | +10 | 0 replies | |
| 5/18 | perf test: Support dynamic test suites with setup callback and private datatools/ tools/ | +18 | 0 replies | |
| 6/18 | perf test pmu-events: A sub-test per metric tabletools/ | +148 | 0 replies | |
| 7/18 | tools subcmd: Robust fallback and existence checks for process reapingtools/ | +65 | 0 replies | |
| 8/18 | perf test: Refactor parallel poll loop to drain all pipes simultaneouslytools/ | +259 | 0 replies | |
| 9/18 | perf test: Show snippet failure output for verbose=1tools/ | +200 | 0 replies | |
| 10/18 | perf test: Add summary reportingtools/ | +86 | 2 replies | |
| 11/18 | perf test: Fix subtest status alignment for multi-digit indexestools/ | +5 | 0 replies | |
| 12/18 | perf test: Skip shebang and SPDX comments in shell test descriptionstools/ | +47 | 0 replies | |
| 13/18 | perf test: Split monolithic 'util' test suite into sub-teststools/ | +17 | 0 replies | |
| 14/18 | perf test: Add -j/--junit option for JUnit XML test reportstools/ | +142 | 0 replies | |
| 15/18 | perf test: Add shell test to validate JUnit XML reporting outputtools/ | +63 | 0 replies | |
| 16/18 | perf test: Remove /usr/bin/cc dependency from Intel PT shell testtools/ tools/ tools/ +3 more | +217 | 0 replies | |
| 17/18 | perf pmu: Recognize 'default_core' as a core PMU and document matchingtools/ | +18 | 0 replies | |
| 18/18 | perf test: Truncate printed test descriptions dynamically to avoid terminal wrappingtools/ | +56 | 2 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v8 yet.
Cover letter [PATCH v8 00/18] perf test: Parallel harness optimizations, summary, JUnit XML & PMU fixes
This patch series dramatically improves the speed, usability, and test reporting of the Linux perf test suite (perf test), and introduces PMU matching optimizations. It optimizes the parallel execution harness, introduces automated summary reporting, adds standardized JUnit XML report generation, removes runtime external C compiler dependencies for continuous integration environments, and avoids unnecessary PMU scanning.
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 Output Layout:
- 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.
- Dynamically truncates long test descriptions to fit within the terminal columns to prevent visual wrapping and duplicate printing glitches, while ensuring suite headers are printed without trailing padding that causes wrapping.
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.
6. PMU Core Matching Optimization:
- Treats "default_core" as a core PMU name in is_pmu_core, avoiding slow and unnecessary scanning of other PMUs which always misses.
- Documents different types of core PMU matching approaches (x86 cpu,
s390 cpum_cf, ARM sysfs).
v8 Changes
----------
- Treat "default_core" as a core PMU to avoid slow and unnecessary scanning of other PMUs.
- Dynamically truncate long test descriptions to fit within terminal columns to prevent visual wrapping.
- Remove unnecessary padding from suite header prints to prevent colon wrapping on newlines (resolves visual glitch in perf test -v).
Ian Rogers (18):
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 perf pmu: Recognize 'default_core' as a core PMU and document matching perf test: Truncate printed test descriptions dynamically to avoid
terminal wrapping
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 | 788 +- 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 | 210 + tools/perf/util/intel-tpebs.c | 92 +- tools/perf/util/jitdump.h | 3 +- tools/perf/util/pmu.c | 19 +- 16 files changed, 7619 insertions(+), 3729 deletions(-) create mode 100755 tools/perf/tests/shell/test_test_junit_output.sh create mode 100644 tools/perf/tests/workloads/jitdump.c
Signature · 1 line
2.54.0.1013.g208068f2d8-goog