Profiling Boost with gprof
Hello All, I'm trying to profile Boost Graph examples using gprof, but can't get any reasonable results. My system is Mac OS X 10.3.9 and gcc version 3.3. I compile programs with -pg option, but the profile does not seem to contain any useful information. It only shows "no time accumulated", or 100% for main. What am I doing wrong? Thanks for your help! Dave __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com
On Fri, 4 Nov 2005 13:09:20 -0800 (PST), Dave wrote
Hello All,
I'm trying to profile Boost Graph examples using gprof, but can't get any reasonable results. My system is Mac OS X 10.3.9 and gcc version 3.3. I compile programs with -pg option, but the profile does not seem to contain any useful information. It only shows "no time accumulated", or 100% for main. What am I doing wrong?
Does the program run for 1 second then quit? There's really not enough information here to help you. I suggest you use a simple program with a loop to see if you have the compilation settings right. Something like: int main() { for (int i; i < 1000000; i++;) { std::cout << i; } } You might need to adjust the count so that it runs for awhile. Then you can move up to boost stuff... HTH, Jeff
Dave wrote:
Hello All,
I'm trying to profile Boost Graph examples using gprof, but can't get any reasonable results. My system is Mac OS X 10.3.9 and gcc version 3.3. I compile programs with -pg option, but the profile does not seem to contain any useful information. It only shows "no time accumulated", or 100% for main. What am I doing wrong?
For the record, I never managed to get gprof produce reasonably-looking results for STL-intensive code. It usually reports that most time is spent in vector::push_back, or something like that. With -pg, compiler inserts extra code in every function, and for small once, that changes running time quite a bit. I suggest you try valgrind (http://valgrind.org), specifically, the "callgrind" binary. Using GUI frontend, called "KCachegrind" is also highly recommended. Note that for BGL, you *have* to build your binary with both -g and -O3 options (optimization + debug symbols). -03 makes order of magnitude difference. - Volodya
participants (3)
-
Dave
-
Jeff Garland
-
Vladimir Prus