Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Mar 1999 16:51:39 +0930
From:      Greg Lehey <grog@lemis.com>
To:        "Matthew D. Fuller" <fullermd@futuresouth.com>, questions@FreeBSD.ORG
Cc:        FreeBSD Hackers <hackers@FreeBSD.ORG>
Subject:   Debug kernel by default (was: System size with -g)
Message-ID:  <19990331165139.W413@lemis.com>
In-Reply-To: <19990331003535.E17547@futuresouth.com>; from Matthew D. Fuller on Wed, Mar 31, 1999 at 12:35:35AM -0600
References:  <19990331003535.E17547@futuresouth.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990331165139.W413>