Tracing Disk Access

Robert Watson rwatson at freebsd.org
Tue Nov 23 22:24:48 GMT 2004


On Tue, 23 Nov 2004, Andrey Simonenko wrote:

> On Mon, Nov 22, 2004 at 06:33:18PM -0500, Brian Fundakowski Feldman wrote:
> > On Mon, Nov 22, 2004 at 04:22:54PM +0100, Hanspeter Roth wrote:
> > > 
> > > Hello,
> > > 
> > > I have set an idle timeout for the hard-disk. But when there is no
> > > user activity there are frequent disk accesses.
> > > How can one trace disk access?
> > > I'd like to know the kind of access and on which files/directories/
> > > nodes. I'd like to log on the console or on a memory disk file.
> > 
> > You should look to the MAC framework to provide you -- if not the entire
> > solution -- at least insight into how and where you can do this.  If you
> > were to do it at the disk device level, it would be a GEOM module, though.
> 
> As I understood you suggested to insert controlling geom between a
> consumer and a provider attached to each other.  Am I right that with
> GEOM framework it is impossible to control if some data is read from the
> buffer cache and it is only possible to control device strategy calls? 

That is correct: GEOM only sees the disk I/O events against storage
devices below the abstraction of the buffer cache, which is a service
"library" in the file system/VM.  So you will only see "real" I/O, not the
list of desired disk blocks required by the file system.  In 6.x, the file
systems actually talk directly to GEOM; in 5.x, file systems take a detour
through specfs, which services device vnodes as part of devfs.  In 4.x,
specfs vnodes may be in any file system.

Robert N M Watson             FreeBSD Core Team, TrustedBSD Projects
robert at fledge.watson.org      Principal Research Scientist, McAfee Research




More information about the freebsd-hackers mailing list