From owner-freebsd-questions Wed Mar 31 1:34:51 1999 Delivered-To: freebsd-questions@freebsd.org Received: from quark.ChrisBowman.com (crbowman.erols.com [209.122.47.155]) by hub.freebsd.org (Postfix) with ESMTP id 26FDB15C57; Wed, 31 Mar 1999 01:34:39 -0800 (PST) (envelope-from crb@ChrisBowman.com) Received: from fermion (fermion.ChrisBowman.com [10.0.1.2]) by quark.ChrisBowman.com (8.9.2/8.8.8) with SMTP id EAA19329; Wed, 31 Mar 1999 04:48:58 -0500 (EST) (envelope-from crb@ChrisBowman.com) Message-Id: <199903310948.EAA19329@quark.ChrisBowman.com> X-Sender: crb@quark X-Mailer: QUALCOMM Windows Eudora Pro Version 4.0.1 Date: Wed, 31 Mar 1999 04:32:58 -0500 To: Greg Lehey From: "Christopher R. Bowman" Subject: Re: Debug kernel by default (was: System size with -g) Cc: "Matthew D. Fuller" , questions@FreeBSD.ORG, FreeBSD Hackers In-Reply-To: <19990331165139.W413@lemis.com> References: <19990331003535.E17547@futuresouth.com> <19990331003535.E17547@futuresouth.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG At 04:51 PM 3/31/99 +0930, Greg Lehey wrote: >On Wednesday, 31 March 1999 at 0:35:35 -0600, Matthew D. Fuller wrote: >> I know this is what most people will think of as a Very Bad Idea From The >> Get-Go, but I'm curious in any event. >> What sort of impact on size(disk)/size(memory)/startup time/etc would >> compiling the entire system with debugging symbols be? (i.e., put -g in >> CFLAGS in make.conf) Double the size of the base system? Quintuple? > >Interestingly enough, we are currently discussing this in -hackers. >We're thinking about changing the way the kernel is built so that a >debug kernel will be the default. > >To answer your question: a typical (partially) stripped kernel is >about 1.8 MB in size. The corresponding debug kernel is about 9 MB >(since ELF; a.out debug kernels are about 3 MB larger). This space is >*in memory at all times*, so you don't normally want to load it, but >it's good to have for dump analysis. > >Here are some comparative figures for building a kernel on my main >machine (AMD K6-2/333, 160 MB memory): > > normal debug >Make all 4:30 5:0 >Kernel size 1.8 MB 9 MB >Directory size 5.5 MB 24 MB > >The directory is so much larger because not only the kernel, but also >all the object files contain debug symbols. The difference in >compilation time assumes lots of RAM; otherwise you could end up with >a lot of paging and a corresponding increase in compilation time. > >The way we're talking now, it looks like we could end up with: > >1. The -g option for config(8) no longer has any meaning. With or > without it, you end up configuring a debug kernel. >2. 'make install' make a copy of the kernel, called kernel.debug, and > strips the original kernel before installing it. >3. 'make install.debug' would install the debug version of the > kernel. This can be useful for people who use ddb or another > in-kernel debugger. It's not needed for people who use a serial > debugger like gdb -k. >4. For people for whom the additional memory requirements are a > problem, config will have a -s (or similar) option to say 'build a > kernel without debugging symbols'. > >Any comments? This is by no means set in stone, and we'll discuss it >a while before we do anything. > >Greg Could(are the) debugging symbols be placed in a separate ELF section and the boot loader (or what ever it is that loads the kernel) be taught to not load that section depending on a command line option. Would this be at all useful? -------- Christopher R. Bowman crb@ChrisBowman.com http://www.ChrisBowman.com/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message