Hi dtrace users,

even as a dtrace beginner, I was quite successful putting a dtrace  
script together to help me debug a wierd file descriptor issue on Mac  
OS X 10.5.5 -- I was able to get all the necessary debugging  
information from syscalls like open, dup, dup2, fork, write and many  
more, just with pipe I got no idea on how to output both of the file  
descriptors returned using dtrace.

With pipe being defined as follows

        int pipe(int *fildes);

actually returning the two file descriptors as fildes[0] and  
fildes[1], I always get fildes[0] in arg0 (and arg1) inside  
syscall::pipe:return. But where is fildes[1]? I thought I'd probably  
need to get the pointer and then use copyin() -- but I just can't  
figure out how...

        syscall::pipe:entry
        {
          /* Any possibility to get a pointer here already to be assigned to  
self->something to help me in "return"? */
        }
        
        syscall::pipe:return
        {
          printf("pipe(%d, %d)\n", arg0, arg1 /* <- How to get the second  
file descriptor? */);
        }

Any help is appreciated!

Thanks,
Beat

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

Reply via email to