From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796213685; b=LXI1nS7WfU9GjH4Se7IdEwRYOCAD2oIevr+41iHeTSddhGMYkXJGtXn/ph+9CVTFBmbY 2Z2Bg4oJwlWaF+oO0UA2J8WNiS6UXuuOtddOrwmTpqQVALNN36uN701P8pNbXYSg3IODY 0cfUFwwMZnBns6pIseKHaA0N76i6st9kKxIgRyjnMe2L+chqSLxm+2t0jHf+EkRHEXrwy 6A0HONip38D4CtckB6R5/4JNvxEqEqUbKQIdKlxRm0fycm2Ir4EYsLyP5Fe35Pwncd7pp qpHoGd5aI3PiMznL6PYclndXXknCjS2wSQed8ZX4lbSxdl8P7VmYJfY7w1gu7l9s+ew== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796213685; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: MIME-Version:Content-Transfer-Encoding; bh=tyJcEayYuHyoYceKRXsdMS3YgPaMxkBhDow7ROKRt5o=; b=2wt6OlaIfBHNHMXHiugBvvsM0gdnEmybSenuSt08HGkjdqYUdODzmm/6RmbQTImlhYex momMutoKrDre40KaucmV+SuqK57O91m2Kb4ubIYuSyhWDNVxUH5K3nKhBB/e01GC3Eof5 qQ5tnP9nu9BCeY2NofTlUKTMugqhZVh+6tO5Q4alS07agRQX6r2Ko5ns1e33cfKMQDBCo I5JqhDBac9ZTh4bti7XnIqudGzgqry9jx8+KrFf9gwYzhcitl2h0CdlqTQMCpZQAX/PIY xL3zuQiF/1JkygYSOGlE6KDSomjVXL8aZgk/JxOw7nRedUUTZb1jiDXnCYMwbmu7u6A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="XmhvWk/P"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 26E07606A329 for ; Wed, 2 Dec 2026 12:14:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=XmhvWk/P Received: by smtp.kernel.org (Postfix) with ESMTPSA id 612141F000C1; Wed, 2 Dec 2026 12:14:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796213684; bh=tyJcEayYuHyoYceKRXsdMS3YgPaMxkBhDow7ROKRt5o=; h=From:To:Cc:Subject:Date; b=XmhvWk/Ppuo4Qww/MTkq9yJ4uo2AeqoMhMig6LD0FNGcLK87TDlcs0iIeyV77COIg GQ+bT8cdcPSWw7fKjwu4tKJB86KygXGLbzaQvdcBEyRq6mIYfka4tLL0SRDgS4dxLW OhPQ9ikhvXbIq8/Vjmoi7YS8i7nuQkxElYTx/JKw3juzKRcMWgjCimjXd+40FU7VMT FHIOFvui/cZgoTnpLwmDrAh1r53VeOe1m9998axbbVR9A7L4d1mkgv8mNd/aroy+lu TvNiKr9ioy5YmAuwkBu9JPtDLF414nv5z6OQ56DzX0DSRtDZoJUnjXW7QvPYBs783X ADeb9g+Mnsjyw== From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Ingo Molnar , Thomas Gleixner , James Clark , Jiri Olsa , Ian Rogers , Adrian Hunter , Clark Williams , linux-perf-users@vger.kernel.org, Arnaldo Carvalho de Melo Subject: [PATCH v3 00/18] perf tests: Add coverage for the untested perf subcommands Date: Wed, 2 Dec 2026 09:14:16 -0300 Message-ID: <20261202121434.2224-1-acme@kernel.org> X-Mailer: git-send-email 2.54.0 X-Mailing-List: linux-perf-users@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 v2 -------------------- - Rebased onto the current perf-tools-next tip, no code changes: range-diff against v2 is all equal. - Collected Athira's Reviewed-by and Tested-by from her root run on powerpc; the bench timeout it uncovered there is pre-existing. 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 | 24 ++- 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 | 218 ++++++++++++++++++++ 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, 1983 insertions(+), 65 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