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