[PATCH v11 15/30] tracing: selftests: Add trace remote tests

Steven Rostedt rostedt at goodmis.org
Thu Feb 5 09:42:08 PST 2026


On Sat, 31 Jan 2026 13:28:33 +0000
Vincent Donnefort <vdonnefort at google.com> wrote:

> Exercise the tracefs interface for trace remote with a set of tests to
> check:
> 
>   * loading/unloading (unloading.tc)
>   * reset (reset.tc)
>   * size changes (buffer_size.tc)
>   * consuming read (trace_pipe.tc)
>   * non-consuming read (trace.tc)
> 
> Cc: Shuah Khan <skhan at linuxfoundation.org>
> Cc: linux-kselftest at vger.kernel.org
> Signed-off-by: Vincent Donnefort <vdonnefort at google.com>

This still fails:

=== Ftrace unit tests ===
[1] Test trace remote buffer size	[PASS]
[2] Test hypervisor trace buffer size	[UNSUPPORTED]
[3] Test hypervisor trace buffer reset	[UNSUPPORTED]
[4] Test hypervisor consuming trace read	[UNSUPPORTED]
[5] Test hypervisor non-consuming trace read	[UNSUPPORTED]
[6] Test hypervisor trace buffer unloading	[UNSUPPORTED]
[7] Test trace remote reset	[PASS]
[8] Test trace remote consuming read	[FAIL]
[9] Test trace remote non-consuming read	[FAIL]
[10] Test trace remote unloading	[PASS]

I added this patch and the two failed tests now pass:

diff --git a/tools/testing/selftests/ftrace/test.d/remotes/trace.tc b/tools/testing/selftests/ftrace/test.d/remotes/trace.tc
index 081133ec45ff..dfc954a6a380 100644
--- a/tools/testing/selftests/ftrace/test.d/remotes/trace.tc
+++ b/tools/testing/selftests/ftrace/test.d/remotes/trace.tc
@@ -106,8 +106,10 @@ test_trace()
     echo 0 > trace
 
     for cpu in $(get_cpu_ids); do
-        echo 0 > /sys/devices/system/cpu/cpu$cpu/online
-        break
+        if [ -f /sys/devices/system/cpu/cpu$cpu/online ]; then
+            echo 0 > /sys/devices/system/cpu/cpu$cpu/online
+            break
+        fi
     done
 
     for i in $(seq 1 8); do
diff --git a/tools/testing/selftests/ftrace/test.d/remotes/trace_pipe.tc b/tools/testing/selftests/ftrace/test.d/remotes/trace_pipe.tc
index d28eaee10c7c..146f0a9fe311 100644
--- a/tools/testing/selftests/ftrace/test.d/remotes/trace_pipe.tc
+++ b/tools/testing/selftests/ftrace/test.d/remotes/trace_pipe.tc
@@ -102,8 +102,10 @@ test_trace_pipe()
     echo 0 > trace
 
     for cpu in $(get_cpu_ids); do
-        echo 0 > /sys/devices/system/cpu/cpu$cpu/online
-        break
+        if [ -f /sys/devices/system/cpu/cpu$cpu/online ]; then
+            echo 0 > /sys/devices/system/cpu/cpu$cpu/online
+            break
+        fi
     done
 
     for i in $(seq 1 8); do

-- Steve



More information about the linux-arm-kernel mailing list