| .. | .. |
|---|
| 1 | 1 | #!/bin/sh |
|---|
| 2 | 2 | # SPDX-License-Identifier: GPL-2.0 |
|---|
| 3 | 3 | # description: trace_marker trigger - test histogram with synthetic event |
|---|
| 4 | +# requires: set_event synthetic_events events/ftrace/print/trigger events/ftrace/print/hist |
|---|
| 4 | 5 | # flags: |
|---|
| 5 | 6 | |
|---|
| 6 | | -do_reset() { |
|---|
| 7 | | - reset_trigger |
|---|
| 8 | | - echo > set_event |
|---|
| 9 | | - echo > synthetic_events |
|---|
| 10 | | - clear_trace |
|---|
| 11 | | -} |
|---|
| 12 | | - |
|---|
| 13 | 7 | fail() { #msg |
|---|
| 14 | | - do_reset |
|---|
| 15 | 8 | echo $1 |
|---|
| 16 | 9 | exit_fail |
|---|
| 17 | 10 | } |
|---|
| 18 | | - |
|---|
| 19 | | -if [ ! -f set_event ]; then |
|---|
| 20 | | - echo "event tracing is not supported" |
|---|
| 21 | | - exit_unsupported |
|---|
| 22 | | -fi |
|---|
| 23 | | - |
|---|
| 24 | | -if [ ! -f synthetic_events ]; then |
|---|
| 25 | | - echo "synthetic events not supported" |
|---|
| 26 | | - exit_unsupported |
|---|
| 27 | | -fi |
|---|
| 28 | | - |
|---|
| 29 | | -if [ ! -d events/ftrace/print ]; then |
|---|
| 30 | | - echo "event trace_marker is not supported" |
|---|
| 31 | | - exit_unsupported |
|---|
| 32 | | -fi |
|---|
| 33 | | - |
|---|
| 34 | | -if [ ! -f events/ftrace/print/trigger ]; then |
|---|
| 35 | | - echo "event trigger is not supported" |
|---|
| 36 | | - exit_unsupported |
|---|
| 37 | | -fi |
|---|
| 38 | | - |
|---|
| 39 | | -if [ ! -f events/ftrace/print/hist ]; then |
|---|
| 40 | | - echo "hist trigger is not supported" |
|---|
| 41 | | - exit_unsupported |
|---|
| 42 | | -fi |
|---|
| 43 | | - |
|---|
| 44 | | -do_reset |
|---|
| 45 | 11 | |
|---|
| 46 | 12 | echo "Test histogram trace_marker to trace_marker latency histogram trigger" |
|---|
| 47 | 13 | |
|---|
| .. | .. |
|---|
| 60 | 26 | |
|---|
| 61 | 27 | grep 'hitcount: *1$' events/synthetic/latency/hist > /dev/null || \ |
|---|
| 62 | 28 | fail "hist trigger did not trigger " |
|---|
| 63 | | - |
|---|
| 64 | | -do_reset |
|---|
| 65 | 29 | |
|---|
| 66 | 30 | exit 0 |
|---|