staging: rtl8192u: remove redundant assignment to pointer crypt
[linux/fpc-iii.git] / tools / testing / selftests / ftrace / test.d / trigger / trigger-trace-marker-snapshot.tc
blobdf246e505af7d2b82a136f06f13b4d2dc43f9427
1 #!/bin/sh
2 # SPDX-License-Identifier: GPL-2.0
3 # description: trace_marker trigger - test snapshot trigger
4 # flags: instance
6 fail() { #msg
7 echo $1
8 exit_fail
11 if [ ! -f set_event ]; then
12 echo "event tracing is not supported"
13 exit_unsupported
16 if [ ! -f snapshot ]; then
17 echo "snapshot is not supported"
18 exit_unsupported
21 if [ ! -d events/ftrace/print ]; then
22 echo "event trace_marker is not supported"
23 exit_unsupported
26 if [ ! -f events/ftrace/print/trigger ]; then
27 echo "event trigger is not supported"
28 exit_unsupported
31 test_trace() {
32 file=$1
33 x=$2
35 cat $file | while read line; do
36 comment=`echo $line | sed -e 's/^#//'`
37 if [ "$line" != "$comment" ]; then
38 continue
40 echo "testing $line for >$x<"
41 match=`echo $line | sed -e "s/>$x<//"`
42 if [ "$line" = "$match" ]; then
43 fail "$line does not have >$x< in it"
45 x=$((x+2))
46 done
49 echo "Test snapshot trace_marker tigger"
51 echo 'snapshot' > events/ftrace/print/trigger
53 # make sure the snapshot is allocated
55 grep -q 'Snapshot is allocated' snapshot
57 for i in `seq 1 10` ; do echo "hello >$i<" > trace_marker; done
59 test_trace trace 1
60 test_trace snapshot 2
62 exit 0