Share via


From the Command Line

OverviewDetails

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

If you issue profile commands either from the command line or via a batch file, you can use the /EXC option in PREP Phase I.

If you want to exclude more than one object file or library with the /EXC option, you must preface each object file or library with the /EXC command.

For example, the following is a line from a sample batch file that excludes two object files, file1.obj and file2.obj, from profiling of program myprogram:

PREP /EXC file1.obj /EXC file2.obj myprogram.obj /FC %1

You can also use /EXCALL to exclude all object files and libraries and then use /INC to specify which object files and libraries to profile. For example, following is a line from a sample batch file that first excludes all object files and libraries and then includes file1.obj and file2.obj:

PREP /EXCALL /INC file1.obj /INC file2.obj /FC %1

You can even specify lines to profile in a source module. For example, if you only want to profile lines 32-96 (in source code) for a particular object file, you could issue

PREP /EXCALL /INC file1.cpp(32-96) /LC %1

Notice that you specify the lines directly from the source code file, which in this case has an extension of CPP.