0001
0002
0003
0004
0005
0006 fail() {
0007 echo $1
0008 exit_fail
0009 }
0010
0011 echo "Test create synthetic event"
0012
0013 echo 'ping_test_latency u64 lat; char filename[]' > synthetic_events
0014 if [ ! -d events/synthetic/ping_test_latency ]; then
0015 fail "Failed to create ping_test_latency synthetic event"
0016 fi
0017
0018 echo "Test create histogram for synthetic event using trace action and dynamic strings"
0019 echo "Test histogram dynamic string variables,simple expression support and trace action"
0020
0021 echo 'hist:key=pid:filenamevar=filename:ts0=common_timestamp.usecs' > events/sched/sched_process_exec/trigger
0022 echo 'hist:key=pid:lat=common_timestamp.usecs-$ts0:onmatch(sched.sched_process_exec).ping_test_latency($lat,$filenamevar) if comm == "ping"' > events/sched/sched_process_exit/trigger
0023 echo 'hist:keys=filename,lat:sort=filename,lat' > events/synthetic/ping_test_latency/trigger
0024
0025 ping $LOCALHOST -c 5
0026
0027 if ! grep -q "ping" events/synthetic/ping_test_latency/hist; then
0028 fail "Failed to create dynamic string trace action inter-event histogram"
0029 fi
0030
0031 exit 0