cvs commit: src/sys/i386/isa prof_machdep.c src/sys/amd64/amd64 prof_machdep.c

Bruce Evans brde at optusnet.com.au
Thu Nov 29 14:43:57 PST 2007


On Fri, 30 Nov 2007, Peter Jeremy wrote:

> On Thu, Nov 29, 2007 at 01:15:03AM +0000, Bruce Evans wrote:
>>  Remove entry points for -finstrument functions since they are currently
>>  unused except to obfuscate disassemblies.  -mprofiler-epilogue is
>>  currently with gcc-4 (it does too little), but -finstrument-functions
>            ^  There is a word missing here and I'm not sure if it is
> 'unused' or 'broken'.  Could you please clarify.
>>  is broken in a different way (it does too much).

Oops, the word is `broken':
- gcc rearranged the initialization again, so -mprofiler-epilogue has no
   effect except for its old bug of emitting bogus ".globl .mexitcount"
   declarations.
- -mprofiler-epilogue is still supported and used in kernel mk files,
   but its documentation has been lost.

-finstrument-functions works better than in gcc-3.6, but is still
almost unusuable since it emits calls to the Cygnus profiling functions
for every inline function.  In gcc-3.6, it failed to inline anything.
Now it inlines things normally except for emitting the profiling calls
before and after the inlined calls.  So a 1-instruction inline function
for loading curthread, say, grows overhead of 2 function calls plus
parameter passing for these.  Profiling of inline functions is useful
as an option but not as a default.  It can be controlled per-function
using an attribute, but I don't know of any global option to turn it
off for just inline functions.

Bruce


More information about the cvs-src mailing list