public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] perf/test: fix perf ftrace test on s390
@ 2024-11-19  6:48 Thomas Richter
  2024-11-19 19:07 ` Namhyung Kim
  2024-11-22 22:17 ` Namhyung Kim
  0 siblings, 2 replies; 3+ messages in thread
From: Thomas Richter @ 2024-11-19  6:48 UTC (permalink / raw)
  To: linux-kernel, linux-perf-users, acme, namhyung
  Cc: agordeev, gor, sumanthk, hca, Thomas Richter, Sven Schnelle

On s390 the perf test case ftrace sometimes fails as follows:

  # ./perf test ftrace
  79: perf ftrace tests    : FAILED!
  #

The failure depends on the kernel .config file. Some configurations
always work fine, some do not.  The ftrace profile test mostly fails,
because the ring buffer was not large enough, and some lines
(especially the interesting ones with nanosleep in it) where dropped.

To achieve success for all tested kernel configurations, enlarge
the buffer to store the traces completely without wrapping.
The default buffer size is too small for all kernel configurations.
Set the buffer size of for the ftrace profile test to 16 MB.

Output after:
  # ./perf test ftrace
  79: perf ftrace tests     : Ok
  #

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Suggested-by: Sven Schnelle <svens@linux.ibm.com>
Suggested-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/tests/shell/ftrace.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/tests/shell/ftrace.sh b/tools/perf/tests/shell/ftrace.sh
index a6ee740f0d7e..a785a6274922 100755
--- a/tools/perf/tests/shell/ftrace.sh
+++ b/tools/perf/tests/shell/ftrace.sh
@@ -67,7 +67,7 @@ test_ftrace_latency() {
 
 test_ftrace_profile() {
     echo "perf ftrace profile test"
-    perf ftrace profile sleep 0.1 > "${output}"
+    perf ftrace profile -m 16M sleep 0.1 > "${output}"
     grep ^# "${output}"
     grep sleep "${output}"
     grep schedule "${output}"
-- 
2.47.0


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

* Re: [PATCH v3] perf/test: fix perf ftrace test on s390
  2024-11-19  6:48 [PATCH v3] perf/test: fix perf ftrace test on s390 Thomas Richter
@ 2024-11-19 19:07 ` Namhyung Kim
  2024-11-22 22:17 ` Namhyung Kim
  1 sibling, 0 replies; 3+ messages in thread
From: Namhyung Kim @ 2024-11-19 19:07 UTC (permalink / raw)
  To: Thomas Richter
  Cc: linux-kernel, linux-perf-users, acme, agordeev, gor, sumanthk,
	hca, Sven Schnelle

On Tue, Nov 19, 2024 at 07:48:56AM +0100, Thomas Richter wrote:
> On s390 the perf test case ftrace sometimes fails as follows:
> 
>   # ./perf test ftrace
>   79: perf ftrace tests    : FAILED!
>   #
> 
> The failure depends on the kernel .config file. Some configurations
> always work fine, some do not.  The ftrace profile test mostly fails,
> because the ring buffer was not large enough, and some lines
> (especially the interesting ones with nanosleep in it) where dropped.
> 
> To achieve success for all tested kernel configurations, enlarge
> the buffer to store the traces completely without wrapping.
> The default buffer size is too small for all kernel configurations.
> Set the buffer size of for the ftrace profile test to 16 MB.
> 
> Output after:
>   # ./perf test ftrace
>   79: perf ftrace tests     : Ok
>   #
> 
> Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
> Suggested-by: Sven Schnelle <svens@linux.ibm.com>
> Suggested-by: Namhyung Kim <namhyung@kernel.org>

Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung

> ---
>  tools/perf/tests/shell/ftrace.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/perf/tests/shell/ftrace.sh b/tools/perf/tests/shell/ftrace.sh
> index a6ee740f0d7e..a785a6274922 100755
> --- a/tools/perf/tests/shell/ftrace.sh
> +++ b/tools/perf/tests/shell/ftrace.sh
> @@ -67,7 +67,7 @@ test_ftrace_latency() {
>  
>  test_ftrace_profile() {
>      echo "perf ftrace profile test"
> -    perf ftrace profile sleep 0.1 > "${output}"
> +    perf ftrace profile -m 16M sleep 0.1 > "${output}"
>      grep ^# "${output}"
>      grep sleep "${output}"
>      grep schedule "${output}"
> -- 
> 2.47.0
> 

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

* Re: [PATCH v3] perf/test: fix perf ftrace test on s390
  2024-11-19  6:48 [PATCH v3] perf/test: fix perf ftrace test on s390 Thomas Richter
  2024-11-19 19:07 ` Namhyung Kim
@ 2024-11-22 22:17 ` Namhyung Kim
  1 sibling, 0 replies; 3+ messages in thread
From: Namhyung Kim @ 2024-11-22 22:17 UTC (permalink / raw)
  To: linux-kernel, linux-perf-users, acme, Thomas Richter
  Cc: agordeev, gor, sumanthk, hca, Sven Schnelle

On Tue, 19 Nov 2024 07:48:56 +0100, Thomas Richter wrote:

> On s390 the perf test case ftrace sometimes fails as follows:
> 
>   # ./perf test ftrace
>   79: perf ftrace tests    : FAILED!
>   #
> 
> The failure depends on the kernel .config file. Some configurations
> always work fine, some do not.  The ftrace profile test mostly fails,
> because the ring buffer was not large enough, and some lines
> (especially the interesting ones with nanosleep in it) where dropped.
> 
> [...]

Applied to perf-tools-next, thanks!

Best regards,
Namhyung


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

end of thread, other threads:[~2024-11-22 22:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-19  6:48 [PATCH v3] perf/test: fix perf ftrace test on s390 Thomas Richter
2024-11-19 19:07 ` Namhyung Kim
2024-11-22 22:17 ` Namhyung Kim

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