On Tue, Apr 07, 2009 at 10:39:02AM -0700, Brett Monroe wrote: > Hey all, > > This is probably a dumb newbie question but I seem to be misunderstanding > what the copyin function can do. When I run the following one-liner: > > dtrace -n 'fbt::sprintf:return {printf("%s %s",execname,copyinstr(arg0))}' > > I get the following errors: > > ... > dtrace: error on enabled probe ID 1 (ID 15240: fbt:genunix:sprintf:return): > invalid address (0x1b2) in action #2 at DIF offset 28 > dtrace: error on enabled probe ID 1 (ID 15240: fbt:genunix:sprintf:return): > invalid address (0x1b2) in action #2 at DIF offset 28 > dtrace: error on enabled probe ID 1 (ID 15240: fbt:genunix:sprintf:return): > invalid address (0x1b2) in action #2 at DIF offset 28 > ... > > Shouldn't copyin output the string pointed to by *buf? Or does this only > work for userspace functions?
copyin() is only used for user addresses. Kernel addresses can be used directly (though for 'char *'s, you may need to use stringof()). You've got another error, too; the returned value is in arg1, not arg0 (which holds the offset of the ret instruction). Also, you should use the args[] array, since fbt probes have type information: % dtrace -n 'fbt::sprintf:return {printf("%s %s",execname,stringof(args[1]))}' Cheers, - jonathan _______________________________________________ dtrace-discuss mailing list dtrace-discuss@opensolaris.org