WIP FPC-III support
[linux/fpc-iii.git] / tools / testing / selftests / ftrace / test.d / event / subsystem-enable.tc
blobb1ede624986676a554514105936698fdd2b0a915
1 #!/bin/sh
2 # SPDX-License-Identifier: GPL-2.0
3 # description: event tracing - enable/disable with subsystem level files
4 # requires: set_event events/sched/enable
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:*' > set_event
19 yield
21 count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
22 if [ $count -lt 3 ]; then
23 fail "at least fork, exec and exit events should be recorded"
26 do_reset
28 echo 1 > events/sched/enable
30 yield
32 count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
33 if [ $count -lt 3 ]; then
34 fail "at least fork, exec and exit events should be recorded"
37 do_reset
39 echo 0 > events/sched/enable
41 yield
43 count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
44 if [ $count -ne 0 ]; then
45 fail "any of scheduler events should not be recorded"
48 exit 0