diff options
| author | Ian Rogers <irogers@google.com> | 2026-06-22 18:27:57 -0700 |
|---|---|---|
| committer | Namhyung Kim <namhyung@kernel.org> | 2026-06-30 17:09:14 -0700 |
| commit | b02e597450f28c7374afdafd97b15a889a8107da (patch) | |
| tree | 94cd3c59b85d4e0b06af2dc6eaed1da1f077b309 /tools/perf/tests/shell | |
| parent | ae42a2a2a3aeda1a62527d38d64e3cdfa0e5627c (diff) | |
| download | linux-b02e597450f28c7374afdafd97b15a889a8107da.tar.gz linux-b02e597450f28c7374afdafd97b15a889a8107da.zip | |
perf tests: Speed up metrics checking shell tests
Optimize the execution of the metric validation and metric listing shell
test suites:
1. `stat_metrics_values.sh`:
The Python metric validator runs the `perf bench futex hash` workload
for each validated metric relationship. Reduce the benchmark runtime
limit from `-r 2` (2 seconds) to `-r 1` (1 second). This cuts the
workload duration in half while still generating sufficient PMU events
to satisfy non-zero threshold metric validations.
2. `stat_all_metrics.sh`:
The metric checking test runs `perf stat` sequentially across all
433+ listed metrics. Change the default workload for system-wide runs
from `sleep 0.01` to `true`. This avoids the 10ms sleep delay on each
sequential metric invocation, saving over 4 seconds of total wall
time during full test suite runs.
Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/perf/tests/shell')
| -rwxr-xr-x | tools/perf/tests/shell/stat_all_metrics.sh | 2 | ||||
| -rwxr-xr-x | tools/perf/tests/shell/stat_metrics_values.sh | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/tests/shell/stat_all_metrics.sh b/tools/perf/tests/shell/stat_all_metrics.sh index feeb34c6fa6d..df5fa27b21ae 100755 --- a/tools/perf/tests/shell/stat_all_metrics.sh +++ b/tools/perf/tests/shell/stat_all_metrics.sh @@ -7,7 +7,7 @@ ParanoidAndNotRoot() [ "$(id -u)" != 0 ] && [ "$(cat /proc/sys/kernel/perf_event_paranoid)" -gt $1 ] } -test_prog="sleep 0.01" +test_prog="true" system_wide_flag="-a" if ParanoidAndNotRoot 0 then diff --git a/tools/perf/tests/shell/stat_metrics_values.sh b/tools/perf/tests/shell/stat_metrics_values.sh index 76f1e99d1273..86c5c7f70933 100755 --- a/tools/perf/tests/shell/stat_metrics_values.sh +++ b/tools/perf/tests/shell/stat_metrics_values.sh @@ -18,7 +18,7 @@ fi pythonvalidator=$(dirname $0)/lib/perf_metric_validation.py rulefile=$(dirname $0)/lib/perf_metric_validation_rules.json tmpdir=$(mktemp -d /tmp/__perf_test.program.XXXXX) -workload="perf bench futex hash -r 2 -s" +workload="perf bench futex hash -r 1 -s" # Add -debug, save data file and full rule file echo "Launch python validation script $pythonvalidator" |
