]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_type.tc
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
[karo-tx-linux.git] / tools / testing / selftests / ftrace / test.d / kprobe / kprobe_args_type.tc
1 #!/bin/sh
2 # description: Kprobes event arguments with types
3
4 [ -f kprobe_events ] || exit_unsupported # this is configurable
5
6 grep "x8/16/32/64" README > /dev/null || exit_unsupported # version issue
7
8 echo 0 > events/enable
9 echo > kprobe_events
10 enable_tracing
11
12 echo 'p:testprobe _do_fork $stack0:s32 $stack0:u32 $stack0:x32 $stack0:b8@4/32' > kprobe_events
13 grep testprobe kprobe_events
14 test -d events/kprobes/testprobe
15
16 echo 1 > events/kprobes/testprobe/enable
17 ( echo "forked")
18 echo 0 > events/kprobes/testprobe/enable
19 ARGS=`tail -n 1 trace | sed -e 's/.* arg1=\(.*\) arg2=\(.*\) arg3=\(.*\) arg4=\(.*\)/\1 \2 \3 \4/'`
20
21 check_types() {
22   X1=`printf "%x" $1 | tail -c 8`
23   X2=`printf "%x" $2`
24   X3=`printf "%x" $3`
25   test $X1 = $X2
26   test $X2 = $X3
27   test 0x$X3 = $3
28
29   B4=`printf "%02x" $4`
30   B3=`echo -n $X3 | tail -c 3 | head -c 2`
31   test $B3 = $B4
32 }
33 check_types $ARGS
34
35 echo "-:testprobe" >> kprobe_events
36 clear_trace
37 test -d events/kprobes/testprobe && exit 1 || exit 0