mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Tengda Wu <wutengda@huaweicloud.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Shuah Khan <shuah@kernel.org>,
	Yuanhe Shu <xiangzao@linux.alibaba.com>,
	linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org
Subject: Re: [PATCH -next] selftests/ftrace: Prevent potential failure in subsystem-enable test case
Date: Thu, 10 Jul 2025 23:22:34 -0400	[thread overview]
Message-ID: <17189AF8-34DC-4E5C-9233-ECADAECBBD26@goodmis.org> (raw)
In-Reply-To: <2bf277fb-a1b8-47f8-9133-e3ca27327eda@huaweicloud.com>



On July 10, 2025 10:48:54 PM EDT, Tengda Wu <wutengda@huaweicloud.com> wrote:
>

>The patch works well - after ~50 test iterations, we haven't observed any
>recurrence of the test case failures.
>
>However, I'm concerned that using 'cat trace_pipe' (like the original
>'cat trace' method) could bring back the stopping problem [1] on slower
>systems.
>
>Could a slow trace_pipe reader (slower than sched event generation rate)
>reintroduce the original race condition?
>

Only if it doesn't find three different events, in which case the test would fail regardless.

The awk script exits out as soon as it finds 3: unique events. It won't go forever, even on slower machines.

-- Steve

>[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1a4ea83a6e67f1415a1f17c1af5e9c814c882bb5
>
>Some test details:
>
>$ ./ftracetest -vvv subsystem-enable.tc
>[...]
>+ echo sched:*
>+ yield
>+ ping 127.0.0.1 -c 1
>PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
>64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.538 ms
>
>--- 127.0.0.1 ping statistics ---
>1 packets transmitted, 1 received, 0% packet loss, time 1ms
>rtt min/avg/max/mdev = 0.538/0.538/0.538/0.000 ms
>+ check_unique
>+ cat trace_pipe
>+ grep -v ^#
>+ awk 
>        BEGIN { cnt = 0; }
>        {
>            for (i = 0; i < cnt; i++) {
>                if (event[i] == $5) {
>                    break;
>                }
>            }
>            if (i == cnt) {
>                event[cnt++] = $5;
>                if (cnt > 2) {
>                    exit;
>                }
>            }
>        }
>        END {
>            printf "%d", cnt;
>        }
>+ count=3
>+ [ 3 -lt 3 ]
>+ do_reset
>[...]
>
>Regards,
>Tengda

  reply	other threads:[~2025-07-11  3:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-10 13:01 Tengda Wu
2025-07-10 19:34 ` Steven Rostedt
2025-07-11  2:48   ` Tengda Wu
2025-07-11  3:22     ` Steven Rostedt [this message]
2025-07-11  3:37       ` Tengda Wu
2025-07-21  1:54   ` Tengda Wu
2025-07-21 17:29     ` Steven Rostedt
2025-07-26 11:01       ` Tengda Wu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=17189AF8-34DC-4E5C-9233-ECADAECBBD26@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=shuah@kernel.org \
    --cc=wutengda@huaweicloud.com \
    --cc=xiangzao@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®