2 # SPDX-License-Identifier: GPL-2.0
3 # description: trace_marker trigger - test histogram with synthetic event against kernel event
11 if [ ! -f set_event
]; then
12 echo "event tracing is not supported"
16 if [ ! -f synthetic_events
]; then
17 echo "synthetic events not supported"
21 if [ ! -d events
/ftrace
/print
]; then
22 echo "event trace_marker is not supported"
26 if [ ! -d events
/sched
/sched_waking
]; then
27 echo "event sched_waking is not supported"
31 if [ ! -f events
/ftrace
/print
/trigger
]; then
32 echo "event trigger is not supported"
36 if [ ! -f events
/ftrace
/print
/hist
]; then
37 echo "hist trigger is not supported"
41 echo "Test histogram kernel event to trace_marker latency histogram trigger"
43 echo 'latency u64 lat' > synthetic_events
44 echo 'hist:keys=pid:ts0=common_timestamp.usecs' > events
/sched
/sched_waking
/trigger
45 echo 'hist:keys=common_pid:lat=common_timestamp.usecs-$ts0:onmatch(sched.sched_waking).latency($lat)' > events
/ftrace
/print
/trigger
46 echo 'hist:keys=common_pid,lat:sort=lat' > events
/synthetic
/latency
/trigger
48 echo "hello" > trace_marker
50 grep 'hitcount: *1$' events
/ftrace
/print
/hist
> /dev
/null || \
51 fail
"hist trigger did not trigger correct times on trace_marker"
53 grep 'hitcount: *1$' events
/synthetic
/latency
/hist
> /dev
/null || \
54 fail
"hist trigger did not trigger "