Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Jul 2005 14:00:37 GMT
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/83445: [PATCH] ndis won't compile with kernel profiling enabled
Message-ID:  <200507141400.j6EE0bHs009921@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/83445; it has been noted by GNATS.

From: Bruce Evans <bde@zeta.org.au>
To: "Wojciech A. Koszek" <dunstan@freebsd.czest.pl>
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200507141400.j6EE0bHs009921>