Code::Blocks Forums

User forums => Help => Topic started by: zacaj on March 21, 2010, 08:12:43 pm

Title: Profiling in Code::Blocks
Post by: zacaj 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.
Title: Re: Profiling in Code::Blocks
Post by: Jenna 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.
Title: Re: Profiling in Code::Blocks
Post by: zacaj on March 21, 2010, 09:00:24 pm
Thanks, removing optimization fixed it
Title: Re: Profiling in Code::Blocks
Post by: oBFusCATed on March 21, 2010, 09:50:40 pm
Profiling unoptimized code is almost pointless.
I've no problems profiling -O2 compiled code!