2 # SPDX-License-Identifier: GPL-2.0
3 # description: event tracing - restricts events based on pid notrace filtering
4 # requires: set_event events/sched set_event_pid set_event_notrace_pid
10 echo > set_event_notrace_pid
11 echo 0 > options
/event-fork
12 echo 0 > events
/enable
26 cat trace |
grep -v '^#' |
sed -e 's/[^-]*-\([0-9]*\).*/\1/' |
grep $pid |
wc -l
31 cat trace |
grep -v '^#' |
sed -e 's/[^-]*-\([0-9]*\).*/\1/' |
grep -v $pid |
wc -l
37 if [ -d events
/$system ]; then
38 echo 1 > events
/$system/enable
44 # Enable common groups of events, as all events can allow for
45 # events to be traced via scheduling that we don't care to test.
46 enable_system syscalls
49 enable_system exceptions
60 echo 0 > options
/event-fork
64 read mypid rest
< /proc
/self
/stat
66 echo $mypid > set_event_notrace_pid
67 grep -q $mypid set_event_notrace_pid
75 cnt
=`count_pid $mypid`
76 if [ $cnt -ne 0 ]; then
77 fail
"Filtered out task has events"
80 cnt
=`count_no_pid $mypid`
81 if [ $cnt -eq 0 ]; then
82 fail
"No other events were recorded"
87 echo $mypid > set_event_notrace_pid
88 echo 1 > options
/event-fork
99 cnt
=`count_pid $mypid`
100 if [ $cnt -ne 0 ]; then
101 fail
"Filtered out task has events"
104 cnt
=`count_pid $child`
105 if [ $cnt -ne 0 ]; then
106 fail
"Child of filtered out taskhas events"
109 cnt
=`count_no_pid $mypid`
110 if [ $cnt -eq 0 ]; then
111 fail
"No other events were recorded"