linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anubhav Shelat <ashelat@redhat.com>
To: mpetlan@redhat.com, acme@kernel.org, namhyung@kernel.org,
	irogers@google.com, linux-perf-users@vger.kernel.org
Cc: peterz@infradead.org, mingo@redhat.com, mark.rutland@arm.com,
	alexander.shishkin@linux.intel.com, jolsa@kernel.org,
	adrian.hunter@intel.com, kan.liang@linux.intel.com,
	dapeng1.mi@linux.intel.com, james.clark@linaro.org,
	Anubhav Shelat <ashelat@redhat.com>
Subject: [PATCH] perf tests record: allow for some difference in cycle count in leader sampling test on aarch64
Date: Wed,  1 Oct 2025 15:50:48 -0400	[thread overview]
Message-ID: <20251001195047.541745-2-ashelat@redhat.com> (raw)

On aarch64 systems, when running the leader sampling test, the cycle
count on the leader is consistently ~30 cycles less than the cycle count
on the slave event causing the test to fail. This looks like the result
of some hardware property of aarch64 processors, so allow for a small
difference in cycles between the leader and slave events on aarch64
systems.

Signed-off-by: Anubhav Shelat <ashelat@redhat.com>
---
 tools/perf/tests/shell/record.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tools/perf/tests/shell/record.sh b/tools/perf/tests/shell/record.sh
index b1ad24fb3b33..dff83d64e970 100755
--- a/tools/perf/tests/shell/record.sh
+++ b/tools/perf/tests/shell/record.sh
@@ -280,7 +280,12 @@ test_leader_sampling() {
   while IFS= read -r line
   do
     cycles=$(echo $line | awk '{for(i=1;i<=NF;i++) if($i=="cycles:") print $(i-1)}')
-    if [ $(($index%2)) -ne 0 ] && [ ${cycles}x != ${prev_cycles}x ]
+    # On aarch64 systems the leader event gets stopped ~30 cycles before the slave, so allow some
+    # difference
+    if [ "$(uname -m)" = "aarch64" ] && (( cycles - prev_cycles < 50 ))
+    then
+	    valid_counts=$(($valid_counts+1))
+    elif [ $(($index%2)) -ne 0 ] && [ ${cycles}x != ${prev_cycles}x ]
     then
       invalid_counts=$(($invalid_counts+1))
     else
-- 
2.47.3


             reply	other threads:[~2025-10-01 19:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-01 19:50 Anubhav Shelat [this message]
2025-10-01 20:43 ` [PATCH] perf tests record: allow for some difference in cycle count in leader sampling test on aarch64 Ian Rogers
2025-10-02  6:55 ` Thomas Richter
     [not found]   ` <CA+G8DhL49FWD47bkbcXYeb9T=AbxNhC-ypqjkNxRnW0JqmYnPw@mail.gmail.com>
2025-10-02 17:44     ` Anubhav Shelat
2025-10-07  5:47     ` Thomas Richter
2025-10-07 12:34       ` James Clark
2025-10-08  7:52         ` Namhyung Kim
2025-10-08 10:48         ` Thomas Richter
2025-10-08 11:24           ` James Clark
2025-10-09 12:14             ` Thomas Richter
     [not found]             ` <CA+G8Dh+Odf40jdY4h1knjU+3sSjZokMx6OdzRT3o9v1=ndKORQ@mail.gmail.com>
2025-10-09 13:55               ` Anubhav Shelat
2025-10-09 14:17                 ` James Clark
     [not found]                   ` <CA+G8DhKQkTKoNer5GfZedPUj4xMizWVJUWFocP2eQ_cmPJtBOQ@mail.gmail.com>
2025-10-09 14:59                     ` James Clark
2025-10-09 15:22                       ` Anubhav Shelat
2025-10-13 15:36                       ` Arnaldo Carvalho de Melo
2025-10-09 14:08               ` James Clark

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=20251001195047.541745-2-ashelat@redhat.com \
    --to=ashelat@redhat.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=dapeng1.mi@linux.intel.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=mpetlan@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /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).