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