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 6 7 do_reset() { 8 echo > set_event 9 clear_trace 10 } 11 12 fail() { #msg 13 echo $1 14 exit_fail 15 } 16 17 echo 'sched:*' > set_event 18 19 yield 20 21 count=`head -n 100 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" 24 fi 25 26 do_reset 27 28 echo 1 > events/sched/enable 29 30 yield 31 32 count=`head -n 100 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" 35 fi 36 37 do_reset 38 39 echo 0 > events/sched/enable 40 41 yield 42 43 count=`head -n 100 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" 46 fi 47 48 exit 0
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.