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