linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf/tests: Fix test case 95 Check branch stack sampling on s390
@ 2022-07-27  7:11 Thomas Richter
  2022-07-27  9:27 ` James Clark
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Richter @ 2022-07-27  7:11 UTC (permalink / raw)
  To: linux-kernel, linux-perf-users, acme, german.gomez
  Cc: svens, gor, sumanthk, hca, Thomas Richter

On linux-next tree perf test 95 was added recently.
s390 does not support branch sampling at all. Therefore
omit this test on s390 platform.

Output before:
 # ./perf test -Fv 95
 95: Check branch stack sampling                                     :
 --- start ---
 Testing user branch stack sampling
 ---- end ----
 Check branch stack sampling: FAILED!
 #

Output after:
 # ./perf test -Fv 95
 95: Check branch stack sampling                                     :
 --- start ---
 ---- end ----
 Check branch stack sampling: Skip
 #

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
---
 tools/perf/tests/shell/test_brstack.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/perf/tests/shell/test_brstack.sh b/tools/perf/tests/shell/test_brstack.sh
index 113ccd17bf03..dedaf74164dc 100755
--- a/tools/perf/tests/shell/test_brstack.sh
+++ b/tools/perf/tests/shell/test_brstack.sh
@@ -4,6 +4,9 @@
 # SPDX-License-Identifier: GPL-2.0
 # German Gomez <german.gomez@arm.com>, 2022
 
+# s390 does not support branch sampling, omit
+[ $(uname -m) = "s390" -o $(uname -m) = "s390x" ] && exit 2
+
 # we need a C compiler to build the test programs
 # so bail if none is found
 if ! [ -x "$(command -v cc)" ]; then
-- 
2.36.1


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

* Re: [PATCH] perf/tests: Fix test case 95 Check branch stack sampling on s390
  2022-07-27  7:11 [PATCH] perf/tests: Fix test case 95 Check branch stack sampling on s390 Thomas Richter
@ 2022-07-27  9:27 ` James Clark
  2022-07-27  9:54   ` Thomas Richter
  0 siblings, 1 reply; 3+ messages in thread
From: James Clark @ 2022-07-27  9:27 UTC (permalink / raw)
  To: Thomas Richter
  Cc: svens, gor, sumanthk, hca, linux-kernel, linux-perf-users, acme,
	german.gomez



On 27/07/2022 08:11, Thomas Richter wrote:
> On linux-next tree perf test 95 was added recently.
> s390 does not support branch sampling at all. Therefore
> omit this test on s390 platform.
> 
> Output before:
>  # ./perf test -Fv 95
>  95: Check branch stack sampling                                     :
>  --- start ---
>  Testing user branch stack sampling
>  ---- end ----
>  Check branch stack sampling: FAILED!
>  #
> 
> Output after:
>  # ./perf test -Fv 95
>  95: Check branch stack sampling                                     :
>  --- start ---
>  ---- end ----
>  Check branch stack sampling: Skip
>  #
> 
> Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
> ---
>  tools/perf/tests/shell/test_brstack.sh | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/tools/perf/tests/shell/test_brstack.sh b/tools/perf/tests/shell/test_brstack.sh
> index 113ccd17bf03..dedaf74164dc 100755
> --- a/tools/perf/tests/shell/test_brstack.sh
> +++ b/tools/perf/tests/shell/test_brstack.sh
> @@ -4,6 +4,9 @@
>  # SPDX-License-Identifier: GPL-2.0
>  # German Gomez <german.gomez@arm.com>, 2022
>  
> +# s390 does not support branch sampling, omit
> +[ $(uname -m) = "s390" -o $(uname -m) = "s390x" ] && exit 2
> +

Hi Thomas,

Do you know why the below check doesn't cover this scenario? It seems
like it would be best to check if it's available wherever it's running
rather than enumerate every platform where it's not supported:

  # skip the test if the hardware doesn't support branch stack sampling
  perf record -b -o- -e dummy -B true > /dev/null 2>&1 || exit 2

Thanks
James

>  # we need a C compiler to build the test programs
>  # so bail if none is found
>  if ! [ -x "$(command -v cc)" ]; then

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

* Re: [PATCH] perf/tests: Fix test case 95 Check branch stack sampling on s390
  2022-07-27  9:27 ` James Clark
@ 2022-07-27  9:54   ` Thomas Richter
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Richter @ 2022-07-27  9:54 UTC (permalink / raw)
  To: James Clark
  Cc: svens, gor, sumanthk, hca, linux-kernel, linux-perf-users, acme,
	german.gomez

On 7/27/22 11:27, James Clark wrote:
> perf record -b -o- -e dummy -B true

I think you refer to the attr member branch_sample_type which should be
non-zero for branches, will look into this. Thanks

-- 
Thomas Richter, Dept 3303, IBM s390 Linux Development, Boeblingen, Germany
--
Vorsitzender des Aufsichtsrats: Gregor Pillen
Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294

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

end of thread, other threads:[~2022-07-27  9:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-27  7:11 [PATCH] perf/tests: Fix test case 95 Check branch stack sampling on s390 Thomas Richter
2022-07-27  9:27 ` James Clark
2022-07-27  9:54   ` Thomas Richter

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