About Profiling Visual C++ Programs

Related Topics

You can use Quantify to profile the performance of native-compiled (unmanaged) Visual C++ programs, or .NET managed C++ programs.

For native (unmanaged) Visual C++ programs, Quantify makes a copy of the executable and associated program modules and uses Object Code Insertion (OCI) technology to instrument the files. During instrumentation, Quantify inserts code to collect counted data and timed data when you run the program. When you instrument in inclusive mode (the default), Quantify stores all instrumented files in its cache directory. You can identify a cached file by its name: it contains the encoded path of the original file and other information used by Quantify.

You can instrument and run native (unmanaged) code programs:

§          from Visual Studio, profile native-compiled code by using the Run Program dialog box instead of engaging the integration.

§    from the Quantify standalone interface.

§    from the command line.

For managed Visual C++ programs, click images\shortcut.gif

With Quantify's PowerTune options (click Settings in the Run Program dialog box), you can choose to measure the performance of functions at line or function level, or to time functions. You can also selectively instrument and profile native-compiled (unmanaged) modules.

Quantify uses debug line information to collect line-by-line performance data. If debug line information is not available for a module, Quantify times that module. Quantify also requires relocation data to collect data at line or function level. If relocation data is not available for an .exe, Quantify times the functions. For a DLL, only data for exported functions is recorded. Time for internal, non-exported functions is attributed to the calling exported functions.

Debug symbol data must be available for Quantify to identify a function. If symbol data is not available, Quantify labels the function UnnamedFunction@<offset> or, in the case of some timed COM functions, UnnamedTimedFunction@<offset>.

You can use Quantify's data analysis windows and tools to analyze program performance. For example, while a program is running, you can monitor the status of its threads, or pause and resume data recording. After you exit the program, you can filter out non-critical functions and focus on the bottlenecks in your code.

Notes:

§       The Time measurement type is not supported for selective instrumentation.

§      If you choose to time functions in an executable, the only data Quantify includes for the executable is the .exe's entry point. The entry point's function time includes the function time of the other functions in the .exe.

§      To ensure consistent results, instrument and run a program on the same machine.

(C) Copyright IBM Corporation 1993, 2009.