summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-multi-actions-accept.tc
blob: c193dce611a23fa0116791b62193641ecaec213c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh
# description: event trigger - test multiple actions on hist trigger


do_reset() {
    reset_trigger
    echo > set_event
    clear_trace
}

fail() { #msg
    do_reset
    echo $1
    exit_fail
}

if [ ! -f set_event ]; then
    echo "event tracing is not supported"
    exit_unsupported
fi

if [ ! -f synthetic_events ]; then
    echo "synthetic event is not supported"
    exit_unsupported
fi

clear_synthetic_events
reset_tracer
do_reset

echo "Test multiple actions on hist trigger"
echo 'wakeup_latency u64 lat; pid_t pid' >> synthetic_events
TRIGGER1=events/sched/sched_wakeup/trigger
TRIGGER2=events/sched/sched_switch/trigger

echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="cyclictest"' > $TRIGGER1
echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-$ts0 if next_comm=="cyclictest"' >> $TRIGGER2
echo 'hist:keys=next_pid:onmatch(sched.sched_wakeup).wakeup_latency(sched.sched_switch.$wakeup_lat,next_pid) if next_comm=="cyclictest"' >> $TRIGGER2
echo 'hist:keys=next_pid:onmatch(sched.sched_wakeup).wakeup_latency(sched.sched_switch.$wakeup_lat,prev_pid) if next_comm=="cyclictest"' >> $TRIGGER2
echo 'hist:keys=next_pid if next_comm=="cyclictest"' >> $TRIGGER2

do_reset

exit 0
OpenPOWER on IntegriCloud