Linux-libre 5.3.12-gnu
[librecmc/linux-libre.git] / tools / testing / selftests / ftrace / test.d / ftrace / func_profile_stat.tc
1 #!/bin/sh
2 # SPDX-License-Identifier: GPL-2.0
3 # description: ftrace - function profiling
4
5 [ ! -f function_profile_enabled ] && exit_unsupported
6
7 : "Enable function profile"
8 echo 1 > function_profile_enabled
9
10 : "Profile must be updated"
11 cp trace_stat/function0 $TMPDIR/
12 ( echo "forked"; sleep 1 )
13 : "diff returns 0 if there is no difference"
14 ! diff trace_stat/function0 $TMPDIR/function0
15
16 echo 0 > function_profile_enabled
17
18 : "Profile must NOT be updated"
19 cp trace_stat/function0 $TMPDIR/
20 ( echo "forked"; sleep 1 )
21 : "diff returns 0 if there is no difference"
22 diff trace_stat/function0 $TMPDIR/function0