From owner-freebsd-bugs@FreeBSD.ORG Thu Jul 14 13:51:11 2005 Return-Path: X-Original-To: freebsd-bugs@FreeBSD.org Delivered-To: freebsd-bugs@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AE57816A41C; Thu, 14 Jul 2005 13:51:11 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailout2.pacific.net.au (mailout2.pacific.net.au [61.8.0.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2B50143D49; Thu, 14 Jul 2005 13:51:11 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.0.86]) by mailout2.pacific.net.au (8.13.4/8.13.4/Debian-3) with ESMTP id j6EDoxDU019657; Thu, 14 Jul 2005 23:50:59 +1000 Received: from epsplex.bde.org (katana.zip.com.au [61.8.7.246]) by mailproxy1.pacific.net.au (8.13.4/8.13.4/Debian-3) with ESMTP id j6EDovc6024022; Thu, 14 Jul 2005 23:50:59 +1000 Date: Thu, 14 Jul 2005 23:50:59 +1000 (EST) From: Bruce Evans X-X-Sender: bde@epsplex.bde.org To: "Wojciech A. Koszek" In-Reply-To: <200507141156.j6EBuIhU031586@freebsd.czest.pl> Message-ID: <20050714232017.F2094@epsplex.bde.org> References: <200507141156.j6EBuIhU031586@freebsd.czest.pl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-bugs@FreeBSD.org, FreeBSD-gnats-submit@FreeBSD.org Subject: Re: kern/83445: [PATCH] ndis won't compile with kernel profiling enabled X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jul 2005 13:51:11 -0000 >> Description: > With kernel profiling enabled (-p[p] in CONFIGARGS) I'm > not able to properly compile ndis(4). Build process > stops on: > (src/sys/compat/ndis/winx32_wrap.S): > [..] > ret $0xFF > [..] I think it would work with plain profiling (-p), but with high resolution profiling (-pp), it would neither compile nor work, since "ret" is a macro in that case in order to make it work. > After changing this instructions to their proper op-code: > .byte 0xC2 > .byte 0xFF > .byte 0x00 > everything seems to be just fine (ndis compiles). Since > this change needs to be made in order to satisfy compiler, > I belive it doesn't touch typical behaviour. This would make high resolution profiling compile but not work. There must be a call to mexitcount just before the return. The ENTRY() macro hides the corresponding complications for entry to functions and the ret macro handles most cases for exit. Large amounts of assembler code are likely to have other bugs in mcounting. The templates are especially difficult to handle correctly -- gprof won't be able to find the addresses in code constructed at runtime, so the runtime-only addresses should somehow be mapped to compile-time addresses. This is mostly moot for ndis since binary-only modules can't support profiling. Bruce