2 # SPDX-License-Identifier: GPL-2.0
3 # description: event trigger - test histogram modifiers
18 if [ ! -f set_event -o ! -d events/sched ]; then
19 echo "event tracing is not supported"
23 if [ ! -f events/sched/sched_process_fork/trigger ]; then
24 echo "event trigger is not supported"
28 if [ ! -f events/sched/sched_process_fork/hist ]; then
29 echo "hist trigger is not supported"
36 echo "Test histogram with execname modifier"
38 echo 'hist:keys=common_pid.execname' > events/sched/sched_process_fork/trigger
39 for i in `seq 1 10` ; do ( echo "forked" > /dev/null); done
40 COMM=`cat /proc/$$/comm`
41 grep "common_pid: $COMM" events/sched/sched_process_fork/hist > /dev/null || \
42 fail "execname modifier on sched_process_fork did not work"
46 echo "Test histogram with hex modifier"
48 echo 'hist:keys=parent_pid.hex' > events/sched/sched_process_fork/trigger
49 for i in `seq 1 10` ; do ( echo "forked" > /dev/null); done
50 # Note that $$ is the parent pid. $PID is current PID.
52 grep "parent_pid: $HEX" events/sched/sched_process_fork/hist > /dev/null || \
53 fail "hex modifier on sched_process_fork did not work"
57 echo "Test histogram with syscall modifier"
59 echo 'hist:keys=id.syscall' > events/raw_syscalls/sys_exit/trigger
60 for i in `seq 1 10` ; do ( echo "forked" > /dev/null); done
61 grep "id: \(unknown_\|sys_\)" events/raw_syscalls/sys_exit/hist > /dev/null || \
62 fail "syscall modifier on raw_syscalls/sys_exit did not work"
67 echo "Test histgram with log2 modifier"
69 echo 'hist:keys=bytes_req.log2' > events/kmem/kmalloc/trigger
70 for i in `seq 1 10` ; do ( echo "forked" > /dev/null); done
71 grep 'bytes_req: ~ 2^[0-9]*' events/kmem/kmalloc/hist > /dev/null || \
72 fail "log2 modifier on kmem/kmalloc did not work"