| .. | .. |
|---|
| 1 | 1 | #!/bin/sh |
|---|
| 2 | 2 | # SPDX-License-Identifier: GPL-2.0 |
|---|
| 3 | 3 | # description: event tracing - enable/disable with subsystem level files |
|---|
| 4 | +# requires: set_event events/sched/enable |
|---|
| 4 | 5 | # flags: instance |
|---|
| 5 | 6 | |
|---|
| 6 | 7 | do_reset() { |
|---|
| .. | .. |
|---|
| 9 | 10 | } |
|---|
| 10 | 11 | |
|---|
| 11 | 12 | fail() { #msg |
|---|
| 12 | | - do_reset |
|---|
| 13 | 13 | echo $1 |
|---|
| 14 | 14 | exit_fail |
|---|
| 15 | 15 | } |
|---|
| 16 | | - |
|---|
| 17 | | -yield() { |
|---|
| 18 | | - ping localhost -c 1 || sleep .001 || usleep 1 || sleep 1 |
|---|
| 19 | | -} |
|---|
| 20 | | - |
|---|
| 21 | | -if [ ! -f set_event -o ! -d events/sched ]; then |
|---|
| 22 | | - echo "event tracing is not supported" |
|---|
| 23 | | - exit_unsupported |
|---|
| 24 | | -fi |
|---|
| 25 | | - |
|---|
| 26 | | -reset_tracer |
|---|
| 27 | | -do_reset |
|---|
| 28 | 16 | |
|---|
| 29 | 17 | echo 'sched:*' > set_event |
|---|
| 30 | 18 | |
|---|
| .. | .. |
|---|
| 56 | 44 | if [ $count -ne 0 ]; then |
|---|
| 57 | 45 | fail "any of scheduler events should not be recorded" |
|---|
| 58 | 46 | fi |
|---|
| 59 | | - |
|---|
| 60 | | -do_reset |
|---|
| 61 | 47 | |
|---|
| 62 | 48 | exit 0 |
|---|