2 # SPDX-License-Identifier: GPL-2.0
3 # description: event tracing - restricts events based on pid
9 echo 0 > options/event-fork
20 ping localhost -c 1 || sleep .001 || usleep 1 || sleep 1
23 if [ ! -f set_event -o ! -d events/sched ]; then
24 echo "event tracing is not supported"
28 if [ ! -f set_event_pid ]; then
29 echo "event pid filtering is not supported"
36 echo 1 > events/sched/sched_switch/enable
40 count=`cat trace | grep sched_switch | wc -l`
41 if [ $count -eq 0 ]; then
42 fail "sched_switch events are not recorded"
47 read mypid rest < /proc/self/stat
49 echo $mypid > set_event_pid
50 echo 'sched:sched_switch' > set_event
54 count=`cat trace | grep sched_switch | grep -v "pid=$mypid" | wc -l`
55 if [ $count -ne 0 ]; then
56 fail "sched_switch events from other task are recorded"
61 echo $mypid > set_event_pid
62 echo 1 > options/event-fork
63 echo 1 > events/sched/sched_switch/enable
67 count=`cat trace | grep sched_switch | grep -v "pid=$mypid" | wc -l`
68 if [ $count -eq 0 ]; then
69 fail "sched_switch events from other task are not recorded"