Linux Perf Users
 help / color / mirror / Atom feed
* [PATCH] perf test: Fix perf test 114 perf record test for s390
@ 2025-01-28 15:03 Thomas Richter
  2025-01-28 15:15 ` James Clark
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Richter @ 2025-01-28 15:03 UTC (permalink / raw)
  To: linux-kernel, linux-perf-users, acme, james.clark, namhyung
  Cc: agordeev, gor, sumanthk, hca, Thomas Richter

On s390 the event instructions can not be used for recording.
This event is only supported by perf stat.
Skip all tests which use perf record -e instruction ....

Cc: James Clark <james.clark@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
---
 tools/perf/tests/shell/record.sh | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/tools/perf/tests/shell/record.sh b/tools/perf/tests/shell/record.sh
index 0fc7a909ae9b..297d0e459875 100755
--- a/tools/perf/tests/shell/record.sh
+++ b/tools/perf/tests/shell/record.sh
@@ -287,11 +287,15 @@ test_precise_max() {
     return
   fi
   # On AMD, cycles and instructions events are treated differently
-  if ! perf record -o "${perfdata}" -e "instructions:P" true 2> /dev/null
+  # On s390 event instructions can not be used for recording
+  if [ $(uname -m) != s390x ]
   then
-    echo "precise_max attribute [Failed instructions:P event]"
-    err=1
-    return
+    if ! perf record -o "${perfdata}" -e "instructions:P" true 2> /dev/null
+    then
+      echo "precise_max attribute [Failed instructions:P event]"
+      err=1
+      return
+    fi
   fi
   echo "precise_max attribute test [Success]"
 }
@@ -307,7 +311,8 @@ test_system_wide
 test_workload
 test_branch_counter
 test_cgroup
-test_leader_sampling
+# On s390 event instructions can not be used for recording
+[ $(uname -m) != s390x ] && test_leader_sampling
 test_topdown_leader_sampling
 test_precise_max
 
-- 
2.48.1


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

* Re: [PATCH] perf test: Fix perf test 114 perf record test for s390
  2025-01-28 15:03 [PATCH] perf test: Fix perf test 114 perf record test for s390 Thomas Richter
@ 2025-01-28 15:15 ` James Clark
  0 siblings, 0 replies; 2+ messages in thread
From: James Clark @ 2025-01-28 15:15 UTC (permalink / raw)
  To: Thomas Richter
  Cc: agordeev, gor, sumanthk, hca, linux-kernel, linux-perf-users,
	acme, namhyung



On 28/01/2025 3:03 pm, Thomas Richter wrote:
> On s390 the event instructions can not be used for recording.
> This event is only supported by perf stat.
> Skip all tests which use perf record -e instruction ....
> 
> Cc: James Clark <james.clark@linaro.org>
> Cc: Namhyung Kim <namhyung@kernel.org>
> Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
> ---
>   tools/perf/tests/shell/record.sh | 15 ++++++++++-----
>   1 file changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/tools/perf/tests/shell/record.sh b/tools/perf/tests/shell/record.sh
> index 0fc7a909ae9b..297d0e459875 100755
> --- a/tools/perf/tests/shell/record.sh
> +++ b/tools/perf/tests/shell/record.sh
> @@ -287,11 +287,15 @@ test_precise_max() {
>       return
>     fi
>     # On AMD, cycles and instructions events are treated differently
> -  if ! perf record -o "${perfdata}" -e "instructions:P" true 2> /dev/null
> +  # On s390 event instructions can not be used for recording
> +  if [ $(uname -m) != s390x ]
>     then
> -    echo "precise_max attribute [Failed instructions:P event]"
> -    err=1
> -    return
> +    if ! perf record -o "${perfdata}" -e "instructions:P" true 2> /dev/null
> +    then
> +      echo "precise_max attribute [Failed instructions:P event]"
> +      err=1
> +      return
> +    fi
>     fi
>     echo "precise_max attribute test [Success]"
>   }
> @@ -307,7 +311,8 @@ test_system_wide
>   test_workload
>   test_branch_counter
>   test_cgroup
> -test_leader_sampling
> +# On s390 event instructions can not be used for recording
> +[ $(uname -m) != s390x ] && test_leader_sampling

Is this a fix for 180fd0c1eac7 ("perf tests: Make leader sampling test 
work without branch event")? If so sorry for the breakage.

Can you change it to cycles instead of instructions? The actual event 
didn't seem to be important for the test. I see there is a perf record 
-e cycles for test_precise_max() so I'm assuming that works for s390 as 
it isn't conditional.


>   test_topdown_leader_sampling
>   test_precise_max
>   


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

end of thread, other threads:[~2025-01-28 15:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-28 15:03 [PATCH] perf test: Fix perf test 114 perf record test for s390 Thomas Richter
2025-01-28 15:15 ` James Clark

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox