linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf test: Fix perf test case 84 on s390
@ 2024-10-15  7:47 Thomas Richter
  2024-10-17 20:28 ` Namhyung Kim
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Richter @ 2024-10-15  7:47 UTC (permalink / raw)
  To: linux-kernel, linux-perf-users, acme, namhyung
  Cc: agordeev, gor, sumanthk, hca, Thomas Richter

Perf test case 84 'perf pipe recording and injection test'
sometime fails on s390, especially on z/VM virtual machines.

This is caused by a very short run time of workload

  # perf test -w noploop

which runs for 1 second. Occasionally this is not long
enough and the perf report has no samples for symbol noploop.

Fix this and enlarge the runtime for the perf work load
to 3 seconds. This ensures the symbol noploop is always
present.

Output before:
 Inject -b build-ids test
 [ perf record: Woken up 1 times to write data ]
 [ perf record: Captured and wrote 0.195 MB - ]
 [ perf record: Woken up 1 times to write data ]
 [ perf record: Captured and wrote 0.277 MB - ]
 [ perf record: Woken up 1 times to write data ]
 [ perf record: Captured and wrote 0.195 MB - ]
 [ perf record: Woken up 1 times to write data ]
 [ perf record: Captured and wrote 0.160 MB
			 /tmp/perf.data.ELzRdq (4031 samples) ]
 [ perf record: Woken up 1 times to write data ]
 [ perf record: Captured and wrote 0.195 MB - ]
 [ perf record: Woken up 1 times to write data ]
 [ perf record: Captured and wrote 0.195 MB - ]
 Inject -b build-ids test [Success]

 Inject --buildid-all build-ids test
 [ perf record: Woken up 1 times to write data ]
 [ perf record: Captured and wrote 0.195 MB - ]
 [ perf record: Woken up 1 times to write data ]
 [ perf record: Captured and wrote 0.014 MB - ]
 Inject --buildid-all build-ids test [Failed - cannot find
				noploop function in pipe #2]

Output after:
Successful execution for over 10 times in a loop.

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Reviewed-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
---
 tools/perf/tests/shell/pipe_test.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/tests/shell/pipe_test.sh b/tools/perf/tests/shell/pipe_test.sh
index d4c8005ce9b9..02d9ef27c8e7 100755
--- a/tools/perf/tests/shell/pipe_test.sh
+++ b/tools/perf/tests/shell/pipe_test.sh
@@ -12,7 +12,7 @@ skip_test_missing_symbol ${sym}
 
 data=$(mktemp /tmp/perf.data.XXXXXX)
 data2=$(mktemp /tmp/perf.data2.XXXXXX)
-prog="perf test -w noploop"
+prog="perf test -w noploop 3"
 err=0
 
 set -e
-- 
2.47.0


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

* Re: [PATCH] perf test: Fix perf test case 84 on s390
  2024-10-15  7:47 [PATCH] perf test: Fix perf test case 84 on s390 Thomas Richter
@ 2024-10-17 20:28 ` Namhyung Kim
  0 siblings, 0 replies; 4+ messages in thread
From: Namhyung Kim @ 2024-10-17 20:28 UTC (permalink / raw)
  To: Thomas Richter
  Cc: linux-kernel, linux-perf-users, acme, agordeev, gor, sumanthk,
	hca

Hello,

On Tue, Oct 15, 2024 at 09:47:26AM +0200, Thomas Richter wrote:
> Perf test case 84 'perf pipe recording and injection test'
> sometime fails on s390, especially on z/VM virtual machines.
> 
> This is caused by a very short run time of workload
> 
>   # perf test -w noploop
> 
> which runs for 1 second. Occasionally this is not long
> enough and the perf report has no samples for symbol noploop.
> 
> Fix this and enlarge the runtime for the perf work load
> to 3 seconds. This ensures the symbol noploop is always
> present.

Hmm.. but it would slow down the test quite a lot.  Can you please make
it conditional on s390 or something?

Maybe you could add a fallback logic to increase the period if it fails.

Thanks,
Namhyung

> 
> Output before:
>  Inject -b build-ids test
>  [ perf record: Woken up 1 times to write data ]
>  [ perf record: Captured and wrote 0.195 MB - ]
>  [ perf record: Woken up 1 times to write data ]
>  [ perf record: Captured and wrote 0.277 MB - ]
>  [ perf record: Woken up 1 times to write data ]
>  [ perf record: Captured and wrote 0.195 MB - ]
>  [ perf record: Woken up 1 times to write data ]
>  [ perf record: Captured and wrote 0.160 MB
> 			 /tmp/perf.data.ELzRdq (4031 samples) ]
>  [ perf record: Woken up 1 times to write data ]
>  [ perf record: Captured and wrote 0.195 MB - ]
>  [ perf record: Woken up 1 times to write data ]
>  [ perf record: Captured and wrote 0.195 MB - ]
>  Inject -b build-ids test [Success]
> 
>  Inject --buildid-all build-ids test
>  [ perf record: Woken up 1 times to write data ]
>  [ perf record: Captured and wrote 0.195 MB - ]
>  [ perf record: Woken up 1 times to write data ]
>  [ perf record: Captured and wrote 0.014 MB - ]
>  Inject --buildid-all build-ids test [Failed - cannot find
> 				noploop function in pipe #2]
> 
> Output after:
> Successful execution for over 10 times in a loop.
> 
> Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
> Reviewed-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
> ---
>  tools/perf/tests/shell/pipe_test.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/perf/tests/shell/pipe_test.sh b/tools/perf/tests/shell/pipe_test.sh
> index d4c8005ce9b9..02d9ef27c8e7 100755
> --- a/tools/perf/tests/shell/pipe_test.sh
> +++ b/tools/perf/tests/shell/pipe_test.sh
> @@ -12,7 +12,7 @@ skip_test_missing_symbol ${sym}
>  
>  data=$(mktemp /tmp/perf.data.XXXXXX)
>  data2=$(mktemp /tmp/perf.data2.XXXXXX)
> -prog="perf test -w noploop"
> +prog="perf test -w noploop 3"
>  err=0
>  
>  set -e
> -- 
> 2.47.0
> 

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

* [PATCH] perf test: Fix perf test case 84 on s390
@ 2024-10-18  8:16 Thomas Richter
  2024-10-18 16:11 ` Ian Rogers
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Richter @ 2024-10-18  8:16 UTC (permalink / raw)
  To: linux-kernel, linux-perf-users, acme, namhyung
  Cc: agordeev, gor, sumanthk, hca, Thomas Richter

Perf test case 84 'perf pipe recording and injection test'
sometime fails on s390, especially on z/VM virtual machines.

This is caused by a very short run time of workload

  # perf test -w noploop

which runs for 1 second. Occasionally this is not long
enough and the perf report has no samples for symbol noploop.

Fix this and enlarge the runtime for the perf work load
to 3 seconds. This ensures the symbol noploop is always
present. Since only s390 is affected, make this loop
architecture dependend.

Output before:
 Inject -b build-ids test
 [ perf record: Woken up 1 times to write data ]
 [ perf record: Captured and wrote 0.195 MB - ]
 [ perf record: Woken up 1 times to write data ]
 [ perf record: Captured and wrote 0.277 MB - ]
 [ perf record: Woken up 1 times to write data ]
 [ perf record: Captured and wrote 0.195 MB - ]
 [ perf record: Woken up 1 times to write data ]
 [ perf record: Captured and wrote 0.160 MB
			 /tmp/perf.data.ELzRdq (4031 samples) ]
 [ perf record: Woken up 1 times to write data ]
 [ perf record: Captured and wrote 0.195 MB - ]
 [ perf record: Woken up 1 times to write data ]
 [ perf record: Captured and wrote 0.195 MB - ]
 Inject -b build-ids test [Success]

 Inject --buildid-all build-ids test
 [ perf record: Woken up 1 times to write data ]
 [ perf record: Captured and wrote 0.195 MB - ]
 [ perf record: Woken up 1 times to write data ]
 [ perf record: Captured and wrote 0.014 MB - ]
 Inject --buildid-all build-ids test [Failed - cannot find
				noploop function in pipe #2]

Output after:
Successful execution for over 10 times in a loop.

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Reviewed-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Suggested-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/tests/shell/pipe_test.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/perf/tests/shell/pipe_test.sh b/tools/perf/tests/shell/pipe_test.sh
index d4c8005ce9b9..e459aa99a951 100755
--- a/tools/perf/tests/shell/pipe_test.sh
+++ b/tools/perf/tests/shell/pipe_test.sh
@@ -13,6 +13,7 @@ skip_test_missing_symbol ${sym}
 data=$(mktemp /tmp/perf.data.XXXXXX)
 data2=$(mktemp /tmp/perf.data2.XXXXXX)
 prog="perf test -w noploop"
+[ "$(uname -m)" = "s390x" ] && prog="$prog 3"
 err=0
 
 set -e
-- 
2.47.0


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

* Re: [PATCH] perf test: Fix perf test case 84 on s390
  2024-10-18  8:16 Thomas Richter
@ 2024-10-18 16:11 ` Ian Rogers
  0 siblings, 0 replies; 4+ messages in thread
From: Ian Rogers @ 2024-10-18 16:11 UTC (permalink / raw)
  To: Thomas Richter
  Cc: linux-kernel, linux-perf-users, acme, namhyung, agordeev, gor,
	sumanthk, hca

On Fri, Oct 18, 2024 at 1:17 AM Thomas Richter <tmricht@linux.ibm.com> wrote:
>
> Perf test case 84 'perf pipe recording and injection test'
> sometime fails on s390, especially on z/VM virtual machines.
>
> This is caused by a very short run time of workload
>
>   # perf test -w noploop
>
> which runs for 1 second. Occasionally this is not long
> enough and the perf report has no samples for symbol noploop.
>
> Fix this and enlarge the runtime for the perf work load
> to 3 seconds. This ensures the symbol noploop is always
> present. Since only s390 is affected, make this loop
> architecture dependend.
>
> Output before:
>  Inject -b build-ids test
>  [ perf record: Woken up 1 times to write data ]
>  [ perf record: Captured and wrote 0.195 MB - ]
>  [ perf record: Woken up 1 times to write data ]
>  [ perf record: Captured and wrote 0.277 MB - ]
>  [ perf record: Woken up 1 times to write data ]
>  [ perf record: Captured and wrote 0.195 MB - ]
>  [ perf record: Woken up 1 times to write data ]
>  [ perf record: Captured and wrote 0.160 MB
>                          /tmp/perf.data.ELzRdq (4031 samples) ]
>  [ perf record: Woken up 1 times to write data ]
>  [ perf record: Captured and wrote 0.195 MB - ]
>  [ perf record: Woken up 1 times to write data ]
>  [ perf record: Captured and wrote 0.195 MB - ]
>  Inject -b build-ids test [Success]
>
>  Inject --buildid-all build-ids test
>  [ perf record: Woken up 1 times to write data ]
>  [ perf record: Captured and wrote 0.195 MB - ]
>  [ perf record: Woken up 1 times to write data ]
>  [ perf record: Captured and wrote 0.014 MB - ]
>  Inject --buildid-all build-ids test [Failed - cannot find
>                                 noploop function in pipe #2]
>
> Output after:
> Successful execution for over 10 times in a loop.
>
> Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
> Reviewed-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
> Suggested-by: Namhyung Kim <namhyung@kernel.org>

Lgtm, fwiw if we can land the parallel testing [1] I'm not sure it
matters if a test takes 3 seconds to run as long as it is running
amongst the concurrently running tests.

Reviewed-by: Ian Rogers <irogers@google.com>

Thanks,
Ian
[1] https://lore.kernel.org/lkml/20241018054719.1004128-1-irogers@google.com/

> ---
>  tools/perf/tests/shell/pipe_test.sh | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/tools/perf/tests/shell/pipe_test.sh b/tools/perf/tests/shell/pipe_test.sh
> index d4c8005ce9b9..e459aa99a951 100755
> --- a/tools/perf/tests/shell/pipe_test.sh
> +++ b/tools/perf/tests/shell/pipe_test.sh
> @@ -13,6 +13,7 @@ skip_test_missing_symbol ${sym}
>  data=$(mktemp /tmp/perf.data.XXXXXX)
>  data2=$(mktemp /tmp/perf.data2.XXXXXX)
>  prog="perf test -w noploop"
> +[ "$(uname -m)" = "s390x" ] && prog="$prog 3"
>  err=0
>
>  set -e
> --
> 2.47.0
>
>

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

end of thread, other threads:[~2024-10-18 16:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-15  7:47 [PATCH] perf test: Fix perf test case 84 on s390 Thomas Richter
2024-10-17 20:28 ` Namhyung Kim
  -- strict thread matches above, loose matches on Subject: below --
2024-10-18  8:16 Thomas Richter
2024-10-18 16:11 ` Ian Rogers

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