[dtrace-discuss] all open files

Zhou Aaron aaron.zhou1018 at hotmail.com
Thu Jul 12 03:08:53 PDT 2007


I think there isn't a good way to check all open files like you expected 
using dtrace.May you can write a simple module and search all existent 
process file table to get all open files.I believe "/proc" should use this 
way already.

>From: Venkatesh <venkatesh_ch at yahoo.com>
>To: Dan Mick <dan.mick at sun.com>
>CC: James Carlson <james.d.carlson at sun.com>,  Dave Marquardt 
<Dave.Marquardt at sun.com>,  Zhou Aaron <aaron.zhou1018 at hotmail.com>, 
dtrace-discuss at opensolaris.org
>Subject: Re: [dtrace-discuss] all open files
>Date: Wed, 11 Jul 2007 17:59:46 -0700 (PDT)
>
>
>Thanks so much Dan for explanation.
>
>I was thinking if there is some kind of walkers like mdb
>(or) some other internal kernel sys call, that i could
>probe using Dtrace to find all open files.
>
>/proc tools, is my answer then.
>
>Thanks again for all.
>
>Regards,
>Venkat
>
>--- Dan Mick <dan.mick at sun.com> wrote:
>
> > 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
> >
> >
>
>
>
>
>____________________________________________________________________________________

>Choose the right car based on your needs.  Check out Yahoo! Autos new Car 
Finder tool.
>http://autos.yahoo.com/carfinder/

_________________________________________________________________
免费下载 MSN Explorer:   http://explorer.msn.com/lccn/  



More information about the dtrace-discuss mailing list