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 (legacy stack) 4 # requires: set_event synthetic_events events/sched/sched_process_exec/hist "long[] stack' >> synthetic_events":README 5 6 fail() { #msg 7 echo $1 8 exit_fail 9 } 10 11 echo "Test create synthetic event with stack" 12 13 # Test the old stacktrace keyword (for backward compatibility) 14 echo 's:wake_lat pid_t pid; u64 delta; unsigned long[] stack;' > dynamic_events 15 echo 'hist:keys=next_pid:ts=common_timestamp.usecs,st=stacktrace if prev_state == 1||prev_state == 2' >> events/sched/sched_switch/trigger 16 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 17 echo 1 > events/synthetic/wake_lat/enable 18 sleep 1 19 20 if ! grep -q "=>.*sched" trace; then 21 fail "Failed to create synthetic event with stack" 22 fi 23 24 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.