2 # SPDX-License-Identifier: GPL-2.0
3 # description: Test creation and deletion of trace instances while setting an event
5 if [ ! -d instances
] ; then
6 echo "no instance directory with this kernel"
19 # we don't want to fail on error
26 if [ $result -ne 0 ]; then
27 echo "instance rmdir not supported"
33 mkdir foo
2> /dev
/null
34 rmdir foo
2> /dev
/null
40 cat foo
/trace
1> /dev
/null
2>&1
46 echo 1 > foo
/events
/sched
/sched_switch
68 echo "Wait for processes to finish"
70 echo "all processes finished, wait for cleanup"
77 fail
"foo still exists"
81 echo "schedule:enable_event:sched:sched_switch" > foo
/set_ftrace_filter
84 fail
"foo still exists"
86 if grep -q "schedule:enable_event:sched:sched_switch" ..
/set_ftrace_filter
; then
87 echo "Older kernel detected. Cleanup filter"
88 echo '!schedule:enable_event:sched:sched_switch' > ..
/set_ftrace_filter
131 echo "Wait for processes to finish"
132 wait $p1 $p2 $p3 $p4 $p5
133 echo "all processes finished, wait for cleanup"
140 fail
"instance $d still exists"