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

From: Vincent Donnefort

Date: Tue Feb 10 2026 - 10:56:05 EST


On Thu, Feb 05, 2026 at 12:42:08PM -0500, Steven Rostedt wrote:
> On Sat, 31 Jan 2026 13:28:33 +0000
> Vincent Donnefort <vdonnefort@xxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxxx>
> > Cc: linux-kselftest@xxxxxxxxxxxxxxx
> > Signed-off-by: Vincent Donnefort <vdonnefort@xxxxxxxxxx>
>
> 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

Hum weird, I have changed it in v11 to

echo 0 > /sys/devices/system/cpu/cpu$cpu/online || return 0

That doesn't work? Because I would simply stop the test there if we can't
offline the CPU.


> 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