brintos

brintos / linux-shallow public Read only

0
0
Text · 947 B · e28dc5f Raw
29 lines · plain
1#!/bin/sh2# SPDX-License-Identifier: GPL-2.03# description: event trigger - test inter-event histogram trigger onmax action4# requires: set_event synthetic_events events/sched/sched_process_fork/hist ping:program5 6fail() { #msg7    echo $18    exit_fail9}10 11echo "Test create synthetic event"12 13echo 'wakeup_latency  u64 lat pid_t pid char comm[16]' > synthetic_events14if [ ! -d events/synthetic/wakeup_latency ]; then15    fail "Failed to create wakeup_latency synthetic event"16fi17 18echo "Test onmax action"19 20echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="ping"' >> events/sched/sched_waking/trigger21echo '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/trigger22 23ping $LOCALHOST -c 324if ! grep -q "max:" events/sched/sched_switch/hist; then25    fail "Failed to create onmax action inter-event histogram"26fi27 28exit 029