The COBOL Profiler [ Micro Focus COBOL System Reference, Volume 2 ] MPE/iX 5.0 Documentation
Micro Focus COBOL System Reference, Volume 2
The COBOL Profiler
The COBOL Profiler is a facility that enables you to obtain detailed
statistics on the run-time performance of a COBOL program.
When you submit a COBOL source program to the cob command (see the
chapter COBOL System Interface (cob) for details on the cob command), you
can specify the PROFILE Compiler directive. This causes the Compiler to
include code in your program to produce performance statistics relating
to each paragraph of the program each time you run the compiled program.
If your program contains no paragraphs, this report will not be produced.
The performance statistics produced using the PROFILE Compiler directive
for that run of the program are contained in a file called:
program-name.ipf
where program-name is the name of the program that was run. If an
executable file is produced, then program-name is the first entry point
namein the executable file.
These performance statistics are in compact form and first must be
converted to a readable format. This is done by running Profiler, which
is provided as part of your Micro Focus COBOL system.
Invoking the Profiler Program
To run Profiler, enter a command line of the form:
cobprof file-names directives
where:
file-names are one or more files containing compact Profiler
output. Profiler always searches for a file with the
extension.ipf; if you specify any other extension, it
is ignored. If you profile more than one program at
one time, Profiler output for all programs is
appended to the output file for the first program,
that is file-name+1.prf.
directives are one or more of the directives that control the
operation of Profiler. To specify a directive to
Profiler, you must precede it with a plus sign (+).
Each directive may be preceded by a plus sign, but
only one is required at the start of a list of
directives.
Directives must be separated by one or more spaces.
Where a Profiler directive takes a parameter, you can
enclose the parameter either in quotation marks or in
parentheses. If you use either of these, however,
you must escape them using the backslash character (
\).
Descriptions of the available Profiler directives are
contained in the appendix Directives for Profiler.
Profiler Output
When you run Profiler, the following banner is displayed:
* Micro Focus COBOL for UNIX Profiler Vv.r
* Copyright (c) 1993 Micro Focus Ltd.
* name-1
.
.
.
* name-n
where name is one of the names in file list in the command line.
For example, if you submit a program prog1 to the cob command with the
PROFILE directive, run the program, and then enter:
cobprof prog1 +LIST
the following output will be produced on the console:
* Micro Focus COBOL for UNIX Profiler Vn.n
* Copyright (c) 1993 Micro Focus Ltd.
* prog1
Total time: 172 milliseconds. Module called once.
%time time entries ms/entry paragraph
-----------------------------------------------------------------------------------------
64.53 111 21 5 TEST-ROUTINE
17.44 30 1 30 PARA1
16.28 28 15 2 NAME-ENTRY
1.74 3 1 3 END=SECTION
0.00 0 1 0 INITIAL (UNNAMED)
PARAGRAPH
The Profiler output gives the total execution time (in milliseconds) for
the program run and then breaks this down for each section and paragraph
in the program as follows:
Output Description
-------------------------------------------------------
%time total percentage of execution time spent
in the named section or paragraph
time total time (in milliseconds) spent in the
named section or paragraph
entries number of times the named section or
paragraph was entered
ms/entry average time (in milliseconds) per entry
to the section or paragraph
paragraph section or paragraph to which performance
statistics apply. The initial (unnamed)
paragraph listed is the initialization
code executed before the user part of the
program is entered.
The product of the ms/entry and the number of entries should equal the
total time spent in the section or paragraph; however, because all three
values are truncated, there may be a slight discrepancy.
MPE/iX 5.0 Documentation