0001
0002
0003
0004
0005
0006 TARGET_FUNC=tracefs_create_dir
0007
0008 dec_addr() {
0009 printf "%d" "0x"`echo $1 | tail -c 8`
0010 }
0011
0012 set_offs() {
0013 A1=`dec_addr $1`
0014 A2=`dec_addr $2`
0015 A3=`dec_addr $3`
0016 TARGET="0x$2"
0017 PREV=`expr $A1 - $A2`
0018 NEXT=+`expr $A3 - $A2`
0019 OVERFLOW=+`printf "0x%x" ${PREV}`
0020 }
0021
0022
0023
0024 set_offs `grep -A1 -B1 ${TARGET_FUNC} /proc/kallsyms | cut -f 1 -d " " | xargs`
0025
0026 UINT_TEST=no
0027
0028 if [ `printf "%x" -1 | wc -c` != 9 ]; then
0029 UINT_TEST=yes
0030 fi
0031
0032 echo "p:testprobe ${TARGET_FUNC}" > kprobe_events
0033 echo "p:testprobe ${TARGET}" > kprobe_events
0034 echo "p:testprobe ${TARGET_FUNC}${NEXT}" > kprobe_events
0035 ! echo "p:testprobe ${TARGET_FUNC}${PREV}" > kprobe_events
0036 if [ "${UINT_TEST}" = yes ]; then
0037 ! echo "p:testprobe ${TARGET_FUNC}${OVERFLOW}" > kprobe_events
0038 fi