2 # SPDX-License-Identifier: GPL-2.0
3 # description: trace_marker trigger - test histogram with synthetic 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 [ ! -f events
/ftrace
/print
/trigger
]; then
27 echo "event trigger is not supported"
31 if [ ! -f events
/ftrace
/print
/hist
]; then
32 echo "hist trigger is not supported"
36 echo "Test histogram trace_marker to trace_marker latency histogram trigger"
38 echo 'latency u64 lat' > synthetic_events
39 echo 'hist:keys=common_pid:ts0=common_timestamp.usecs if buf == "start"' > events
/ftrace
/print
/trigger
40 echo 'hist:keys=common_pid:lat=common_timestamp.usecs-$ts0:onmatch(ftrace.print).latency($lat) if buf == "end"' >> events
/ftrace
/print
/trigger
41 echo 'hist:keys=common_pid,lat:sort=lat' > events
/synthetic
/latency
/trigger
42 echo -n "start" > trace_marker
43 echo -n "end" > trace_marker
45 cnt
=`grep 'hitcount: *1$' events/ftrace/print/hist | wc -l`
47 if [ $cnt -ne 2 ]; then
48 fail
"hist trace_marker trigger did not trigger correctly"
51 grep 'hitcount: *1$' events
/synthetic
/latency
/hist
> /dev
/null || \
52 fail
"hist trigger did not trigger "