Re: can't profile on Shark

"Valeriy E. Ushakov" <[email protected]>
Newsgroups gmane.os.netbsd.ports.arm,gmane.os.netbsd.ports.sh3
Message-ID <[email protected]>
On Thu, Jun 26, 2003 at 15:59:14 +0100, Richard Earnshaw wrote:

> [email protected] said:
> > I don't know why the gmon module needs to do FP arithmetic, I though
> > it  just wrote out the raw tables. 
> 
> Hmm, this is from libc/gmon/gmon.c:
> 
> #ifndef notdef
>                 s_scale = ((float)p->kcountsize / o ) * SCALE_1_TO_1;
> #else /* avoid floating point */
>                 u_long quot = o / p->kcountsize;
>                 
>                 if (quot >= 0x10000)
>                         s_scale = 1;
>                 else if (quot >= 0x100)
>                         s_scale = 0x10000 / quot;
>                 else if (o >= 0x800000)
>                         s_scale = 0x1000000 / (o / (p->kcountsize >> 8));
>                 else
>                         s_scale = 0x1000000 / ((o << 8) / p->kcountsize);
> #endif
> 
> Anyone know why that is "#ifndef notdef" rather than "#ifdef notdef"?  
> Seems backwards to me...


On Thu, Jun 26, 2003 at 18:53:08 -0700, Jason Thorpe wrote:

> On Thursday, June 26, 2003, at 07:59  AM, Richard Earnshaw wrote:
> 
> >Anyone know why that is "#ifndef notdef" rather than "#ifdef notdef"?
> >Seems backwards to me...
> 
> Eek, yes, it's certainly a mistake.

SH3 seems to suffer from the same lossage:

    _fixunssfsi.o(.text+0x4c): undefined reference to `__gesf2'

And that ifndef in gmon.c is still not fixed.  Changing
s/ifndef/ifdef/ makes the program link and produce the gmon.out.

I'd like to commit that change.

SY, Uwe
-- 
[email protected]                         |       Zu Grunde kommen
http://www.ptc.spbu.ru/~uwe/            |       Ist zu Grunde gehen
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.