WIP FPC-III support
[linux/fpc-iii.git] / tools / testing / selftests / ftrace / test.d / event / event-enable.tc
blobcfe5bd2d4267940c37a6cadb583f1e9878c09aa2
1 #!/bin/sh
2 # SPDX-License-Identifier: GPL-2.0
3 # description: event tracing - enable/disable with event level files
4 # requires: set_event events/sched
5 # flags: instance
7 do_reset() {
8 echo > set_event
9 clear_trace
12 fail() { #msg
13 echo $1
14 exit_fail
17 echo 'sched:sched_switch' > set_event
19 yield
21 count=`cat trace | grep sched_switch | wc -l`
22 if [ $count -eq 0 ]; then
23 fail "sched_switch events are not recorded"
26 do_reset
28 echo 1 > events/sched/sched_switch/enable
30 yield
32 count=`cat trace | grep sched_switch | wc -l`
33 if [ $count -eq 0 ]; then
34 fail "sched_switch events are not recorded"
37 do_reset
39 echo 0 > events/sched/sched_switch/enable
41 yield
43 count=`cat trace | grep sched_switch | wc -l`
44 if [ $count -ne 0 ]; then
45 fail "sched_switch events should not be recorded"
48 exit 0