PROFILE is an execution profiling utility for use with Microsoft C 5.0
and QuickC 1.0. Because Profile understands CodeView debugging
records, execution profiling is done symbolically on a function by
function basis with the results displayed by module and function name.
Terms and Conditions
PROFILE is a SHAREWARE utility and although it can be evaluted for
free, a donation is expected from users who intend to keep PROFILE.
Users interested in PROFILE can register by sending $25.00 to:
PO Box 152
Milford, MA 01757
Registered users are entitled to limited support (better than no
support) and receive preferred status for upgrades along with the
option of purchasing PROFILE in source format for individual
PROFILE requires that programs be compiled with the /Zi option and
linked using the /CO option. PROFILE is executed by simply prefixing
the normal command line with PROFILE and the optional mode. If the
command line to execute your program is
myprog arg1 arg2 arg3
then to profile MYPROG is simply
profile option myprog arg1 arg2 arg3
where option is one of the options explained below.
PROFILE accepts options which specifies the operating mode to be
benchmark (-b), counting (-c) or timing (-t) or the type compiler.
Each of these options is explained below:
-b Benchmark Mode
When this option is selected, PROFILE goes thru all of the motions of
profiling but never sets any profiling breakpoints. This mode is
useful to get a baseline execution time for comparing the overhead of
the other two modes.
-c Counting Mode
The counting mode inserts a breakpoint at the entry point of evry
function in the target program and simply counts the number of times a
function is executed. If no option is specified, the counting mode
will be automaticaly selected.
-t Timing Mode
The timing mode is the full-blown execution analysis mode. In this
mode, profiling breakpoints are inserted at both the entry and exit
points of a function and the elapsed time is measured and recorded
between these two points.
-vm Microsoft C 5.0
This option selects operation with Microsoft C 5.0
-vq Microsoft QuickC 1.0
This option selects operation with Microsoft QuickC 1.0. This is the
An environment variable PROFILE can be used to force the selection of
a different default mode. A mode selected from the environment can
always be overridden on the command line as shown below.
C>set profile=-t -vm /* Default will be Timing Mode, MSC 5.0 */
C>profile -b -vq test /* Override the above options */
Strange things might happen if PROFILE is given the wrong compiler as
a command line option. It is also fprbidden to mixed MSC 5.0 and QC
1.0 modules due to different style CodeView debugging records.
All PROFILE output is written to STDERR and can be redirected using
the Microsoft ERROUT utility. The format of the results depends on
the operating mode and always includes the elapsed time for the
It is possible for timing errors to accumulate in the Timing mode. As
currently implemented, PROFILE uses a simple linear search of the
function list to determine which function caused the profile
breakpoint. Thus as the list of functions grows, so does the time
required to search for the interrupted function. Each breakpoint also
requires that the processor be placed in single step mode to skip the
breakpoint instruction and execute the original opcode. Also keep in
mind that the timing overhead of nested functions is accumulated in
the execution time of higher level functions. If you aren't
interested in timing the entire program, break the program up into
separately compiled modules and selectively compile only modules of
interest with the /Zi option.
PROFILE handles recursive functions by keeping track of the nesting
level and only measuring the elapsed time from the first entry to the
last exit point. There is no way to profile the execution times of
other that the outer most level of recursion.
The overall elasped time reported by PROFILE is less than the actual
execution time when the program is run directly from the command line.
This discrepancy is due the time required to load the program from the
disk is NOT included in the total elapsed time.
PROFILE is incompatible with most debuggers since it takes over
interrupt vectors 1 and 3. PROFILE also installs a link in the
interrupt 1Ch vector chain to count and process timer interrupts.
Best of luck and enjoy this utility. Please send comments,
suggestions and bug reports to the above address.