WIP FPC-III support
[linux/fpc-iii.git] / tools / testing / selftests / ftrace / test.d / trigger / trigger-trace-marker-snapshot.tc
blob27da2dba9b9e323bba0ee82de6407238b08fcc1e
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
7 fail() { #msg
8 echo $1
9 exit_fail
12 test_trace() {
13 file=$1
14 x=$2
16 cat $file | while read line; do
17 comment=`echo $line | sed -e 's/^#//'`
18 if [ "$line" != "$comment" ]; then
19 continue
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"
26 x=$((x+2))
27 done
30 echo "Test snapshot trace_marker trigger"
32 echo 'snapshot' > events/ftrace/print/trigger
34 # make sure the snapshot is allocated
36 grep -q 'Snapshot is allocated' snapshot
38 for i in `seq 1 10` ; do echo "hello >$i<" > trace_marker; done
40 test_trace trace 1
41 test_trace snapshot 2
43 exit 0