views:

170

answers:

3

Hi,

I need to profile an application compiled with intel's compiler via VC++. I'm using VTune to profile my code.

My understanding is that in release mode I won't have the debug information that is necessary for the profiler to profile my code while in debug mode, the result of the profiling will not be pertinent.

What should I do ? Is it possible to add debug info in release mode? How can I set this mode?

If so, will I still benefit from all the optimization (inlining etc.)?

+2  A: 

You should certainly profile with optimisations enabled (compiler option /O3). /Zi is the Intel compiler switch (on Windows) to enabled debugging information.

Because of the optimisations, some functions may be missing from the debugging information due to inlining, but VTune will cope with that.

James Hopkin
+2  A: 

You can generate program database files (PDB) even in release target. Go to project properties, Linker/Debugging and check the option "Generate Program Database File". It is usually something like "$(TargetDir)$(TargetName).pdb". Now, it depends whether VTune knows how to interpret PDB files...

Cătălin Pitiș
+1  A: 

Function inlining and interprocess optimizations will make your profile hard to interpret. That is why it is a good idea to profile in both debug and release modes. If release mode only shows function foo using 80% of the program time, you can use the debug profile to see that function bar, which was inlined into foo, is using 60% of foo's time.

Zan Lynx