0001
0002
0003
0004
0005
0006
0007 fail() {
0008 echo $1
0009 exit_fail
0010 }
0011
0012 test_trace() {
0013 file=$1
0014 x=$2
0015
0016 cat $file | while read line; do
0017 comment=`echo $line | sed -e 's/^#//'`
0018 if [ "$line" != "$comment" ]; then
0019 continue
0020 fi
0021 echo "testing $line for >$x<"
0022 match=`echo $line | sed -e "s/>$x<//"`
0023 if [ "$line" = "$match" ]; then
0024 fail "$line does not have >$x< in it"
0025 fi
0026 x=$((x+2))
0027 done
0028 }
0029
0030 echo "Test snapshot trace_marker trigger"
0031
0032 echo 'snapshot' > events/ftrace/print/trigger
0033
0034
0035
0036 grep -q 'Snapshot is allocated' snapshot
0037
0038 for i in `seq 1 10` ; do echo "hello >$i<" > trace_marker; done
0039
0040 test_trace trace 1
0041 test_trace snapshot 2
0042
0043 exit 0