1#!/bin/sh 2# description: event trigger - test multiple actions on hist trigger 3 4 5do_reset() { 6 reset_trigger 7 echo > set_event 8 clear_trace 9} 10 11fail() { #msg 12 do_reset 13 echo $1 14 exit_fail 15} 16 17if [ ! -f set_event ]; then 18 echo "event tracing is not supported" 19 exit_unsupported 20fi 21 22if [ ! -f synthetic_events ]; then 23 echo "synthetic event is not supported" 24 exit_unsupported 25fi 26 27clear_synthetic_events 28reset_tracer 29do_reset 30 31echo "Test multiple actions on hist trigger" 32echo 'wakeup_latency u64 lat; pid_t pid' >> synthetic_events 33TRIGGER1=events/sched/sched_wakeup/trigger 34TRIGGER2=events/sched/sched_switch/trigger 35 36echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="cyclictest"' > $TRIGGER1 37echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-$ts0 if next_comm=="cyclictest"' >> $TRIGGER2 38echo 'hist:keys=next_pid:onmatch(sched.sched_wakeup).wakeup_latency(sched.sched_switch.$wakeup_lat,next_pid) if next_comm=="cyclictest"' >> $TRIGGER2 39echo 'hist:keys=next_pid:onmatch(sched.sched_wakeup).wakeup_latency(sched.sched_switch.$wakeup_lat,prev_pid) if next_comm=="cyclictest"' >> $TRIGGER2 40echo 'hist:keys=next_pid if next_comm=="cyclictest"' >> $TRIGGER2 41 42do_reset 43 44exit 0 45