Re: [PATCH v8 10/18] perf test: Add summary reporting

From: Arnaldo Carvalho de Melo

Date: Thu Jun 04 2026 - 10:52:42 EST


On Thu, Jun 04, 2026 at 11:39:01AM -0300, Arnaldo Carvalho de Melo wrote:
> On Tue, Jun 02, 2026 at 10:41:21AM -0700, Ian Rogers wrote:
> > Currently, when running test suites (perf test), users must scroll
> > through hundreds of lines of console output to manually tally the
> > number of passed, skipped, or failed test cases.
> >
> > Introduce an automated, global execution summary printed at the
> > absolute tail of the test run:
> > 1. Track counts mid-flight inside the print_test_result() accumulator,
> > clearly separating pass counts into standalone main tests vs.
> > individual subtests (where num_test_cases > 1).
> > 2. Accumulate the precise descriptions of all failed test cases
> > directly into a global string buffer, formatted with their suite
> > indices (e.g., 3.1: Parse event definition strings) for effortless
> > cross-referencing.
> > 3. Define a summary printer function print_tests_summary() that
> > emits a colored outline of the final pass, skip, and fail totals,
> > followed by the explicit list of failed tests.
> > 4. Invoke the summary printer right before freeing the test array at
> > the absolute tail of __cmd_test(), guaranteeing that the summary is
> > successfully printed even if an internal emergency signal cleanup
> > occurs or if the user interrupts the run early.
> >
> > Example output:
> > ```
> > $ sudo perf test -v
> > 1: vmlinux symtab matches kallsyms : Skip
> > 2: Detect openat syscall event : Ok
> > 3: Detect openat syscall event on all cpus : Ok
> > ...
> > 163: perf trace summary : Ok
> >
> > === Test Summary ===
> > Passed main tests : 123
> > Passed subtests : 145
> > Skipped tests : 22
> > Failed tests : 6
> > List of failed tests:
> > 92: perf kvm tests
> > 95: kernel lock contention analysis test
> > 120: perf metrics value validation
> > 124: Check branch stack sampling
> > 143: perftool-testsuite_probe
> > 158: test Intel TPEBS counting mode
> > ```
>
> This is a great feature, thanks for working on it!
>
> I'm merging the series now.

And since I have 'perf test python' in my perf tools build alias, I got
my first summary straight away:

make: Leaving directory '/home/acme/git/perf-tools-next/tools/perf'
102: 'import perf' in python : Ok

=== Test Summary ===
Passed main tests : 1
Passed subtests : 0
Skipped tests : 0
Failed tests : 0
⬢ [acme@toolbx perf-tools-next]$
acme@number:~/git/perf-tools-next$

:-)

- Arnaldo