linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: vmolnaro@redhat.com
To: vmolnaro@redhat.com, linux-perf-users@vger.kernel.org,
	acme@kernel.org, acme@redhat.com
Cc: mpetlan@redhat.com
Subject: [PATCH 2/2] perf test lock_contention.sh: Skip test if not enough CPUs
Date: Tue, 19 Sep 2023 17:02:43 +0200	[thread overview]
Message-ID: <20230919150419.23193-2-vmolnaro@redhat.com> (raw)
In-Reply-To: <20230919150419.23193-1-vmolnaro@redhat.com>

From: Veronika Molnarova <vmolnaro@redhat.com>

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>
---
Resending the patches with sign-off as it didn't go through last time, 
also tried to fix the found issues.

 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 f2cc187b618..768c10f1d6b 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()
-- 
2.41.0


  reply	other threads:[~2023-09-19 15:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-19 15:02 [PATCH 1/2] perf test stat+shadow_stat.sh: Add threshold for rounding errors vmolnaro
2023-09-19 15:02 ` vmolnaro [this message]
2023-09-20 10:57   ` [PATCH 2/2] perf test lock_contention.sh: Skip test if not enough CPUs Michael Petlan
2023-09-20 10:57 ` [PATCH 1/2] perf test stat+shadow_stat.sh: Add threshold for rounding errors Michael Petlan
2023-09-26 22:54   ` Namhyung Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230919150419.23193-2-vmolnaro@redhat.com \
    --to=vmolnaro@redhat.com \
    --cc=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mpetlan@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).