2 # SPDX-License-Identifier: GPL-2.0
3 # description: Kprobes event arguments with types
5 [ -f kprobe_events ] || exit_unsupported # this is configurable
7 grep "x8/16/32/64" README > /dev/null || exit_unsupported # version issue
9 gen_event() { # Bitsize
10 echo "p:testprobe _do_fork \$stack0:s$1 \$stack0:u$1 \$stack0:x$1 \$stack0:b4@4/$1"
13 check_types() { # s-type u-type x-type bf-type width
17 X1=`printf "%x" $1 | tail -c ${CW}`
25 B3=`printf "%03x" 0x$X3 | tail -c 2 | head -c 1`
29 for width in 64 32 16 8; do
30 : "Add new event with basic types"
31 gen_event $width > kprobe_events
32 grep testprobe kprobe_events
33 test -d events/kprobes/testprobe
36 echo 1 > events/kprobes/testprobe/enable
38 echo 0 > events/kprobes/testprobe/enable
40 : "Confirm the arguments is recorded in given types correctly"
41 ARGS=`grep "testprobe" trace | sed -e 's/.* arg1=\(.*\) arg2=\(.*\) arg3=\(.*\) arg4=\(.*\)/\1 \2 \3 \4/'`
42 check_types $ARGS $width
44 : "Clear event for next loop"
45 echo "-:testprobe" >> kprobe_events