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