2 # SPDX-License-Identifier: GPL-2.0
3 # description: event tracing - restricts events based on pid
4 # requires: set_event set_event_pid events/sched
10 echo 0 > options
/event-fork
20 echo 0 > options
/event-fork
22 echo 1 > events
/sched
/sched_switch
/enable
26 count
=`cat trace | grep sched_switch | wc -l`
27 if [ $count -eq 0 ]; then
28 fail
"sched_switch events are not recorded"
33 read mypid rest
< /proc
/self
/stat
35 echo $mypid > set_event_pid
36 grep -q $mypid set_event_pid
37 echo 'sched:sched_switch' > set_event
41 count
=`cat trace | grep sched_switch | grep -v "pid=$mypid" | wc -l`
42 if [ $count -ne 0 ]; then
43 fail
"sched_switch events from other task are recorded"
48 echo $mypid > set_event_pid
49 echo 1 > options
/event-fork
50 echo 1 > events
/sched
/sched_switch
/enable
54 count
=`cat trace | grep sched_switch | grep -v "pid=$mypid" | wc -l`
55 if [ $count -eq 0 ]; then
56 fail
"sched_switch events from other task are not recorded"