Subject: Re: mips kernel profiling?
To: None <port-mips@netbsd.org>
From: Jason R Thorpe <thorpej@zembu.com>
List: port-mips
Date: 04/20/2000 08:07:09
On Wed, Apr 19, 2000 at 07:07:01PM -0700, Ethan Solomita wrote:

 > > One thing that may be going wrong is that GCC is completely unaware of
 > > the call to mcount() which we're splicing in. So its adjustment of $gp
 > > (which is correct for main()) is all whacked for mcount().
 > > 
 > 	Now I'm doubly confused -- I'd thought that gcc was the entity that
 > adds the mcount call that is being spliced in, as a result of the -pg
 > option. And, BTW, the problem isn't with the adjustment but with the
 > addi sp,sp,-8 that is coming too late, and should be before (or in the
 > bdslot) the call to mcount.

Ethan is corrrect -- gcc is emitting the calls to mcount.  The profiling
support stuff is part of an OS's GCC configuration.  Specifically,
it's done with the `FUNCTION_PROFILER' macro.

See src/gnu/dist/gcc/config/mips/mips.h.

-- 
        -- Jason R. Thorpe <thorpej@zembu.com>