perf test lock_contention.sh: Skip test if not enough CPUs
authorVeronika Molnarova <vmolnaro@redhat.com>
Tue, 19 Sep 2023 15:02:43 +0000 (17:02 +0200)
committerNamhyung Kim <namhyung@kernel.org>
Thu, 21 Sep 2023 18:55:13 +0000 (11:55 -0700)
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>
tools/perf/tests/shell/lock_contention.sh

index 966e67db75f356a70a1536262296b0ed05974c4b..d5a191d3d0906ff0224906a777b236fdd615c5fa 100755 (executable)
@@ -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()