Search code examples
c++visual-studioprofilingintel-vtune

Which compilation option should be set for profiling?


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.)?


Solution

  • 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.