Subject: Re: kernel profiling?
To: Toru Nishimura <nisimura@itc.aist-nara.ac.jp>
From: Simon Burge <simonb@netbsd.org>
List: port-mips
Date: 03/29/2000 11:59:22
Toru Nishimura wrote:
> > I was going to try profiling the same kernel on a 5000/240 and 5900-260
> > to try to get a handle on where to start looking for the fork/exec
> > slowness, but I'm having problems getting a profiled kernel built and
> > running. With the trailing patches I at least get a kernel built, but
> > it barely starts and get's an interesting error on the way through:
> >
> > [ ... kernel panics try to access address 0xf ... ]
> >
> > #define MCOUNT_ENTER s = _splhigh()
> > #define MCOUNT_EXIT _splx(s)
>
> If the profiler expects to disable and restore interrupts for short
> period of time, toggling MIPS_SR_INT_IE bit of status register is a
> handy way.
I'd still need to remember the status on the way in. Maybe something
like
#define MCOUNT_ENTER s = _disable_intr()
#define MCOUNT_EXIT if (s) { _enable_intr() }
where _disable_intr clears MIPS_SR_INT_IE and returns its status and
_enable_intr sets MIPS_SR_INT_IE would be quicker?
Simon.