From owner-freebsd-stable@FreeBSD.ORG Tue Jan 1 00:50:03 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB07216A417 for ; Tue, 1 Jan 2008 00:50:03 +0000 (UTC) (envelope-from davidt@yadt.co.uk) Received: from outcold.yadt.co.uk (outcold.yadt.co.uk [81.187.204.178]) by mx1.freebsd.org (Postfix) with ESMTP id 6A2B313C4EF for ; Tue, 1 Jan 2008 00:50:03 +0000 (UTC) (envelope-from davidt@yadt.co.uk) Received: from localhost (localhost [127.0.0.1]) by outcold.yadt.co.uk (Postfix) with ESMTP id 0148810D1 for ; Tue, 1 Jan 2008 00:50:02 +0000 (GMT) X-Virus-Scanned: amavisd-new at yadt.co.uk Received: from outcold.yadt.co.uk ([127.0.0.1]) by localhost (outcold.yadt.co.uk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id b0V7CwgMADjT for ; Tue, 1 Jan 2008 00:49:59 +0000 (GMT) Received: by outcold.yadt.co.uk (Postfix, from userid 1001) id A883710B8; Tue, 1 Jan 2008 00:49:59 +0000 (GMT) Date: Tue, 1 Jan 2008 00:49:59 +0000 From: David Taylor To: freebsd-stable@freebsd.org Message-ID: <20080101004959.GA96045@outcold.yadt.co.uk> Mail-Followup-To: freebsd-stable@freebsd.org References: <20071231191455.GA74675@outcold.yadt.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20071231191455.GA74675@outcold.yadt.co.uk> User-Agent: Mutt/1.5.17 (2007-11-01) Subject: Re: [PATCH] 7-STABLE Build broken in geom_io.c with KTR but no DDB X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jan 2008 00:50:03 -0000 On Mon, 31 Dec 2007, David Taylor wrote: > Hi, > > I've been trying to do some debugging with ktrace(9) for the first time, > and ran in to a problem after trying to compile the kernel. > > I didn't have DDB defined, and as a result the build failed > after adding "option KTR": > > geom_io.o(.text+0x5ee): In function `g_alloc_bio': > ../../../geom/geom_io.c:140: undefined reference to `stack_save' > geom_io.o(.text+0x61e):../../../geom/geom_io.c:141: undefined reference to `stack_ktr' > geom_io.o(.text+0x6e1): In function `g_clone_bio': > > The use of CTRx in the geom code appears to be correctly wrapped with > #ifdef KTR, but this is also all that protects the uses of CTRSTACK. > > CTRSTACK is also defined to use stack_ktr conditionally on #ifdef KTR in > sys/stack.h, but the stack_ktr function is compiled in to the kernel only > if DDB is enabled. > > Perhaps CTRSTACK should be non-empty only if both DDB and KTR are defined? OK, the attached patch is necessary, but not quite sufficient to fix the problem. geom_io.c also calls stack_save() under #ifdef KTR, when it needs to be under an #ifdef DDB as well... P.S. Happy New Year everyone! -- David Taylor