Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Sep 2004 20:25:20 +0300
From:      Mike Makonnen <mtm@identd.net>
To:        Brooks Davis <brooks@one-eyed-alien.net>
Cc:        cvs-src@FreeBSD.org
Subject:   useful developer habits and aids (was Re: cvs commit: src/sys/net if.c)
Message-ID:  <20040922172519.GB14929@rogue.acs.lan>
In-Reply-To: <20040922163810.GA28683@odin.ac.hmc.edu>
References:  <200409220859.i8M8xgwb022928@repoman.freebsd.org> <20040922130052.GA3407@green.homeunix.org> <20040922150105.GA17806@odin.ac.hmc.edu> <20040922153007.GA91347@green.homeunix.org> <20040922163810.GA28683@odin.ac.hmc.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Sep 22, 2004 at 09:38:10AM -0700, Brooks Davis wrote:
> > 
> > No hard feelings, since I'm used to having a new issue or two every kernel
> > upgrade, but this really should be a lesson to anyone listening that kernel
> > development without INVARIANTS (and sometimes WITNESS) is a big no-no.
> 
> Yah, I've added INVARIANTS back to my laptop kernel in perforce to avoid
> this particular mistake in the future.

I usually don't like running with full debuging and even just invariants
sometimes. But when I touch anything in the kernel it's nice to be able to
have a debug kernel arround without recompiling. So, I use the following
two scripts:
http://people.freebsd.org/~mtm/build
http://people.freebsd.org/~mtm/installkernel

My build setup is essentially like this:

/usr/a/conf
/usr/a/logs
/usr/a/src
/usr/a/obj
/usr/src is symlinked to /usr/a/src
/usr/obj is symlinked to /usr/a/obj

In /usr/a/conf are my kernel configuration files. Currently I have
a KERNEL KERNEL_DBG and KERNEL_PERF
KERNEL only has invariants
KERNEL_DBG has invariants, witness, and mutex debugging turned on
KERNEL_PERF has no invariants, no witness, and no debugging.

The following two commands will automatically build all my kernels
and install them:

build -r /usr/a -k -K GENERIC,KERNEL,KERNEL_DBG,KERNEL_PERF
installkernel -K GENERIC,KERNEL,KERNEL_DBG,KERNEL_PERF

I usually have KERNEL or KERNEL_PERF set as my default kernel in
/boot/loader.conf, but switching to any of the others is easy. When
I touch anything in the kernel I just have to switch to KERNEL_DBG
and don't have to bother recompiling a debug kernel that may or may
not be out-of-sync with the kernel I'm currently running. 

On my 2.4Ghz laptop the whole process takes a little over an hour.
Also, it helps to have a larger than usual root partition :-)

I'd be interested in hearing other people's ideas on how they reduce
development hassels. Actually I'd like to hear about any type of usefull
development habits.

Cheers
-- 
Mike Makonnen  | GPG-KEY: http://www.identd.net/~mtm/mtm.asc
mtm@identd.net | Fingerprint: AC7B 5672 2D11 F4D0 EBF8  5279 5359 2B82 7CD4 1F55
mtm@FreeBSD.Org| FreeBSD - Unleash the Daemon !



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