2014-09-17 13:23:48 +02:00

30 lines
872 B
Bash

#!/bin/ksh
# "Quick Dtrace" script by Tanel Poder (http://www.tanelpoder.com)
PROCESS=$1
shift
for F in $* ; do
FUNCLIST_ENTRY=${FUNCLIST_ENTRY}",pid\$target::$F:entry"
FUNCLIST_RETURN=${FUNCLIST_RETURN}",pid\$target::$F:return"
done
FUNCLIST_ENTRY=`echo "$FUNCLIST_ENTRY" | sed 's/^,//'`
FUNCLIST_RETURN=`echo "$FUNCLIST_RETURN" | sed 's/^,//'`
echo $FUNCLIST_ENTRY
echo $FUNCLIST_RETURN
#dtrace -p $PROCESS -Fn $FUNCLIST"{ trace(probefunc); trace(arg0); trace(arg1); trace(arg2); trace(arg3); }"
#dtrace -p $PROCESS -Fn $FUNCLIST'{ printf("%16x %16x %16x %16x %16x %16x", arg0, arg1, arg2, arg3, arg4, arg5); }'
#dtrace -p $PROCESS -Fn $FUNCLIST'{ printf("%s %16x %16x %16x %16x %16x", copyinstr(arg0), arg1, arg2, arg3, arg4, arg5); }'
dtrace -Zp $PROCESS -Fn \
$FUNCLIST_ENTRY'{ printf("%16x ", arg0 ); }'\
$FUNCLIST_RETURN'{ printf("%16x", arg1); }'