From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 17:39:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 563EB10657B5; Tue, 24 Mar 2009 17:39:08 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 30BE18FC17; Tue, 24 Mar 2009 17:39:08 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id D73CC46B52; Tue, 24 Mar 2009 13:39:07 -0400 (EDT) Date: Tue, 24 Mar 2009 17:39:07 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <200903241714.n2OHEYnX051781@svn.freebsd.org> Message-ID: References: <200903241714.n2OHEYnX051781@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Subject: Re: svn commit: r190380 - in head/sys: cddl/dev/dtnfsclient nfsclient sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Mar 2009 17:39:09 -0000 On Tue, 24 Mar 2009, Robert Watson wrote: > Add DTrace probes to the NFS access and attribute caches. Access cache > events are: > > nfsclient:accesscache:flush:done > nfsclient:accesscache:get:hit > nfsclient:accesscache:get:miss > nfsclient:accesscache:load:done > > They pass the vnode, uid, and requested or loaded access mode (if any); > the load event may also report a load error if the RPC fails. > > The attribute cache events are: > > nfsclient:attrcache:flush:done > nfsclient:attrcache:get:hit > nfsclient:attrcache:get:miss > nfsclient:attrcache:load:done > > They pass the vnode, optionally the vattr if one is present (hit or load), > and in the case of a load event, also a possible RPC error. This will probably want to be changed in a few ways before we consider it done, but I've found it quite useful already in understanding our NFS client and how the various caches interact. Typical trace output might look like this, combining the previously committed NFSv3 RPC tracing with cache tracing: bin syscall module probe vnode * ---- ------------- ----------- ------------- ---------- ls lstat attrcache get:hit 3282019108 ls stat attrcache get:hit 3282019108 ls open accesscache get:hit 3282019108 ls open attrcache flush:done 3282019108 ls open attrcache get:miss 3282019108 ls open nfs3 getattr:start 3282019108 ls open nfs3 getattr:done 3282019108 ls fstat attrcache get:hit 3282019108 ls fstatfs nfs3 fsstat:start 3282019108 ls fstatfs nfs3 fsstat:done 3282019108 ls fstat attrcache get:hit 3282019108 ls fchdir accesscache get:hit 3282019108 ls getdirentries attrcache get:hit 3282019108 ls lstat accesscache get:hit 3282019108 ls lstat attrcache get:hit 3281944576 ls lstat attrcache get:hit 3281944576 ls getdirentries attrcache get:hit 3282019108 ls pathconf accesscache get:hit 3282019108 ls pathconf attrcache get:hit 3281944576 If you're using this on a multi-CPU box, make sure your probes trace timestamps and that you sort by them, if you require ordering, since NFS tends to bounce around a bit, especially for loopback NFS testing. :-) Robert N M Watson Computer Laboratory University of Cambridge