On Thu, Sep 17, 2009 at 9:17 AM, Eugenias <redtigra...@gmail.com> wrote:
> Hi,
>
> I'm a nub in dtrace, could you please help me to find the mistake?
>
> I need to implement the logic:
>
> - if PID and TID are defined, fire the probe for the particular thread of 
> particular process;
> - if only PID is defined, fire the probe for the process including all 
> threads.
>
> The predicat  [i]syscall:::entry / (pid == PID && tid == TID )[/i] / works ok 
> and return syscall for PID/TID process only.
>
> Then I set a predicat:
>
> [i] syscall:::entry
>  /(pid == PID && tid == TID) ||
>  pid == PID/[/i]
>
> and it works for the whole process, as if I set only / pid == PID/.
> What am I missing?

I'm a little bit confused about what you want to do.  If you want to
perform one set of actions if the tid matches and a different set of
actions if it doesn't, you want this:

syscall:::entry
/ pid == PID && tid == TID /
{
    [ one set of actions ]
}

syscall:::entry
/ pid == PID && tid != TID /
{
    [ a different set of actions ]
}

If you want to perform one set of actions no matter the tid and an
additional set of actions if the tid matches, you want this:

syscall:::entry
/ pid == PID /
{
    [ one set of actions ]
}

syscall:::entry
/ pid == PID && tid == TID /
{
    [ additional set of actions ]
}

(It's probably worth noting that "/ (pid == PID && tid == TID) || pid
== PID /" is logically equivalent to "/ pid == PID /".)

Chad
_______________________________________________
dtrace-discuss mailing list
dtrace-discuss@opensolaris.org

Reply via email to