4 ms·
About -arch i386, sorry my English is poor, what I mean is, gprof is not working even with binaries compiled with -arch i386. Thats still wrong: 247:~ Zach$
by Zev 17y ago
About -arch i386, sorry my English is poor, what I mean is, gprof is not working even with binaries compiled with -arch i386.
Thats still wrong:
247:~ Zach$ gcc -pg -arch i386 foo.c -o foo
247:~ Zach$ file foo
foo: Mach-O executable i386
247:~ Zach$ ./foo
hello
247:~ Zach$ gprof foo
call graph profile:
The sum of self and descendents is the major sort
for this listing.
function entries:
[rest of the output snipped, I can pastebin if you want.]
Though, you should really look at Shark (`man shark`, or Developer/Applications/Performance Tools/Shark.app), as an alternative to gprof.
However, you are right about Valgrind not working on Snow Leopard yet. I had thought it was working by now. Whoops, on my part. I edited my first post.
- antirez 17y agoYep with -arch i386 it appears to work but the profiling info it returns is all zeroed. There are the functions but mostly 0% everything. Don't know what's the problem. With 64 bit target it's worse than this (some error printed on screen at startup). Thanks for the hint about Shark, I'm playing with it and it seems cool indeed.
- yosh 17y ago> Yep with -arch i386 it appears to work but the profiling info it returns is all zeroed. That's the story of OS X since from when it was first released. For example, you'd have some functionality advertised as being in the system libraries (like, oh, certain important pthread functions) so they'd pass the configure checks, but they would be in reality just stub functions that mean nothing. So your program would subtly fail. That particular problem was fixed in 10.1, but it seems like every release has a few things like that: something from UNIX that looks like it's there, but actually amounts to no-ops. It's maddening.