From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
James Clark <james.clark@linaro.org>,
Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>,
Clark Williams <williams@redhat.com>,
linux-perf-users@vger.kernel.org,
Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH v2 00/18] perf tests: Add coverage for the untested perf subcommands
Date: Thu, 26 Nov 2026 22:37:43 -0300 [thread overview]
Message-ID: <20261127013801.14841-1-acme@kernel.org> (raw)
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Hi,
The v13 "perf coverage: A harness for perf, and the fixes it found"
series is posted but still unmerged. The coverage analysis showed
that several perf subcommands had no shell test coverage at all, and it
also caught issues in the existing tests and in perf kmem. This series
is that result, made independent of the harness: everything here applies
to perf-tools-next with nothing from v13, so it can be considered on its
own while that series is still being reviewed.
Patch 1 fixes perf kmem, patches 2-3 fix existing tests, patches 4-18
add or extend tests for the subcommands the analysis found untested.
The only production change is (1); the rest is in tools/perf/tests/shell/.
- perf kmem's page free path looked up the alloc tree with the order
from the free event but the other key fields from the allocation,
so a split or reused page missed the entry and the whole stat failed
with -ENOMEM. Take the order from the allocation record as well (1).
- 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 (2).
- 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 (3).
- help (4) and config (5) get their first tests; help -a works in
build trees via a dummy exec path.
- script list, fields and dump (6), report and diff sort keys (7).
- diff options (8) 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 (9) and report (10) options the same way; the ones with
nothing to observe in stdio output run as parse checks.
- record (11), trace (12) and timechart (13) options.
- kmem (14) and bench (15) 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 (16) report and info, probe (17) variable and line listing.
- report TUI (18): the six browsers are driven from a pty.
Running as non-root on this host, 12 of the 17 scripts exit 0; perf
sched, kmem, lock and trace need root and exit 2 with their skip
message, as designed, and timechart exits 2 when perf timechart record
is not permitted. Running as root, the five root-only scripts and the
two with root-gated subtests all pass, including the page allocator
stats that exposed (1). All option names and expectations were checked
against the built perf -h output and the sources.
What changed from v1
--------------------
Sashiko found environment-dependent failures in eleven patches; a
review pass found four more, and a final check caught the cleanup
trap turning a missing-symbol skip into a failure. All are fixed in
place, with no Fixes: or Reported-by: tags added.
- top (2): -m 512K and --no-bpf-event, so neither the main nor the
sideband evlist sizes its ring buffer from perf_event_mlock_kb.
- sched (3): no migration is expected from the pinned workloads, and
the stats tests skip when /proc/schedstat is absent.
- script (6), sort (7), kmem (14): disasm, the "type" sort key and
kmem are gated on libcapstone, DWARF and libtraceevent support.
- diff (8): cleanup runs before the symbol skips and preserves exit
2; --time stays in range and checks perf's status, and later
tests cannot mask failures or run on unrecorded files.
- record (11): --switch-output=4K with a check that a switch really
happened, a raised fd limit for parallel streaming, and aio and
NUMA gates that skip CPU-less nodes.
- trace (12): the syscall list is one -e argument, not three that
overwrite each other, and the uid test needs BPF skeletons.
- timechart (13): the report option tests exit 2 as a skip when
nothing could be recorded, they were reported as Ok.
- bench (15): libnuma and CPU gates, hardware breakpoint skips, and
a missing uprobe result treated as a skip.
- lock (16): a failing perf lock report or info now fails the test,
the error trap used to exit with status 0.
- probe (17): line listing skips when the kernel source is absent.
- report TUI (18): one user-space event and -q avoid the event menu
and the kptr_restrict dialog; a closed pty no longer raises EIO.
- kmem tool (1): a root run of the new test found page frees that
failed with -ENOMEM; the alloc-tree lookup now uses the order
recorded at allocation time.
The tests, the three fixes and the review fixes were developed with an
AI coding assistant (OpenCode): it drafted the tests, found the three
issues above and processed five rounds of review findings. Every
commit was reviewed, amended and run here before posting.
Arnaldo Carvalho de Melo (18):
perf kmem: Use the allocation order when matching page frees
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/builtin-kmem.c | 6 +
tools/perf/tests/shell/annotate.sh | 64 +++++++++
tools/perf/tests/shell/bench.sh | 154 ++++++++++++++++++++
tools/perf/tests/shell/config.sh | 134 +++++++++++++++++
tools/perf/tests/shell/diff.sh | 232 ++++++++++++++++++++++++++++--
tools/perf/tests/shell/help.sh | 80 +++++++++++
tools/perf/tests/shell/kmem.sh | 222 ++++++++++++++++++++++++++++
tools/perf/tests/shell/lock_contention.sh | 55 +++++++
tools/perf/tests/shell/probe_vars.sh | 87 +++++++++++
tools/perf/tests/shell/record_options.sh | 215 +++++++++++++++++++++++++++
tools/perf/tests/shell/report_options.sh | 122 +++++++++++++++
tools/perf/tests/shell/report_tui.sh | 120 ++++++++++++++++
tools/perf/tests/shell/sched.sh | 164 +++++++++++++++------
tools/perf/tests/shell/script.sh | 135 +++++++++++++++++-
tools/perf/tests/shell/sort.sh | 77 ++++++++++
tools/perf/tests/shell/timechart.sh | 46 +++++
tools/perf/tests/shell/top.sh | 11 +-
tools/perf/tests/shell/trace_options.sh | 103 +++++++++++++
18 files changed, 1964 insertions(+), 63 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
next reply other threads:[~2026-11-27 1:38 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 1:37 Arnaldo Carvalho de Melo [this message]
2026-11-27 1:37 ` [PATCH v2 01/18] perf kmem: Use the allocation order when matching page frees Arnaldo Carvalho de Melo
2026-11-27 1:53 ` sashiko-bot
2026-11-27 1:37 ` [PATCH v2 02/18] perf tests top: Pin the ring buffer size Arnaldo Carvalho de Melo
2026-11-27 1:37 ` [PATCH v2 03/18] perf tests sched: Exercise the sched views and options Arnaldo Carvalho de Melo
2026-11-27 1:37 ` [PATCH v2 04/18] perf tests help: Add a basic perf help test Arnaldo Carvalho de Melo
2026-11-27 1:37 ` [PATCH v2 05/18] perf tests config: Exercise the config file and list options Arnaldo Carvalho de Melo
2026-11-27 1:37 ` [PATCH v2 06/18] perf tests script: Exercise the list, fields and dump options Arnaldo Carvalho de Melo
2026-11-27 1:37 ` [PATCH v2 07/18] perf tests sort: Exercise the report and diff sort keys Arnaldo Carvalho de Melo
2026-11-27 1:37 ` [PATCH v2 08/18] perf tests diff: Exercise the output options Arnaldo Carvalho de Melo
2026-11-27 1:37 ` [PATCH v2 09/18] perf tests annotate: Exercise the output and filter options Arnaldo Carvalho de Melo
2026-11-27 1:37 ` [PATCH v2 10/18] perf tests report: Exercise the output and format options Arnaldo Carvalho de Melo
2026-11-27 1:37 ` [PATCH v2 11/18] perf tests record: Exercise more record options Arnaldo Carvalho de Melo
2026-11-27 1:52 ` sashiko-bot
2026-11-27 1:37 ` [PATCH v2 12/18] perf tests trace: Exercise the tracing options Arnaldo Carvalho de Melo
2026-11-27 1:37 ` [PATCH v2 13/18] perf tests timechart: Exercise the report options Arnaldo Carvalho de Melo
2026-11-27 1:37 ` [PATCH v2 14/18] perf tests kmem: Add a basic perf kmem test Arnaldo Carvalho de Melo
2026-11-27 1:37 ` [PATCH v2 15/18] perf tests bench: Add smoke tests for perf bench Arnaldo Carvalho de Melo
2026-11-27 1:37 ` [PATCH v2 16/18] perf tests lock: Exercise perf lock report and info Arnaldo Carvalho de Melo
2026-11-27 1:38 ` [PATCH v2 17/18] perf tests probe: Exercise the variable and line listing Arnaldo Carvalho de Melo
2026-11-27 1:38 ` [PATCH v2 18/18] perf tests report: Exercise the TUI browsers Arnaldo Carvalho de Melo
2026-11-27 1:53 ` [PATCH v2 00/18] perf tests: Add coverage for the untested perf subcommands sashiko-bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261127013801.14841-1-acme@kernel.org \
--to=acme@kernel.org \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=jolsa@kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=tglx@linutronix.de \
--cc=williams@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox