Skip to contentSkip to conversation

perf/test: fix perf ftrace test on s390

PATCH Applied Thomas Richter 2 participants 3 messages Nov 19, 2024 – Nov 22, 2024 perf events

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 perf/test: fix perf ftrace test on s390

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
  #
---
 tools/perf/tests/shell/ftrace.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/shell/ftrace.sh +1 -1
index a6ee740f0d7e..a785a6274922 100755
@@ -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}"
Signature · 1 line
2.47.0
maintainer Acked-by on v3 1/1
#1 lore raw
Quoted 16 lines · Thomas Richter

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.

Quoted 8 lines

Output after:

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

Thanks,
Namhyung

Quoted 20 lines
---
 tools/perf/tests/shell/ftrace.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/shell/ftrace.sh +1 -1
index a6ee740f0d7e..a785a6274922 100755
@@ -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}"
Signature · 1 line
2.47.0
maintainer Applied
#2 lore raw
In reply to Thomas Richter
Quoted 6 lines · Thomas Richter

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

  # ./perf test ftrace
  79: perf ftrace tests    : FAILED!
  #
Quoted 6 lines

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