1#!/bin/sh 2# description: event trigger - test stacktrace-trigger 3 4do_reset() { 5 reset_trigger 6 echo > set_event 7 clear_trace 8} 9 10fail() { #msg 11 do_reset 12 echo $1 13 exit $FAIL 14} 15 16if [ ! -f set_event -o ! -d events/sched ]; then 17 echo "event tracing is not supported" 18 exit_unsupported 19fi 20 21if [ ! -f events/sched/sched_process_fork/trigger ]; then 22 echo "event trigger is not supported" 23 exit_unsupported 24fi 25 26reset_tracer 27do_reset 28 29FEATURE=`grep stacktrace events/sched/sched_process_fork/trigger` 30if [ -z "$FEATURE" ]; then 31 echo "stacktrace trigger is not supported" 32 exit_unsupported 33fi 34 35echo "Test stacktrace tigger" 36echo 0 > trace 37echo 0 > options/stacktrace 38echo 'stacktrace' > events/sched/sched_process_fork/trigger 39( echo "forked") 40grep "<stack trace>" trace > /dev/null || \ 41 fail "stacktrace trigger on sched_process_fork did not work" 42 43reset_trigger 44 45echo "Test stacktrace semantic errors" 46 47! echo "stacktrace:foo" > events/sched/sched_process_fork/trigger 48echo "stacktrace" > events/sched/sched_process_fork/trigger 49! echo "stacktrace" > events/sched/sched_process_fork/trigger 50 51do_reset 52 53exit 0 54