Author Topic: Profiling in Code::Blocks  (Read 11858 times)

Offline zacaj

  • Single posting newcomer
  • *
  • Posts: 5
Profiling in Code::Blocks
« on: March 21, 2010, 08:12:43 pm »
Im trying to profile my program.  Origionally, I would develop without an IDE, and could just at -pg to the compile line to profile it, and then run gprof.  In code::blocks, theres a -pg option in build options, so I enabled it and compiled my program, than ran gprof main.exe, but it says there are no symbols.  I also though there might be a plugin, but the plugin doesnt have a wiki page, and I cant find any links to download it.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Profiling in Code::Blocks
« Reply #1 on: March 21, 2010, 08:24:28 pm »
You should also use -g (generate debug-symbols) and make sure, you do not strip the symbols or optimize the code.

Offline zacaj

  • Single posting newcomer
  • *
  • Posts: 5
Re: Profiling in Code::Blocks
« Reply #2 on: March 21, 2010, 09:00:24 pm »
Thanks, removing optimization fixed it

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Profiling in Code::Blocks
« Reply #3 on: March 21, 2010, 09:50:40 pm »
Profiling unoptimized code is almost pointless.
I've no problems profiling -O2 compiled code!
(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!]