Microsoft Visual Studio

CodeXL

PreviousNext
CodeXL User Guide
Microsoft Visual Studio

Prior to Visual Studio 2013 Update 3, inline function information was not preserved in the PDB file. For CodeXL, to extract inline information from PDB file, the target application must be compiled with Visual Studio 2013 Update 3 or later. Use the below Visual Studio Configuration Properties if you want to enable inline function details in CodeXL CPU Profiler.

·         Set Configuration Properties > C/C++ > General > Debug Information Format to /Zi. Without this flag, PDB file with debug info will not be generated.

·         Add /Zo to Configuration Properties > C/C++ > Command Line > Additional Options. Without this flag, additional debug info related to inline functions will not be generated. /Zo only recognized by VS2013 update 3 or later. The /Zo option is enabled by default in Visual Studio 2015 when you specify debugging information with /Zi or /Z7, hence this step is optional for VS2015.

·         Enable Optimization by setting any one of: /O1, /O2, /Ox (Configuration Properties > C/C++ > Optimization > Optimization). Setting it to /Od will stop all optimizations including function inline.

·         Enable Function inlining by setting one of: /Ob1, /Ob2 (Configuration Properties > C/C++ > Optimization > Inline Function Expansion). Setting it to /Ob0 will stop function inline.

·         On Visual Studio 2015, enable “Whole Program Optimization” (Configuration Properties > C/C++ > Optimization > Whole Program Optimization). This setting is not required for VS2013.

·         Disable data elimination by setting /OPT:NOREF (Configuration Properties > Linker > Optimization > References). Setting it to /OPT:REF eliminates unreferenced data/function during linking time. In Release build, by default REF is enabled, due to which inline function info gets removed from PDB file.

·         Disable COMDAT folding by setting /OPT:NOICF (Configuration Properties > Linker > Optimization > Enable COMDAT Folding). Setting it to /OPT:ICF combines identical functions. In Release build, by default ICF is enabled, due to which identical inline functions info gets removed from PDB file.