From owner-freebsd-current@FreeBSD.ORG Thu Apr 29 14:53:03 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8E1D816A4D0; Thu, 29 Apr 2004 14:53:03 -0700 (PDT) Received: from mta4.rcsntx.swbell.net (mta4.rcsntx.swbell.net [151.164.30.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3E73843D73; Thu, 29 Apr 2004 14:53:01 -0700 (PDT) (envelope-from kris@obsecurity.org) Received: from obsecurity.dyndns.org (bca0794f4ed48cb9b3c8d1921186fed7@adsl-67-115-73-128.dsl.lsan03.pacbell.net [67.115.73.128])i3TLqb4a029426; Thu, 29 Apr 2004 16:52:38 -0500 (CDT) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id F1E64536AE; Thu, 29 Apr 2004 14:52:36 -0700 (PDT) Date: Thu, 29 Apr 2004 14:52:36 -0700 From: Kris Kennaway To: John Baldwin Message-ID: <20040429215236.GA42902@xor.obsecurity.org> References: <200404291855.i3TItUTr048530@green.homeunix.org> <200404291656.02104.jhb@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5mCyUwZo2JvN/JJP" Content-Disposition: inline In-Reply-To: <200404291656.02104.jhb@FreeBSD.org> User-Agent: Mutt/1.4.2.1i cc: Brian Fundakowski Feldman cc: freebsd-current@FreeBSD.org cc: Alex Lyashkov cc: Julian Elischer Subject: Re: code cleanup X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2004 21:53:03 -0000 --5mCyUwZo2JvN/JJP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 29, 2004 at 04:56:02PM -0400, John Baldwin wrote: > On Thursday 29 April 2004 02:55 pm, Brian Fundakowski Feldman wrote: > > John Baldwin wrote: > > > On Thursday 29 April 2004 12:06 am, Alex Lyashkov wrote: > > > > > Note that the allproc_lock protects the allproc list. W/o the > > > > > FOREACH_PROC macro, I can grep for 'allproc' in the source tree to > > > > > find all users to verify locking, etc. With the extra macro, I n= ow > > > > > have to do multiple greps. > > > > > > > > two greps is multiple ? first of FOREACH_PROC, second allproc or > > > > combine at one grep with two -e parameters. > > > > > > Multiple means more than one, yes. When I'm searching the tree when > > > locking a structure or fields of a structure I don't usually come up = with > > > complex grep statements, and actually, I wouldn't find the FOREACH_FOO > > > macro until I did the first grep anyway. When you add lots of macros > > > that do this you get a compounding problem. > > > > For what it's worth, I don't think it is good to hide things as much as > > FOREACH_PROC_IN_SYSTEM() -- this specific instance -- does, but grep is= not > > a good tool for a tree as large as FreeBSD's. Try using cscope instead. >=20 > I've used glimpse in the past but it is buggy. Actually, grep -r on ssc/= sys=20 > doesn't take that long, esp. if you do it multiple times as most of the t= ree=20 > is still in cache for subsequent grep's (at least on my laptop). I also = tend=20 > to have lots (around 7 or so) trees that have work going on in them at an= y=20 > one time. The problem with grep -r in src/sys is that it chokes on the symlinks created by module builds and pollutes the output with hundreds of lines of errors unless you remember to first remove the module build files. Kris --5mCyUwZo2JvN/JJP Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAkXkkWry0BWjoQKURAu4wAKDp2b21SMAJt/Vo2KUbKvByLVeTcgCgrnXI PaqNNG3Tyxp9tzbSiL+ZKwA= =ypti -----END PGP SIGNATURE----- --5mCyUwZo2JvN/JJP--