Date: Thu, 14 Jul 2005 23:50:59 +1000 (EST) From: Bruce Evans <bde@zeta.org.au> To: "Wojciech A. Koszek" <dunstan@freebsd.czest.pl> Cc: freebsd-bugs@FreeBSD.org, FreeBSD-gnats-submit@FreeBSD.org Subject: Re: kern/83445: [PATCH] ndis won't compile with kernel profiling enabled Message-ID: <20050714232017.F2094@epsplex.bde.org> In-Reply-To: <200507141156.j6EBuIhU031586@freebsd.czest.pl> References: <200507141156.j6EBuIhU031586@freebsd.czest.pl>
next in thread | previous in thread | raw e-mail | index | archive | help
>> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050714232017.F2094>