summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/ftrace/test.d/ftrace/func_profile_stat.tc
blob: 0d501058aa75cb30031276b3ca8f709142d7e42f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/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