• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2# description: event trigger - test inter-event histogram trigger onmax action
3
4fail() { #msg
5    echo $1
6    exit_fail
7}
8
9if [ ! -f set_event ]; then
10    echo "event tracing is not supported"
11    exit_unsupported
12fi
13
14if [ ! -f synthetic_events ]; then
15    echo "synthetic event is not supported"
16    exit_unsupported
17fi
18
19echo "Test create synthetic event"
20
21echo 'wakeup_latency  u64 lat pid_t pid char comm[16]' > synthetic_events
22if [ ! -d events/synthetic/wakeup_latency ]; then
23    fail "Failed to create wakeup_latency synthetic event"
24fi
25
26echo "Test onmax action"
27
28echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="ping"' >> events/sched/sched_waking/trigger
29echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-$ts0:onmax($wakeup_lat).save(next_comm,prev_pid,prev_prio,prev_comm) if next_comm=="ping"' >> events/sched/sched_switch/trigger
30
31ping $LOCALHOST -c 3
32if ! grep -q "max:" events/sched/sched_switch/hist; then
33    fail "Failed to create onmax action inter-event histogram"
34fi
35
36exit 0
37