> > Right - but LINUX_PROFILE was added to correct Linux specific oddities
> > with the time counter accumulation, whereas your patch is not Linux
> > specific at all. So I think a more representative symbol is required.
>
> Yeah, that was my problem with the patch too. The issue that it's
> addressing isn't Linux-specific in the least.
>
> Is there a way to detect via #if that profiling is enabled? I wouldn't
> expect a really portable answer, but maybe there's something that works
> for gcc?
You're right - I hadn't really looked beyond the problem that I was
trying to solve.
The technique should work for gprof on other platforms, but, as you
point out, LINUX_PROFILE is unique to Linux (no, I hadn't noticed that,
but it seems pretty obvious in retrospect).
I like Neil's idea of a using --enable-profiling configure flag. Every
time I need to profile, I have to go search the archives for 'gprof' -
it would be nice to see --enable-profiling when I configure --help.
-- Korry