On Fri, Mar 03, 2006 at 06:04:17AM -0800, Sh wrote:> For example,we have a script:
> fbt::kobj_lookup:return
> {
> printf("%p\n",arg0);
> printf("%p\n",arg1);
> }
>
> And I get expected results(adresses of _init,_info)
> but if I change the script in that way:
> fbt::kobj_lookup:return
> {
> printf("%p\n",arg1);
> printf("%p\n",arg0);
> }
>
> And I get different results,which do not relate in any way to this
function!
> Why it happens?
I''m not sure what you''re seeing exactly, but keep in mind that
for fbt
return probes arg0 is the offset into the function of the return site and
arg1 is the returned value.
> And one more thing
> I have two probes sometimes returning the same value(pointers)
> These functions are used in many places of the system,and they rarely
return the same value
> So I need in some way output only needed info, something like
> if(a==b) { printf("%p\n",a);}
>
> But as I know, such operators like if,for,while,etc,are not presented in
dtrace yet
> How this can be done?
You can do this with a predicate:
fbt::foo:entry
/a == b/
{
printf("%p\n", a);
}
Adam
--
Adam Leventhal, Solaris Kernel Development http://blogs.sun.com/ahl