Author Topic: profiling hell  (Read 4196 times)

Offline forestmaster

  • Single posting newcomer
  • *
  • Posts: 4
profiling hell
« on: March 15, 2010, 08:24:10 pm »
Hello to this great community
I've been using cb for quite a long time, but never tried to get into profiling. Today I've (desperately) spent my whole afternoon trying to get it working. I'm on windows, cd 8.02. I have my code compiled with -pg, gmon.out generated and read with gprof, but (as I've learnt it's common problem) no time is accumulated, just the number of function calls! I've tried to replace the supplied gprof with another one but things don't change. I'd like to know what exactly are the steps You go through in order to get some simple profiling! help! please!  :D

daniele

Offline forestmaster

  • Single posting newcomer
  • *
  • Posts: 4
Re: profiling hell
« Reply #1 on: March 20, 2010, 11:17:41 am »
I will twist my question:

did anyone actually got profiling to work? thanks in advance for any answer : )

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: profiling hell
« Reply #2 on: March 21, 2010, 11:39:07 am »
I think, I've successfully profiled an app, on windows and linux.

Please state your OS and gcc versions.
Does generating output from the command line works (read the gproff help for more info).
Please keep in mind that your project path is better to be English only with no spaces.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline forestmaster

  • Single posting newcomer
  • *
  • Posts: 4
Re: profiling hell
« Reply #3 on: March 21, 2010, 06:39:13 pm »
I'm on windows xp sp3. the gcc is the mingw32 that comes with codeblocks 8.02. I've used gprof (the version that comes with cb and a newer one) from the command line with output in the prompt and in a text file. is there any way beside the command line? The number of function calls is fine, just it doesn't give any timing information.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: profiling hell
« Reply #4 on: March 21, 2010, 07:01:35 pm »
This seems like a problem with your gprof...
Please do a search for "gprof no time accumulated", there are lots of hints....

You can try newer mingw or TDM release of gcc (gprof should be bundled with gcc or binutils, no sure about that)

Update: See here for explanation of the shortcomings of gprof: http://www.ibm.com/developerworks/library/l-gnuprof.html#listing6
« Last Edit: March 21, 2010, 07:04:50 pm by oBFusCATed »
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Max

  • Guest
Re: profiling hell
« Reply #5 on: March 21, 2010, 07:16:17 pm »
Hello,

This seems like a problem with your gprof...
Please do a search for "gprof no time accumulated", there are lots of hints....

You can try newer mingw or TDM release of gcc (gprof should be bundled with gcc or binutils, no sure about that)

Update: See here for explanation of the shortcomings of gprof: http://www.ibm.com/developerworks/library/l-gnuprof.html#listing6

I got the same problem in the past solved using gprof from binutils-2.17.50-20060824-1.tar.gz. The bug is in gprof. Becasue after that profiling session I no longer used gprof I don't know in which binutils the bug was fixed.

Try the latest binutils. If the problem persists try to extract gprof from 2.17.50 and overwrite (after making a backup copy) your gprof.exe in the bin directory of your MinGW installation.

Hope this helps

Max




Offline forestmaster

  • Single posting newcomer
  • *
  • Posts: 4
Re: profiling hell
« Reply #6 on: March 23, 2010, 10:21:41 am »
thanks to everybody for the answers: I had already made loads of googling and checked out different binutils; however, to my utter joy, I've finally fixed my issue.
my application was just running for a too short time, I let it compute 100 times the iterations it was doing and all worked nice.

thanks again

daniele