From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Linux Trace Kernel <linux-trace-kernel@vger.kernel.org>,
linux-kselftest@vger.kernel.org,
Masami Hiramatsu <mhiramat@kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH] selftests/tracing: Run sample events to clear page cache events
Date: Tue, 11 Nov 2025 08:22:51 +0900 [thread overview]
Message-ID: <20251111082251.2496db7c20b28184cd8cb759@kernel.org> (raw)
In-Reply-To: <20251028122724.4bff9853@gandalf.local.home>
On Tue, 28 Oct 2025 12:27:24 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:
> From: Steven Rostedt <rostedt@goodmis.org>
>
> The tracing selftest "event-filter-function.tc" was failing because it
> first runs the "sample_events" function that triggers the kmem_cache_free
> event and it looks at what function was used during a call to "ls".
>
> But the first time it calls this, it could trigger events that are used to
> pull pages into the page cache.
>
> The rest of the test uses the function it finds during that call to see if
> it will be called in subsequent "sample_events" calls. But if there's no
> need to pull pages into the page cache, it will not trigger that function
> and the test will fail.
>
> Call the "sample_events" twice to trigger all the page cache work before
> it calls it to find a function to use in subsequent checks.
>
Looks good to me.
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Thanks,
> Cc: stable@vger.kernel.org
> Fixes: eb50d0f250e96 ("selftests/ftrace: Choose target function for filter test from samples")
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> ---
> .../selftests/ftrace/test.d/filter/event-filter-function.tc | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/tools/testing/selftests/ftrace/test.d/filter/event-filter-function.tc b/tools/testing/selftests/ftrace/test.d/filter/event-filter-function.tc
> index c62165fabd0c..003f612f57b0 100644
> --- a/tools/testing/selftests/ftrace/test.d/filter/event-filter-function.tc
> +++ b/tools/testing/selftests/ftrace/test.d/filter/event-filter-function.tc
> @@ -20,6 +20,10 @@ sample_events() {
> echo 0 > tracing_on
> echo 0 > events/enable
>
> +# Clear functions caused by page cache; run sample_events twice
> +sample_events
> +sample_events
> +
> echo "Get the most frequently calling function"
> echo > trace
> sample_events
> --
> 2.51.0
>
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
prev parent reply other threads:[~2025-11-10 23:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-28 16:27 [PATCH] selftests/tracing: Run sample events to clear page cache events Steven Rostedt
2025-11-10 22:14 ` Steven Rostedt
2025-11-11 1:04 ` Shuah Khan
2025-11-10 23:22 ` Masami Hiramatsu [this message]
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=20251111082251.2496db7c20b28184cd8cb759@kernel.org \
--to=mhiramat@kernel.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=rostedt@goodmis.org \
--cc=skhan@linuxfoundation.org \
/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