Nigel S wrote:
> I'm a newbie as dtrace, but couldn't find an answer to this by searching
> :
> 
> For example, I have function "lsearch" which is called in many different
> places. It's also called by "composemessage".
> 
> I have been able to successfully create a script which show the return
> values of "lsearch". Now what I would like to do, is for it to only show
> the return value of "lsearch" when it's called by "composemessage".
> 
> Any ideas , suggestions ?

in this case, you need to use a predicate, like in this example:

pid$target::composemessage:entry
{
        self->watch = 1;
}

pid$target::lsearch:return
/self->watch == 1/      /* that's the predicate */
{
        /* print return value */
}

pid$target::composemessage:return
/self->watch == 1/
{
        self->watch = 0;        /* turn it off again! */
}

HTH
Michael
-- 
Michael Schuster     http://blogs.sun.com/recursion
Recursion, n.: see 'Recursion'
_______________________________________________
dtrace-discuss mailing list
[email protected]

Reply via email to