aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVeronika Molnarova <vmolnaro@redhat.com>2023-09-19 17:02:43 +0200
committerNamhyung Kim <namhyung@kernel.org>2023-09-21 11:55:13 -0700
commit29441ab3a30a1a5e2dc35ea519bbd5dd210b7666 (patch)
tree5f4b644d2e59e6f6ffa64878292e63aaab7cbbac
parentfa52d995d1d0b64e75f63571df2e57ba22ff0cb1 (diff)
downloadlinux-29441ab3a30a1a5e2dc35ea519bbd5dd210b7666.tar.gz
perf test lock_contention.sh: Skip test if not enough CPUs
Machines with less then 4 CPUs weren't consistently triggering lock events required for the test. Skip the test on those machines. The limit of 4 CPUs is set as it generates around 100 lock events for a test. Signed-off-by: Veronika Molnarova <vmolnaro@redhat.com> Acked-by: Michael Petlan <mpetlan@redhat.com> Link: https://lore.kernel.org/r/20230919150419.23193-2-vmolnaro@redhat.com Signed-off-by: Namhyung Kim <namhyung@kernel.org>
-rwxr-xr-xtools/perf/tests/shell/lock_contention.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/perf/tests/shell/lock_contention.sh b/tools/perf/tests/shell/lock_contention.sh
index 966e67db75f356..d5a191d3d0906f 100755
--- a/tools/perf/tests/shell/lock_contention.sh
+++ b/tools/perf/tests/shell/lock_contention.sh
@@ -32,6 +32,12 @@ check() {
err=2
exit
fi
+
+ if [ `nproc` -lt 4 ]; then
+ echo "[Skip] Low number of CPUs (`nproc`), lock event cannot be triggered certainly"
+ err=2
+ exit
+ fi
}
test_record()