The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v1 00/17] perf tests: Add coverage for the untested perf subcommands
@ 2026-11-24 18:45 Arnaldo Carvalho de Melo
  2026-11-24 18:45 ` [PATCH v1 01/17] perf tests top: Pin the ring buffer size Arnaldo Carvalho de Melo
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: Arnaldo Carvalho de Melo @ 2026-11-24 18:45 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Ingo Molnar, Thomas Gleixner, James Clark, Jiri Olsa, Ian Rogers,
	Adrian Hunter, Clark Williams, linux-kernel, linux-perf-users,
	Arnaldo Carvalho de Melo

Hi,

The v12 "perf coverage: A harness for perf, and the fixes it found"
series is still unmerged.  The coverage analysis done for it showed
that several perf subcommands had no shell test coverage at all, and it
also caught two issues in the existing tests.  This series is that
result, made independent of the harness: everything here applies to
perf-tools-next with nothing from v12, so it can be considered on its
own while that series is still being reviewed.

Patches 1-2 fix existing tests, patches 3-17 add or extend tests for
the subcommands the analysis found untested.  All changes are in
tools/perf/tests/shell/, no production code is touched.

  - perf top pins its ring buffer to the default data size, so the
    result does not depend on the host's perf_event_mlock_kb (1).
  - perf sched captures the workload output before grepping it, so a
    saturating grep cannot kill the producer with SIGPIPE;
    --no-inherit was dropped, it is already cleared for CPU-wide
    recording (2).
  - help (3) and config (4) get their first tests; help -a works in
    build trees via a dummy exec path.
  - script list, fields and dump (5), report and diff sort keys (6).
  - diff options (7) are checked by what each changes: the compute
    formulas by their column, --time by a window that shows nothing,
    -o by the entry order, -b on a file whose entries have no baseline
    match.
  - annotate (8) and report (9) options the same way; the ones with
    nothing to observe in stdio output run as parse checks.
  - record (10), trace (11) and timechart (12) options.
  - kmem (13) and bench (14) get their first tests; the bench ones
    skip cleanly when root or the hardware is missing, including
    benchmarks that skip themselves with a zero exit status.
  - lock (15) report and info, probe (16) variable and line listing.
  - report TUI (17): the six browsers are driven from a pty.

Running as non-root on this host, 13 of the 17 scripts exit 0; perf
sched, kmem, lock and trace need root and exit 2 with their skip
message, as designed.  All option names and expectations were checked
against the built perf -h output and the sources.

The tests, the two fixes and the review fixes were developed with an AI
coding assistant (OpenCode): it drafted the tests, found the two issues
above and processed three rounds of review findings.  Every commit was
reviewed, amended and run here before posting.

Arnaldo Carvalho de Melo (17):
  perf tests top: Pin the ring buffer size
  perf tests sched: Exercise the sched views and options
  perf tests help: Add a basic perf help test
  perf tests config: Exercise the config file and list options
  perf tests script: Exercise the list, fields and dump options
  perf tests sort: Exercise the report and diff sort keys
  perf tests diff: Exercise the output options
  perf tests annotate: Exercise the output and filter options
  perf tests report: Exercise the output and format options
  perf tests record: Exercise more record options
  perf tests trace: Exercise the tracing options
  perf tests timechart: Exercise the report options
  perf tests kmem: Add a basic perf kmem test
  perf tests bench: Add smoke tests for perf bench
  perf tests lock: Exercise perf lock report and info
  perf tests probe: Exercise the variable and line listing
  perf tests report: Exercise the TUI browsers

 tools/perf/tests/shell/annotate.sh        |  64 +++++++
 tools/perf/tests/shell/bench.sh           | 130 +++++++++++++
 tools/perf/tests/shell/config.sh          | 134 ++++++++++++++
 tools/perf/tests/shell/diff.sh            | 191 ++++++++++++++++++-
 tools/perf/tests/shell/help.sh            |  80 ++++++++
 tools/perf/tests/shell/kmem.sh            | 215 ++++++++++++++++++++++
 tools/perf/tests/shell/lock_contention.sh |  40 ++++
 tools/perf/tests/shell/probe_vars.sh      |  80 ++++++++
 tools/perf/tests/shell/record_options.sh  | 173 +++++++++++++++++
 tools/perf/tests/shell/report_options.sh  | 122 ++++++++++++
 tools/perf/tests/shell/report_tui.sh      | 112 +++++++++++
 tools/perf/tests/shell/sched.sh           | 154 +++++++++++-----
 tools/perf/tests/shell/script.sh          | 131 ++++++++++++-
 tools/perf/tests/shell/sort.sh            |  72 ++++++++
 tools/perf/tests/shell/timechart.sh       |  46 +++++
 tools/perf/tests/shell/top.sh             |   7 +-
 tools/perf/tests/shell/trace_options.sh   |  97 ++++++++++
 17 files changed, 1794 insertions(+), 54 deletions(-)
 create mode 100755 tools/perf/tests/shell/bench.sh
 create mode 100755 tools/perf/tests/shell/config.sh
 create mode 100755 tools/perf/tests/shell/help.sh
 create mode 100755 tools/perf/tests/shell/kmem.sh
 create mode 100755 tools/perf/tests/shell/probe_vars.sh
 create mode 100755 tools/perf/tests/shell/record_options.sh
 create mode 100755 tools/perf/tests/shell/report_options.sh
 create mode 100755 tools/perf/tests/shell/report_tui.sh
 create mode 100755 tools/perf/tests/shell/sort.sh
 create mode 100755 tools/perf/tests/shell/trace_options.sh

-- 
2.56.0


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2026-11-24 18:47 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-24 18:45 [PATCH v1 00/17] perf tests: Add coverage for the untested perf subcommands Arnaldo Carvalho de Melo
2026-11-24 18:45 ` [PATCH v1 01/17] perf tests top: Pin the ring buffer size Arnaldo Carvalho de Melo
2026-11-24 18:45 ` [PATCH v1 02/17] perf tests sched: Exercise the sched views and options Arnaldo Carvalho de Melo
2026-11-24 18:45 ` [PATCH v1 03/17] perf tests help: Add a basic perf help test Arnaldo Carvalho de Melo
2026-11-24 18:45 ` [PATCH v1 04/17] perf tests config: Exercise the config file and list options Arnaldo Carvalho de Melo
2026-11-24 18:45 ` [PATCH v1 05/17] perf tests script: Exercise the list, fields and dump options Arnaldo Carvalho de Melo
2026-11-24 18:45 ` [PATCH v1 06/17] perf tests sort: Exercise the report and diff sort keys Arnaldo Carvalho de Melo
2026-11-24 18:45 ` [PATCH v1 07/17] perf tests diff: Exercise the output options Arnaldo Carvalho de Melo
2026-11-24 18:45 ` [PATCH v1 08/17] perf tests annotate: Exercise the output and filter options Arnaldo Carvalho de Melo
2026-11-24 18:45 ` [PATCH v1 09/17] perf tests report: Exercise the output and format options Arnaldo Carvalho de Melo
2026-11-24 18:45 ` [PATCH v1 10/17] perf tests record: Exercise more record options Arnaldo Carvalho de Melo
2026-11-24 18:45 ` [PATCH v1 11/17] perf tests trace: Exercise the tracing options Arnaldo Carvalho de Melo
2026-11-24 18:45 ` [PATCH v1 12/17] perf tests timechart: Exercise the report options Arnaldo Carvalho de Melo
2026-11-24 18:46 ` [PATCH v1 13/17] perf tests kmem: Add a basic perf kmem test Arnaldo Carvalho de Melo
2026-11-24 18:46 ` [PATCH v1 14/17] perf tests bench: Add smoke tests for perf bench Arnaldo Carvalho de Melo
2026-11-24 18:46 ` [PATCH v1 15/17] perf tests lock: Exercise perf lock report and info Arnaldo Carvalho de Melo
2026-11-24 18:46 ` [PATCH v1 16/17] perf tests probe: Exercise the variable and line listing Arnaldo Carvalho de Melo
2026-11-24 18:46 ` [PATCH v1 17/17] perf tests report: Exercise the TUI browsers Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox