| .. | .. |
|---|
| 1 | 1 | #!/bin/sh |
|---|
| 2 | 2 | # SPDX-License-Identifier: GPL-2.0 |
|---|
| 3 | 3 | # description: event trigger - test histogram trigger |
|---|
| 4 | +# requires: set_event events/sched/sched_process_fork/trigger events/sched/sched_process_fork/hist |
|---|
| 4 | 5 | # flags: instance |
|---|
| 5 | 6 | |
|---|
| 6 | | -do_reset() { |
|---|
| 7 | | - reset_trigger |
|---|
| 8 | | - echo > set_event |
|---|
| 9 | | - clear_trace |
|---|
| 10 | | -} |
|---|
| 11 | | - |
|---|
| 12 | 7 | fail() { #msg |
|---|
| 13 | | - do_reset |
|---|
| 14 | 8 | echo $1 |
|---|
| 15 | 9 | exit_fail |
|---|
| 16 | 10 | } |
|---|
| 17 | 11 | |
|---|
| 18 | | -if [ ! -f set_event -o ! -d events/sched ]; then |
|---|
| 19 | | - echo "event tracing is not supported" |
|---|
| 20 | | - exit_unsupported |
|---|
| 21 | | -fi |
|---|
| 22 | | - |
|---|
| 23 | | -if [ ! -f events/sched/sched_process_fork/trigger ]; then |
|---|
| 24 | | - echo "event trigger is not supported" |
|---|
| 25 | | - exit_unsupported |
|---|
| 26 | | -fi |
|---|
| 27 | | - |
|---|
| 28 | | -if [ ! -f events/sched/sched_process_fork/hist ]; then |
|---|
| 29 | | - echo "hist trigger is not supported" |
|---|
| 30 | | - exit_unsupported |
|---|
| 31 | | -fi |
|---|
| 32 | | - |
|---|
| 33 | | -reset_tracer |
|---|
| 34 | | -do_reset |
|---|
| 35 | | - |
|---|
| 36 | | -echo "Test histogram basic tigger" |
|---|
| 12 | +echo "Test histogram basic trigger" |
|---|
| 37 | 13 | |
|---|
| 38 | 14 | echo 'hist:keys=parent_pid:vals=child_pid' > events/sched/sched_process_fork/trigger |
|---|
| 39 | 15 | for i in `seq 1 10` ; do ( echo "forked" > /dev/null); done |
|---|
| .. | .. |
|---|
| 78 | 54 | check_inc `grep -o "child_pid:[[:space:]]*[[:digit:]]*" \ |
|---|
| 79 | 55 | events/sched/sched_process_fork/hist | cut -d: -f2 ` || |
|---|
| 80 | 56 | fail "sort param on sched_process_fork did not work" |
|---|
| 81 | | - |
|---|
| 82 | | -do_reset |
|---|
| 83 | 57 | |
|---|
| 84 | 58 | exit 0 |
|---|