useful developer habits and aids (was Re: cvs commit: src/sys/net
if.c)
Mike Makonnen
mtm at identd.net
Wed Sep 22 10:25:14 PDT 2004
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 at identd.net | Fingerprint: AC7B 5672 2D11 F4D0 EBF8 5279 5359 2B82 7CD4 1F55
mtm at FreeBSD.Org| FreeBSD - Unleash the Daemon !
More information about the cvs-src
mailing list