Subject: Re: can't profile on Shark
To: Ignatios Souvatzis <is@netbsd.org>
From: Richard Earnshaw <rearnsha@arm.com>
List: port-arm
Date: 06/26/2003 15:59:14
rearnsha@arm.com 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...

cvs annotate shows that the ifndef line was added with revision 1.2:

revision 1.2
date: 1994/05/14 06:31:15;  author: cgd;  state: Exp;  lines: +3 -2
branches:  1.2.4;
rcsids.  also, avoid floating point when picking scale value.  doesn't
cost much, only done once.

Previously the code was "#ifndef hp300"; presumably that had the same 
problems as ARM is showing now.

R.