On Thu, Jan 29, 2009 at 01:48:05PM -0800, Glenn Skinner wrote:
> syscall::write:entry
> /pid == $target && arg0 == 1/
> {
>       interesting = 1;
>       printf("writing 0x%x bytes to stdout at 0x%x\n",
>               arg2, fds[1].fi_offset);
> }
> 
> syscall::write:return
> /pid == $target && interesting == 1/
> {
>       printf("wrote 0x%x bytes\n", arg0);
> }
> 
> syscall:::entry
> /pid == $target && interesting == 1/
> {
> }

The last probe does very little.  And the second one catches write()
returns other than the ones you want.

Perhaps you meant something like:

syscall::write:entry
/pid == $target && arg0 == 1/
{
        self->interesting = 1;
        printf("writing 0x%x bytes to stdout at 0x%x\n",
                arg2, fds[1].fi_offset);
}

syscall::write:return
/pid == $target && self->interesting == 1/
{
        printf("wrote 0x%x bytes\n", arg0);
}

Nico
-- 
_______________________________________________
dtrace-discuss mailing list
[email protected]

Reply via email to