On Wed, Aug 12, 2009 at 9:03 AM, Qihua Wu<[email protected]> wrote:
> Hi, dtrace experts:
>
> Using pid provider, can we print all the parameters passed to a function?
> First need to know is the number of parameters the function has. But which
> build in variable could show us the number of parameters?
Unfortunately, there's currently no way to do that. You need to know
the number of arguments to the function.
Note that DTrace is more than happy to print values for arguments that
don't exist:
# dtrace -n 'pid$target::main:entry{printf("0x%x 0x%x 0x%x 0x%x\n",
arg0, arg1, arg2, arg3)}' -c "ls /"
dtrace: description 'pid$target::main:entry' matched 1 probe
bin devices home media opt root system var
boot etc kernel mnt platform rpool tmp
dev export lib net proc sbin usr
dtrace: pid 107590 has exited
CPU ID FUNCTION:NAME
1 57031 main:entry 0x2 0x8047dd0 0x8047ddc 0x8047d8c
#
Based on this, you could always just dump arg0 - arg9 and figure
things out after the fact. (Assuming there are no more than 10
arguments to any function.)
Chad
_______________________________________________
dtrace-discuss mailing list
[email protected]