From owner-freebsd-questions Tue Mar 30 23:22: 5 1999 Delivered-To: freebsd-questions@freebsd.org Received: from allegro.lemis.com (allegro.lemis.com [192.109.197.134]) by hub.freebsd.org (Postfix) with ESMTP id 674DD14BD2; Tue, 30 Mar 1999 23:22:00 -0800 (PST) (envelope-from grog@freebie.lemis.com) Received: from freebie.lemis.com (freebie.lemis.com [192.109.197.137]) by allegro.lemis.com (8.9.1/8.9.0) with ESMTP id QAA05586; Wed, 31 Mar 1999 16:51:40 +0930 (CST) Received: (from grog@localhost) by freebie.lemis.com (8.9.3/8.9.0) id QAA82496; Wed, 31 Mar 1999 16:51:39 +0930 (CST) Message-ID: <19990331165139.W413@lemis.com> Date: Wed, 31 Mar 1999 16:51:39 +0930 From: Greg Lehey To: "Matthew D. Fuller" , questions@FreeBSD.ORG Cc: FreeBSD Hackers Subject: Debug kernel by default (was: System size with -g) References: <19990331003535.E17547@futuresouth.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.93.2i In-Reply-To: <19990331003535.E17547@futuresouth.com>; from Matthew D. Fuller on Wed, Mar 31, 1999 at 12:35:35AM -0600 WWW-Home-Page: http://www.lemis.com/~grog Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 -- When replying to this message, please copy the original recipients. For more information, see http://www.lemis.com/questions.html See complete headers for address, home page and phone numbers finger grog@lemis.com for PGP public key To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message