]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
perf test: Add stat metrics --for-each-cgroup test
authorIan Rogers <irogers@google.com>
Tue, 19 May 2026 15:27:16 +0000 (08:27 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 25 May 2026 19:47:14 +0000 (16:47 -0300)
commitbd2a5be1fe731bc7548205dd148db75f1d588da2
tree4badad37f9687eed0fc8ad878138a2e512cf33c4
parent65bd18199ad5358f7c879dc69b4de3671b33e62e
perf test: Add stat metrics --for-each-cgroup test

Add a new shell test `stat_metrics_cgrp.sh` to verify metric reporting
with `--for-each-cgroup`, both with and without `--bpf-counters`.

The test:
- Checks if system-wide monitoring is supported (skips if not).
- Finds cgroups to test.
- Runs `perf stat` with `insn_per_cycle` metric and verifies that the
  metric is reported for each cgroup.
- Dynamically pairs and verifies instructions and cycles counts to
  avoid false failures on idle cgroups.
- Tests both standard mode and BPF counters mode (if supported).

Assisted-by: Antigravity:gemini-3-flash
Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Svilen Kanev <skanev@google.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/tests/shell/stat_metrics_cgrp.sh [new file with mode: 0755]