Eventually I discovered that the -pg option simply does not work with gcc on Intel Macs. (Why on earth doesn't the man page for gprof say something about this?)
Apple instead recommends that one use Shark or Saturn, both provided when you install the CHUD Tools (Computer Hardware Understanding Developer Tools)
So I did that. I downloaded a copy of the CHUD Tools (and as far as I can remember, I did it by searching on ADC for them, and got a copy of chud.dmg). I was a little surprised by the file times (they said something like 2007) but I pressed on, eager to start seeing some profiler output, especially since all of my searches to read about Shark sounded very positive about it.
And then when I attempted to compile with -finstrument-functions, so I could use Saturn in the same way that I might have used gprof, I got a link error:
Undefined symbols:
"___cyg_profile_func_exit", referenced from:
_consolemsg in larceny.o
_consolemsg in larceny.o
...
"___cyg_profile_func_enter", referenced from:
_panic_abort in larceny.o
_panic_exit in larceny.o
...
I abandoned further attempts to use Saturn pretty quickly.
So then I tried Shark. And that was, if anything, worse. Because every time I tried to stop a profiling session, it would restart my machine!
Eventually I discovered (though not easily) this discussion post.
Hmm. CHUD 4.4.4 panics. I look at my version. Yep, its 4.4.4.
So I did a more careful search for a more recent version of CHUD (4.6.1, specifically). We'll see how that works out for me in a bit.
(I'm mostly posting this so that other people who run into a similar problem know that they need to get a newer version of CHUD. Maybe later I'll try to retrace my steps that led me to thinking that CHUD 4.4.4 was the version I needed to use...)
- I do not know who linked to it, but some page (that I believe was on the Apple site) sent me to the follow ftp link, which has the version of CHUD that is incompatible with newer versions of OS X: ftp://ftp.apple.com/developer/Tool_Chest/Testing_-_Debugging/Performance_tools/CHUD_4.4.4.dmg
No comments:
Post a Comment