[dtrace-discuss] all open files

Dan Mick dan.mick at sun.com
Wed Jul 11 17:25:30 PDT 2007


I think you're misunderstanding the purpose and use of dtrace.

it's about instrumenting code paths.  If the code path was executed long ago, 
dtrace will be of little use.

Sometimes it helps me to think of dtrace as "incredibly smart, output-rich, 
data-reducing breakpoints", but that's just because I'm a debugger geek.

In other words, what you're looking for is more "parse a table recording past 
events in current state" than "wait for an event and do something when it happens".

Venkatesh wrote:
> Hi All,
> 
> Thank you all for the responses. Many referred to
> /proc/*/path and pfiles, which i am already aware of.
> However i was wondering, if there is a way to get the same
> info from "dtrace".
> 
> We can find using "syscall::open*:entry" , however this
> does not account for already open files. 
> 
> Is there any other way , using dtrace to find all the open
> files.
> 
> Regards,
> Venkat
> 
> 
> --- James Carlson <james.d.carlson at Sun.COM> wrote:
> 
>> Dave Marquardt writes:
>>> "Zhou" == Zhou Aaron <aaron.zhou1018 at hotmail.com>
>> writes:
>>> Zhou> Another question: In userland, is there any other
>> way to open
>>> Zhou> file except for the open()/creat() syscall? of
>> course, in kernel
>>> Zhou> area, don't need to care open or not, just
>> reference to
>>> Zhou> vnode,then can do any operation for associated
>> file.
>>> Depends what you mean by "file".  Are you interested in
>> all the ways
>>> you can get a file descriptor?  If that's the case, you
>> need to add
>>> dup/dup2 and socket.  Oh, how about pipe?
>> ... and accept() and descriptor passing and the various
>> ioctls that
>> can return open fds.
>>
>> -- 
>> James Carlson, Solaris Networking             
>> <james.d.carlson at sun.com>
>> Sun Microsystems / 1 Network Drive         71.232W   Vox
>> +1 781 442 2084
>> MS UBUR02-212 / Burlington MA 01803-2757   42.496N   Fax
>> +1 781 442 1677
>>
> 
> 
> 
>  
> ____________________________________________________________________________________
> Finding fabulous fares is fun.  
> Let Yahoo! FareChase search your favorite travel sites to find flight and hotel bargains.
> http://farechase.yahoo.com/promo-generic-14795097



More information about the dtrace-discuss mailing list