Gprof under windows
I am using CodeBlocks/MinGW for windows and I am getting problems to run the profile tool (gprof). I have turned on the -pg switch in compiler option, then compile and open a ms-dos windows. Then write in the correct directory gprof main.c , get a "not in executable file fomat" error.
How can I get it to work? I'm looking at internet but no detailed help is provided for these steps .....
thx in advance
gprof expects the executable name as argument, not the source file name.
Hi, thanks, I have just get it to work. Only that it is not what I expected. With this feature I see how many time a instruction have been executed. Is there any way I can see how much time functions takes?
thx in advance
I'm not sure about the windows' version but you should have a column indicating the % of time spent in a function, as described here:
I get it to work, but in the listing the result for all funtions in the time column appear to 0%. any idea why?
How long is the runtime of your app?
I got this:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls ns/call ns/call name
100.00 0.03 0.03 990000 30.30 30.30 decodeDigit(char, int*)
0.00 0.03 0.00 99000 0.00 303.03 checkISBN(char*)
I have running my app for around one minute.
I use recursive functions, I dont know if that is a problem.....
oppppssssss!!!!, I have just discovered why it happen. My app is a multithread application. gprof does not support that kind of executables :((
Originally Posted by Kempelen