From 29441ab3a30a1a5e2dc35ea519bbd5dd210b7666 Mon Sep 17 00:00:00 2001 From: Veronika Molnarova Date: Tue, 19 Sep 2023 17:02:43 +0200 Subject: [PATCH] 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 Acked-by: Michael Petlan Link: https://lore.kernel.org/r/20230919150419.23193-2-vmolnaro@redhat.com Signed-off-by: Namhyung Kim --- tools/perf/tests/shell/lock_contention.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/perf/tests/shell/lock_contention.sh b/tools/perf/tests/shell/lock_contention.sh index 966e67db75f3..d5a191d3d090 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()