PROFILE

HomeOverviewHow Do I

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

PROFILE profiles an application and creates a .PBO file of the results. Use PROFILE after creating a .PBI file with PREP.

Syntax

PROFILE [options] programname [programargs]

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

If you do not specify a .PBO filename on the command line, PROFILE uses the base name of the .PBI file with a .PBO extension. If you do not specify a .PBI or a .PBO file, PROFILE uses the base name of programname with the .PBI and .PBO extensions.

Parameter Description
options See Options below.
programname Filename of the program to profile. PROFILE adds the .EXE extension if no extension is given. See Remarks.
programargs Optional command-line arguments for programname. See Remarks.

Options

Option Description
/A Appends any redirected error messages to an existing file. If the /E command-line option is used without the /A option, the file is overwritten. This option is valid only with the /E option.
/E filename Sends profiler error messages to filename.
/H[ELP] Provides a short summary of PROFILE options.
/I filename Specifies a .PBI file to be read. This file is created by PREP.
/NOLOGO Suppresses the PROFILE copyright message.
/O filename Specifies a .PBO file to be created. Use the PREP utility to merge with other .PBO files, or to create a .PBT file for use with PLIST.
/X Returns the exit code of the program being profiled.
/? Provides a short summary of PROFILE options.

Remarks

You must specify the filename of the program to profile on the PROFILE command line. PROFILE assumes the .EXE extension if no extension is given.

You can follow the program name with command-line arguments; these arguments are passed to the profiled program unchanged.

If you are profiling code in a dynamic-link library (.DLL) file, give the name of an .EXE file that calls it. For example, if you want to profile SAMPLE.DLL, which is called by CALLER.EXE, you can type:

PROFILE CALLER.EXE

assuming that CALLER.PBI has SAMPLE.DLL selected for profiling. For more information, see Profile Dynamic-Link Libraries.

Environment Variable

PROFILE Specifies default command-line options.

If the PROFILE environment variable is not specified, there are no other default options.