From owner-freebsd-arch Fri Oct 19 5:38:33 2001 Delivered-To: freebsd-arch@freebsd.org Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by hub.freebsd.org (Postfix) with ESMTP id 82C6137B405 for ; Fri, 19 Oct 2001 05:38:25 -0700 (PDT) Received: by flood.ping.uio.no (Postfix, from userid 2602) id AEF1514C2E; Fri, 19 Oct 2001 14:38:23 +0200 (CEST) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: Trent Nelson Cc: freebsd-arch@FreeBSD.org Subject: Re: Proposal: kernel/module debugging support improvements. References: <20011019201919.L23852@freebsd06.udt> From: Dag-Erling Smorgrav Date: 19 Oct 2001 14:38:23 +0200 In-Reply-To: <20011019201919.L23852@freebsd06.udt> Message-ID: Lines: 42 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --=-=-= Trent Nelson writes: > 1. Introducing an ``install.debug'' target to sys/conf/kmod.mk. > > Advantages of this is it is consistent with the ``install.debug'' > target already present in the kernel Makefile. If this approach > is to be used -- it's worthwhile to have these present in > /usr/src/Makefile.inc1 also. The install.debug just installs debugging versions alongside the regular ones (not instead of), but it's "good enough for government work" if you can afford the space on your root fs (if you can't, use MODULES_OVERRIDE to limit the number of modules that actually get built and installed). I've attached a (lightly tested) patch that adds an install.debug target to kmod.mk and makes the kernel Makefile's install.debug and reinstall.debug targets invoke it. The only part of the patch I don't like is having to mess with bsd.subdir.mk, but I don't see any way around it that isn't *more* of an ugly hack. One could also add an 'installkernel.debug' target to Makefile.inc1, but I chose not to do so at this point. > 2. Introducing ``KERNEL_STRIP'' & ``MODULE_STRIP'' variables. > > This would be consistent with the ``STRIP'' variable used in the > userland build process. Doing it this way has the disadvantage > of introducing two variables whose semantics derive implicitly > upon whether or not DEBUG is set. I'm tempted to suggest that we *always* build the kernel and modules *with* debugging symbols, and just strip them off at installation time if we don't want them. This will have the considerable advantage that people who experience a difficult-to-reproduce kernel panic but didn't configure their kernel with -g will still be able to debug the panic as long as they've kept their kernel build directory around. DES -- Dag-Erling Smorgrav - des@ofug.org --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=kmod.diff Index: share/mk/bsd.subdir.mk =================================================================== RCS file: /home/ncvs/src/share/mk/bsd.subdir.mk,v retrieving revision 1.31 diff -u -r1.31 bsd.subdir.mk --- share/mk/bsd.subdir.mk 27 Mar 2001 08:43:28 -0000 1.31 +++ share/mk/bsd.subdir.mk 19 Oct 2001 11:59:59 -0000 @@ -88,7 +88,8 @@ .for __target in all all-man checkdpadd clean cleandepend cleandir depend lint \ - maninstall obj objlink regress tags + maninstall obj objlink regress tags \ + install.debug reinstall.debug .if !target(${__target}) ${__target}: _SUBDIRUSE .endif Index: sys/conf/kmod.mk =================================================================== RCS file: /home/ncvs/src/sys/conf/kmod.mk,v retrieving revision 1.108 diff -u -r1.108 kmod.mk --- sys/conf/kmod.mk 11 Sep 2001 01:13:49 -0000 1.108 +++ sys/conf/kmod.mk 19 Oct 2001 12:35:21 -0000 @@ -212,6 +212,10 @@ _INSTALLFLAGS:= ${_INSTALLFLAGS${ie}} .endfor +install.debug: _SUBDIR + ${INSTALL} ${COPY} -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \ + ${_INSTALLFLAGS} ${FULLPROG} ${DESTDIR}${KMODDIR}/ + realinstall: _SUBDIR ${INSTALL} ${COPY} -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \ ${_INSTALLFLAGS} ${PROG} ${DESTDIR}${KMODDIR}/ Index: sys/conf/Makefile.alpha =================================================================== RCS file: /home/ncvs/src/sys/conf/Makefile.alpha,v retrieving revision 1.113 diff -u -r1.113 Makefile.alpha --- sys/conf/Makefile.alpha 17 Oct 2001 18:04:13 -0000 1.113 +++ sys/conf/Makefile.alpha 19 Oct 2001 12:17:29 -0000 @@ -339,11 +339,11 @@ modules-tags: cd $S/modules ; env ${MKMODULESENV} ${MAKE} tags -modules-install modules-install.debug: +modules-install modules-reinstall: cd $S/modules ; env ${MKMODULESENV} ${MAKE} install -modules-reinstall modules-reinstall.debug: - cd $S/modules ; env ${MKMODULESENV} ${MAKE} install +modules-install.debug modules-reinstall.debug: + cd $S/modules ; env ${MKMODULESENV} ${MAKE} install.debug config.o: ${NORMAL_C} Index: sys/conf/Makefile.i386 =================================================================== RCS file: /home/ncvs/src/sys/conf/Makefile.i386,v retrieving revision 1.245 diff -u -r1.245 Makefile.i386 --- sys/conf/Makefile.i386 17 Oct 2001 13:57:32 -0000 1.245 +++ sys/conf/Makefile.i386 19 Oct 2001 12:18:03 -0000 @@ -297,11 +297,11 @@ modules-tags: cd $S/modules ; env ${MKMODULESENV} ${MAKE} tags -modules-install modules-install.debug: +modules-install modules-reinstall: cd $S/modules ; env ${MKMODULESENV} ${MAKE} install -modules-reinstall modules-reinstall.debug: - cd $S/modules ; env ${MKMODULESENV} ${MAKE} install +modules-install.debug modules-reinstall.debug: + cd $S/modules ; env ${MKMODULESENV} ${MAKE} install.debug config.o: ${NORMAL_C} Index: sys/conf/Makefile.ia64 =================================================================== RCS file: /home/ncvs/src/sys/conf/Makefile.ia64,v retrieving revision 1.36 diff -u -r1.36 Makefile.ia64 --- sys/conf/Makefile.ia64 17 Oct 2001 18:04:13 -0000 1.36 +++ sys/conf/Makefile.ia64 19 Oct 2001 12:18:03 -0000 @@ -307,11 +307,11 @@ modules-tags: cd $S/modules ; env ${MKMODULESENV} ${MAKE} tags -modules-install modules-install.debug: +modules-install modules-reinstall: cd $S/modules ; env ${MKMODULESENV} ${MAKE} install -modules-reinstall modules-reinstall.debug: - cd $S/modules ; env ${MKMODULESENV} ${MAKE} install +modules-install.debug modules-reinstall.debug: + cd $S/modules ; env ${MKMODULESENV} ${MAKE} install.debug config.o: ${NORMAL_C} Index: sys/conf/Makefile.pc98 =================================================================== RCS file: /home/ncvs/src/sys/conf/Makefile.pc98,v retrieving revision 1.146 diff -u -r1.146 Makefile.pc98 --- sys/conf/Makefile.pc98 17 Oct 2001 18:04:13 -0000 1.146 +++ sys/conf/Makefile.pc98 19 Oct 2001 12:18:03 -0000 @@ -301,11 +301,11 @@ modules-tags: cd $S/modules ; env ${MKMODULESENV} ${MAKE} tags -modules-install modules-install.debug: +modules-install modules-reinstall: cd $S/modules ; env ${MKMODULESENV} ${MAKE} install -modules-reinstall modules-reinstall.debug: - cd $S/modules ; env ${MKMODULESENV} ${MAKE} install +modules-install.debug modules-reinstall.debug: + cd $S/modules ; env ${MKMODULESENV} ${MAKE} install.debug config.o: ${NORMAL_C} Index: sys/conf/Makefile.powerpc =================================================================== RCS file: /home/ncvs/src/sys/conf/Makefile.powerpc,v retrieving revision 1.251 diff -u -r1.251 Makefile.powerpc --- sys/conf/Makefile.powerpc 19 Oct 2001 00:32:00 -0000 1.251 +++ sys/conf/Makefile.powerpc 19 Oct 2001 12:18:03 -0000 @@ -307,11 +307,11 @@ modules-tags: cd $S/modules ; env ${MKMODULESENV} ${MAKE} tags -modules-install modules-install.debug: +modules-install modules-reinstall: cd $S/modules ; env ${MKMODULESENV} ${MAKE} install -modules-reinstall modules-reinstall.debug: - cd $S/modules ; env ${MKMODULESENV} ${MAKE} install +modules-install.debug modules-reinstall.debug: + cd $S/modules ; env ${MKMODULESENV} ${MAKE} install.debug config.o: ${NORMAL_C} Index: sys/conf/Makefile.sparc64 =================================================================== RCS file: /home/ncvs/src/sys/conf/Makefile.sparc64,v retrieving revision 1.5 diff -u -r1.5 Makefile.sparc64 --- sys/conf/Makefile.sparc64 17 Oct 2001 18:04:13 -0000 1.5 +++ sys/conf/Makefile.sparc64 19 Oct 2001 12:18:03 -0000 @@ -311,11 +311,11 @@ modules-tags: cd $S/modules ; env ${MKMODULESENV} ${MAKE} tags -modules-install modules-install.debug: +modules-install modules-reinstall: cd $S/modules ; env ${MKMODULESENV} ${MAKE} install -modules-reinstall modules-reinstall.debug: - cd $S/modules ; env ${MKMODULESENV} ${MAKE} install +modules-install.debug modules-reinstall.debug: + cd $S/modules ; env ${MKMODULESENV} ${MAKE} install.debug config.o: ${NORMAL_C} --=-=-=-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message