linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf tests record: allow for some difference in cycle count in leader sampling test on aarch64
@ 2025-10-01 19:50 Anubhav Shelat
  2025-10-01 20:43 ` Ian Rogers
  2025-10-02  6:55 ` Thomas Richter
  0 siblings, 2 replies; 16+ messages in thread
From: Anubhav Shelat @ 2025-10-01 19:50 UTC (permalink / raw)
  To: mpetlan, acme, namhyung, irogers, linux-perf-users
  Cc: peterz, mingo, mark.rutland, alexander.shishkin, jolsa,
	adrian.hunter, kan.liang, dapeng1.mi, james.clark, Anubhav Shelat

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


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2025-10-13 15:36 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-01 19:50 [PATCH] perf tests record: allow for some difference in cycle count in leader sampling test on aarch64 Anubhav Shelat
2025-10-01 20:43 ` 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

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).