Qihua Wu
2009-Aug-12 13:03 UTC
[dtrace-discuss] How to print all parameters for a function (pid provider?)
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? Thanks, Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20090812/9aeb3d39/attachment.html>
Chad Mynhier
2009-Aug-12 13:21 UTC
[dtrace-discuss] How to print all parameters for a function (pid provider?)
On Wed, Aug 12, 2009 at 9:03 AM, Qihua Wu<dtrace.wu at gmail.com> 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