Commit 5b56a07b authored by Masami Hiramatsu's avatar Masami Hiramatsu Committed by Shuah Khan (Samsung OSG)
Browse files

selftests/ftrace: Add function profiling stat testcase



Add a testcase for function profiling per-cpu statistics
interface. There is already func_profile.tc, but that is
mainly focusing on the combination of function-profiler
and function tracer. This testcase ensures trace_stat
per-cpu function statistics is correctly updated.

Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
Acked-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: default avatarShuah Khan (Samsung OSG) <shuah@kernel.org>
parent c21cecea
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# description: ftrace - function profiling

[ ! -f function_profile_enabled ] && exit_unsupported

: "Enable function profile"
echo 1 > function_profile_enabled

: "Profile must be updated"
cp trace_stat/function0 $TMPDIR/
( echo "forked"; sleep 1 )
: "diff returns 0 if there is no difference"
! diff trace_stat/function0 $TMPDIR/function0

echo 0 > function_profile_enabled

: "Profile must NOT be updated"
cp trace_stat/function0 $TMPDIR/
( echo "forked"; sleep 1 )
: "diff returns 0 if there is no difference"
diff trace_stat/function0 $TMPDIR/function0