WIP FPC-III support
[linux/fpc-iii.git] / tools / testing / selftests / ftrace / test.d / trigger / trigger-trace-marker-synthetic-kernel.tc
blob531139f41e9468026a03c067fb1ad2d848dbe572
1 #!/bin/sh
2 # SPDX-License-Identifier: GPL-2.0
3 # description: trace_marker trigger - test histogram with synthetic event against kernel event
4 # requires: set_event synthetic_events events/sched/sched_waking events/ftrace/print/trigger events/ftrace/print/hist
5 # flags:
7 fail() { #msg
8 echo $1
9 exit_fail
12 echo "Test histogram kernel event to trace_marker latency histogram trigger"
14 echo 'latency u64 lat' > synthetic_events
15 echo 'hist:keys=pid:ts0=common_timestamp.usecs' > events/sched/sched_waking/trigger
16 echo 'hist:keys=common_pid:lat=common_timestamp.usecs-$ts0:onmatch(sched.sched_waking).latency($lat)' > events/ftrace/print/trigger
17 echo 'hist:keys=common_pid,lat:sort=lat' > events/synthetic/latency/trigger
18 sleep 1
19 echo "hello" > trace_marker
21 grep 'hitcount: *1$' events/ftrace/print/hist > /dev/null || \
22 fail "hist trigger did not trigger correct times on trace_marker"
24 grep 'hitcount: *1$' events/synthetic/latency/hist > /dev/null || \
25 fail "hist trigger did not trigger "
27 exit 0