From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 23 22:24:48 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CBACA16A4CE; Tue, 23 Nov 2004 22:24:48 +0000 (GMT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6B71C43D39; Tue, 23 Nov 2004 22:24:46 +0000 (GMT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.13.1/8.13.1) with ESMTP id iANMMnWR098447; Tue, 23 Nov 2004 17:22:49 -0500 (EST) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)iANMMmUt098444; Tue, 23 Nov 2004 22:22:49 GMT (envelope-from robert@fledge.watson.org) Date: Tue, 23 Nov 2004 22:22:48 +0000 (GMT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Andrey Simonenko In-Reply-To: <20041123134502.GA1112@pm514-9.comsys.ntu-kpi.kiev.ua> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org Subject: Re: Tracing Disk Access X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Nov 2004 22:24:48 -0000 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@fledge.watson.org Principal Research Scientist, McAfee Research