1 #!/bin/sh 2 # SPDX-License-Identifier: GPL-2.0 3 # description: event trigger - test inter-event histogram trigger trace action with dynamic string param 4 # requires: set_event synthetic_events events/sched/sched_process_exec/hist "can be any field, or the special string 'common_stacktrace'":README 5 6 fail() { #msg 7 echo $1 8 exit_fail 9 } 10 11 echo "Test create synthetic event with stack" 12 13 echo 's:wake_lat pid_t pid; u64 delta; unsigned long[] stack;' > dynamic_events 14 echo 'hist:keys=next_pid:ts=common_timestamp.usecs,st=common_stacktrace if prev_state == 1||prev_state == 2' >> events/sched/sched_switch/trigger 15 echo 'hist:keys=prev_pid:delta=common_timestamp.usecs-$ts,s=$st:onmax($delta).trace(wake_lat,prev_pid,$delta,$s)' >> events/sched/sched_switch/trigger 16 echo 1 > events/synthetic/wake_lat/enable 17 sleep 1 18 19 if ! grep -q "=>.*sched" trace; then 20 fail "Failed to create synthetic event with stack" 21 fi 22 23 exit 0
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.