PREP

OverviewHow Do I

Feature Only in Professional and Enterprise Editions   Profiling is supported only in Visual C++ Professional and Enterprise Editions. For more information, see .

The PREP program runs twice during a normal profiling operation. In Phase I, it reads an executable (.EXE) file and then creates .PBI and .PBT files. In Phase II, it reads .PBT and .PBO files and then writes a new .PBT file for PLIST.

Syntax

PREP [options] [programname1] [programname2...programname8]

PREP reads the command line from left to right, so the rightmost options override contradictory options to the left. None of the options is case sensitive. You must prefix options with a forward slash (/) or a dash (–), and options must be separated by spaces.

Parameter Description
options See Options below.
programname1 Filename of primary program to profile (.DBG, .EXE, or .DLL). PROFILE adds the .EXE extension if no extension is given. This parameter must be specified for PREP Phase I, but not for Phase II.
programname2...
programname8
Additional programs to profile. These parameters can be specified for PREP Phase I only.

 An ‘X’ in the following Options table indicates that a PREP command-line option applies to a particular phase.

Options

PREP Phase I options can be issued either from the Profiler dialog box or from the command line. PREP Phase II options can be issued only at the command line.

Option I II Description
/AT X Collects attribution data for function timing and function counting. Function attribution reports which function called another function. See the /STACK switch later in this list.
/CB X Used with function timing, allows you to set the calibrated overhead of profiler calls in the event that your function timing calls have varied because of varied calibrated overhead values. The calibrated overhead is displayed in default (non-tab-delimited) PLIST output.
/EXC X Excludes a specified module from the profile. You can also exclude part of a module. For example, /EXC test.cpp(9-18).
/EXCALL X Excludes all modules from the profile (see Remarks). Used with /INC.
/FC X Selects function count profiling.
/FT X Selects function timing profiling. This option causes the profiler to generate count information as well. This is the default setting from the command line.
/FV X Selects function coverage profiling.
/INC X Includes in profile (see Remarks). Used in conjunction with /EXCALL.
/H[ELP] X X Provides a short summary of PREP options.
/IO filename X Merges an existing .PBO file (PROFILE output). Up to eight .PBO files can be merged at a time. The default extension is .PBO.
/IT filename X Merges an existing .PBT file (PREP Phase I output). Up to eight .PBT files can be merged at a time. You cannot merge .PBT files from different profiling methods. The default extension is .PBT.
/LC X Selects line count profiling.  May take a long time.
/LV X Selects line coverage profiling.
/M filename X Substitutes for the /IT, /IO, and /OT options.
/NOLOGO X X Suppresses the PREP copyright message.
/OI filename X Creates a .PBI file. The default extension is .PBI. If /OI is not specified, the output .PBI file is  programname1.PBI.
/OM X Creates a self-profiling file with an _XE or _LL extension for function timing, function counting, and function coverage. Without this option, the executable code is stored in the .PBI file. This option speeds up profiling.
/OT filename X X Specifies the output .PBT file. The default extension is .PBT. If /OT is not specified, the output .PBT file is programname1.PBT.
/SF function X Starts profiling with function. The function name must correspond to an entry in the .MAP file.
/STACK dpt X When using the /AT switch, you can also set the stack depth (dpt) to which functions will have their attribution data recorded.
/? X X Provides a short summary of PREP options.

Environment Variable

PREP Specifies default command-line options.

If a value for the PREP environment variable is not specified, the default options for PREP are:

/FT /OI filename /OT filename

where filename is set to the programname1 parameter value.

Remarks

The /INC and /EXC options specify individual library (.LIB), object (.OBJ), and application source (.C, .CPP, or .CXX) files. For line counting and line coverage, you can specify line numbers with source files as:

/EXCALL /INC test.cpp(3-41,50-67)

This example includes only lines 3 through 41 and lines 50 through 67 from the source file TEST.CPP. Note the absence of spaces in the source specification.

To specify all source lines in a particular module, specify the .OBJ file as:

/EXCALL /INC test.obj

or by using the source filename with zero line numbers like this:

/EXCALL /INC test.cpp(0-0)

The following statement profiles from line 50 to the end of the file:

/EXCALL /INC test.cpp(50-0)