ILE COBOL Programmer's Guide


Collecting Profiling Data

Once profiling code has been added to a module, it must be placed in a program object or service program object in order for profiling data to be collected. The profiling data can be applied to a program object with the CHGPGM CL command and applied to a service program with the CHGSRVPGM CL command. To apply all the profiling data to a program object or service program specify the PRFDTA parameter with the Apply All (*APYALL) value. To only apply the profiling data that reorders code within procedures specify the value *APYBLKORD. To only apply the profiling data that reorders procedures specify *APYPRCORD.

Profiling data is collected by specifying the Start Program Profiling (STRPGMPRF) CL command. All the program objects and service programs that are active on the system and that include profiling code will generate profiling data.

Once enough profiling data has been collected, the End Program Profiling (ENDPGMPRF) CL command should be entered.

Program profiling data can be removed from the modules within a program object or service program with the *CLR value of the PRFDTA parameter on the CHGPGM and CHGSRVPGM CL commands.

Enabling a module to collect profiling data causes additional code to be generated in the module object. This code is used to collect data on the number of times basic blocks within procedures have been executed, as well as the number of times procedures have been called. To enable collection of profiling data, modules must be compiled at an optimization level of 30 (*FULL), or greater.

Data that is collected for the basic blocks within procedures is used by the ILE optimizing translator to rearrange these blocks for better cache utilization. Block information is applied to procedures within a module; it does not span module boundaries.

The binder uses the procedure call data in order to package procedures that often call each other together for better page utilization. In other words, it is possible to have PROCA in module A packaged next to PROCB in module B (if PROCA makes many calls to PROCB) in the profiled program. Procedure call data is applied at the program level; it does span module boundaries.

Profiling data can only be collected if the current target release is specified. In order for an ILE program or service program to be profiled, the program must have a target release of V4R2M0, or later. This also means that a program enabled to collect profiling data or a profiled program cannot be saved or restored to a release earlier than V4R2M0.

For more information about the PRFDTA parameter, refer to page PRFDTA Parameter.

Note:
The potential for inaccuracies in the collected data exists if profile data is collected for programs running in a parallel environment, for example, a multi-threaded process.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]