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
61 sleep .001 ||
usleep 1 ||
sleep 1
64 echo 0 > options
/event-fork
68 read mypid rest
< /proc
/self
/stat
70 echo $mypid > set_event_notrace_pid
71 grep -q $mypid set_event_notrace_pid
79 cnt
=`count_pid $mypid`
80 if [ $cnt -ne 0 ]; then
81 fail
"Filtered out task has events"
84 cnt
=`count_no_pid $mypid`
85 if [ $cnt -eq 0 ]; then
86 fail
"No other events were recorded"
91 echo $mypid > set_event_notrace_pid
92 echo 1 > options
/event-fork
101 # Be sure some other events will happen for small systems (e.g. 1 core)
106 cnt
=`count_pid $mypid`
107 if [ $cnt -ne 0 ]; then
108 fail
"Filtered out task has events"
111 cnt
=`count_pid $child`
112 if [ $cnt -ne 0 ]; then
113 fail
"Child of filtered out taskhas events"
116 cnt
=`count_no_pid $mypid`
117 if [ $cnt -eq 0 ]; then
118 fail
"No other events were recorded"