1 #!/bin/sh 2 # SPDX-License-Identifier: GPL-2.0 3 # description: trace_marker trigger - test snapshot trigger 4 # requires: set_event snapshot events/ftrace/print/trigger 5 # flags: instance 6 7 fail() { #msg 8 echo $1 9 exit_fail 10 } 11 12 test_trace() { 13 file=$1 14 x=$2 15 16 cat $file | while read line; do 17 comment=`echo $line | sed -e 's/^#//'` 18 if [ "$line" != "$comment" ]; then 19 continue 20 fi 21 echo "testing $line for >$x<" 22 match=`echo $line | sed -e "s/>$x<//"` 23 if [ "$line" = "$match" ]; then 24 fail "$line does not have >$x< in it" 25 fi 26 x=$((x+2)) 27 done 28 } 29 30 echo "Test snapshot trace_marker trigger" 31 32 echo 'snapshot' > events/ftrace/print/trigger 33 34 # make sure the snapshot is allocated 35 36 grep -q 'Snapshot is allocated' snapshot 37 38 for i in `seq 1 10` ; do echo "hello >$i<" > trace_marker; done 39 40 test_trace trace 1 41 test_trace snapshot 2 42 43 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.