Skip to content

Commit dd4adb9

Browse files
rostedtshuahkh
authored andcommitted
selftests/tracing: Run sample events to clear page cache events
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. Cc: stable@vger.kernel.org Fixes: eb50d0f ("selftests/ftrace: Choose target function for filter test from samples") Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org> Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
1 parent 920aa3a commit dd4adb9

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

tools/testing/selftests/ftrace/test.d/filter/event-filter-function.tc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ sample_events() {
2020
echo 0 > tracing_on
2121
echo 0 > events/enable
2222

23+
# Clear functions caused by page cache; run sample_events twice
24+
sample_events
25+
sample_events
26+
2327
echo "Get the most frequently calling function"
2428
echo > trace
2529
sample_events

0 commit comments

Comments
 (0)