WIP FPC-III support
[linux/fpc-iii.git] / tools / testing / selftests / ftrace / test.d / trigger / trigger-stacktrace.tc
blob320ea9b3c6cdfd3191a7724477bdcfb6e8d6581c
1 #!/bin/sh
2 # SPDX-License-Identifier: GPL-2.0
3 # description: event trigger - test stacktrace-trigger
4 # requires: set_event events/sched/sched_process_fork/trigger
6 fail() { #msg
7 echo $1
8 exit_fail
11 FEATURE=`grep stacktrace events/sched/sched_process_fork/trigger`
12 if [ -z "$FEATURE" ]; then
13 echo "stacktrace trigger is not supported"
14 exit_unsupported
17 echo "Test stacktrace trigger"
18 echo 0 > trace
19 echo 0 > options/stacktrace
20 echo 'stacktrace' > events/sched/sched_process_fork/trigger
21 ( echo "forked")
22 grep "<stack trace>" trace > /dev/null || \
23 fail "stacktrace trigger on sched_process_fork did not work"
25 reset_trigger
27 echo "Test stacktrace semantic errors"
29 ! echo "stacktrace:foo" > events/sched/sched_process_fork/trigger
30 echo "stacktrace" > events/sched/sched_process_fork/trigger
31 ! echo "stacktrace" > events/sched/sched_process_fork/trigger
33 exit 0