On Thu, 29 Oct 2026 16:28:50 -0400, Steven Rostedt <[email protected]> wrote: > From: Steven Rostedt <[email protected]> > > The instance selftest creates and removes the "foo" instance while > enabling sched_switch event and reading its trace file. The issue is that > the read of the trace file prevents the removal of foo, and it constantly > fails to remove it. The stress test is not really stressing the situation. > > Instead of running the creating and deletion in a loop as a separate > process and sleeping for one second, call it directly in a loop that forces > it to happen 10 times. Also update the removal to keep trying until it > removes the instance, otherwise if it doesn't remove it then the next mkdir > is a nop. > > Convert the reading of the trace file to use "head" instead of "cat" so it > is limited in how much it reads and add a .1 sleep in between reads. This > gives the removal of the instance time to succeed. > > Fixes: 91e6f1ce86577 ("ftracetest: Add instance created, delete, read and > enable event test") > Signed-off-by: Steven Rostedt <[email protected]> > --- > .../ftrace/test.d/instances/instance-event.tc | 26 +++++++++---------- > 1 file changed, 12 insertions(+), 14 deletions(-) > > diff --git > a/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc > b/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc > index 42422e425107..b0e9d3abbf2f 100644 > --- a/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc > +++ b/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc > @@ -25,15 +25,16 @@ if [ $result -ne 0 ]; then > fi > > instance_slam() { > - while :; do > - mkdir foo 2> /dev/null > - rmdir foo 2> /dev/null > - done > + mkdir foo 2> /dev/null > + while ! rmdir foo; do > + echo could not rmdir foo
nit: If we retry this, do we need to warn it? (maybe we can add a limitation of continuous failure and make the test fail if the failure exceeds it.) > + done > } > Thanks, -- Masami Hiramatsu (Google) <[email protected]>
