From owner-cvs-all@FreeBSD.ORG Mon Sep 12 06:19:22 2005 Return-Path: X-Original-To: cvs-all@freebsd.org Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3C08A16A45C for ; Mon, 12 Sep 2005 06:19:22 +0000 (GMT) (envelope-from minimarmot@gmail.com) Received: from xproxy.gmail.com (xproxy.gmail.com [66.249.82.200]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5CE9A43D53 for ; Mon, 12 Sep 2005 06:19:20 +0000 (GMT) (envelope-from minimarmot@gmail.com) Received: by xproxy.gmail.com with SMTP id i27so1831399wxd for ; Sun, 11 Sep 2005 23:19:19 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:references; b=al+a3J+R+qM3h5BoqORJn/7HrWk/PTEXgOS7X1Nww9KSmL2nIEwfWj1aVUlZiLKNWqhr2UMSJB1jF9XfObZIObGZgqfyN3pP/OuY8oRQQfyTfkv44SGTNtQR/tRJXlNZfxyC7CvXNEkrAsUzrN2NmOYLUExl+rDuiTpPKcLhc2w= Received: by 10.70.44.14 with SMTP id r14mr95867wxr; Sun, 11 Sep 2005 23:19:19 -0700 (PDT) Received: by 10.70.9.2 with HTTP; Sun, 11 Sep 2005 23:19:19 -0700 (PDT) Message-ID: <47d0403c050911231950b35471@mail.gmail.com> Date: Mon, 12 Sep 2005 06:19:19 +0000 From: Ben Kaduk To: Greg 'groggy' Lehey In-Reply-To: <20050912005134.GB2929@wantadilla.lemis.com> Mime-Version: 1.0 References: <20050911002229.51F4916A471@hub.freebsd.org> <432382BC.5080105@root.org> <20050911022901.GA3090@xor.obsecurity.org> <20050912005134.GB2929@wantadilla.lemis.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: How to debug kernels (was: cvs commit: src/sys/conf kern.post.mk) X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: minimarmot@gmail.com List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2005 06:19:22 -0000 On 9/12/05, Greg 'groggy' Lehey wrote: >=20 > On Saturday, 10 September 2005 at 22:29:02 -0400, Kris Kennaway wrote: > > On Sat, Sep 10, 2005 at 10:01:15PM -0400, Garance A Drosihn wrote: > >> At 6:05 PM -0700 9/10/05, Nate Lawson wrote: > >>> David E. O'Brien wrote: > >>>> obrien 2005-09-11 00:22:21 UTC > >>>> > >>>> FreeBSD src repository > >>>> > >>>> Modified files: > >>>> sys/conf kern.post.mk Log: > >>>> For HEAD, install a kernel with debug information if DEBUG is a=20 > kernel > >>>> config option. It is too easy to loose the build directory and not= =20 > have > >>>> symbols for kgdb to read. > >>>> Revision Changes Path > >>>> 1.84 +4 -17 src/sys/conf/kern.post.mk > >>> > >>> I disagree with this change. We do not need to waste the space > >>> in /. If I'm running a debug kernel, it is based on the latest > >>> version of kernel.debug in my kernel compile dir and I know to > >>> find it there. > >> > >> Fwiw, I've been burned by building a debug kernel, only to have > >> removed the original compile-directory for that kernel by the time I > >> actually *needed* the debug symbols. It's one thing if you're building > >> a debug kernel because you know you're going to spend the next hour > >> debugging some change. It's another if you're building a debug kernel > >> because your machine might panic sometime in the next two or three > >> weeks. > > > > Likewise, I also find this change very useful. When I'm juggling a > > few dozen panics on a few dozen machines with a few dozen different > > customized source trees, it's hard to keep track of all the > > kernel.debugs. Now I don't have to. >=20 > A lot must depend on how you use your debug kernel. One of the > biggest problems I've found is keeping the kernel and the sources in > sync. This change makes it more difficult. Also, the kernel build > can install debugging macros in the build directory; if you blow away > that directory, you've lost the macros too. >=20 > The method I use is described in > http://wwww.lemis.com/grog/Papers/Debug-tutorial/tutorial.pdf. > Basically, you debug from the kernel build directory and just pull in > the dump from /var/crash. I'm planning to present it again in Basel > in November, so if anybody disagrees with the approach, now is the > time to tell me. With this method, having symbols in the booted > kernel is a waste of time and space. >=20 > Greg > -- > See complete headers for address and phone numbers. >=20 >=20 >=20 Somewhat of a side point, but what do people think of doing a similar thing= =20 for loadable modules? I am actually quite ignorant about the matter, not=20 even knowing if a DEBUG=3D-g line in a kernel config file propogates to=20 modules built at the same time (I should think it would), but the same=20 situation can occur for modules as for the core kernel. In fact, I just today needed snd_ich.ko.debug, but very nearly blasted it= =20 away with a buildworld/buildkernel, since I want to check if the panic I ge= t=20 has been fixed in the past week. Luckily, the need to save such a file was= =20 pointed out to me quickly, but (as a fairly ignorant end-user), it may make= =20 it possible to solve a problem reported by the same. This of course magnifies the space requirement, and deciding which modules= =20 to include could be a big bikeshed, but if the debug kernel on / stays, it= =20 should be thought about. Ben Kaduk