From owner-freebsd-bugs@FreeBSD.ORG Thu Jul 14 14:00:38 2005 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0861816A41C for ; Thu, 14 Jul 2005 14:00:38 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id CD27943D45 for ; Thu, 14 Jul 2005 14:00:37 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j6EE0bRQ009922 for ; Thu, 14 Jul 2005 14:00:37 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j6EE0bHs009921; Thu, 14 Jul 2005 14:00:37 GMT (envelope-from gnats) Date: Thu, 14 Jul 2005 14:00:37 GMT Message-Id: <200507141400.j6EE0bHs009921@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Bruce Evans Cc: 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 Reply-To: Bruce Evans List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jul 2005 14:00:38 -0000 The following reply was made to PR kern/83445; it has been noted by GNATS. From: Bruce Evans To: "Wojciech A. Koszek" Cc: FreeBSD-gnats-submit@FreeBSD.org, freebsd-bugs@FreeBSD.org Subject: Re: kern/83445: [PATCH] ndis won't compile with kernel profiling enabled Date: Thu, 14 Jul 2005 23:50:59 +1000 (EST) >> 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