From owner-freebsd-stable@FreeBSD.ORG Mon Dec 31 23:04:54 2007 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 4C85416A46C for ; Mon, 31 Dec 2007 23:04:54 +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 EC40613C4E8 for ; Mon, 31 Dec 2007 23:04:53 +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 89CE03FA3 for ; Mon, 31 Dec 2007 22:48:51 +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 rz9AmerGtMGZ for ; Mon, 31 Dec 2007 22:48:44 +0000 (GMT) Received: by outcold.yadt.co.uk (Postfix, from userid 1001) id 6713B4969; Mon, 31 Dec 2007 19:14:56 +0000 (GMT) Date: Mon, 31 Dec 2007 19:14:56 +0000 From: David Taylor To: freebsd-stable@freebsd.org Message-ID: <20071231191455.GA74675@outcold.yadt.co.uk> Mail-Followup-To: freebsd-stable@freebsd.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="17pEHd4RhPHOinZp" Content-Disposition: inline User-Agent: Mutt/1.5.17 (2007-11-01) Subject: [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: Mon, 31 Dec 2007 23:04:54 -0000 --17pEHd4RhPHOinZp Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline 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? -- David Taylor --17pEHd4RhPHOinZp Content-Type: text/x-diff; charset=iso-8859-15 Content-Disposition: attachment; filename="sys_stack_h.diff" Index: sys/stack.h =================================================================== RCS file: /home/ncvs/src/sys/sys/stack.h,v retrieving revision 1.2 diff -u -r1.2 stack.h --- sys/stack.h 29 Aug 2005 11:34:08 -0000 1.2 +++ sys/stack.h 31 Dec 2007 19:14:10 -0000 @@ -46,7 +46,7 @@ void stack_zero(struct stack *); void stack_print(struct stack *); void stack_sbuf_print(struct sbuf *, struct stack *); -#ifdef KTR +#if defined(DDB) && defined(KTR) void stack_ktr(u_int, const char *, int, struct stack *, u_int, int); #define CTRSTACK(m, st, depth, cheap) do { \ if (KTR_COMPILE & (m)) \ --17pEHd4RhPHOinZp--