Code Profiling Utilities Manual

HP Code Profiling Utilities Manual542684-003
1-1
1
Introduction to the Code Profiling
Utilities
This manual describes the Code Profiling Utilities. It addresses application
developers who create application components for NonStop servers, and who want to
do one or both of the following:
Optimize their applications using a technique called profile-guided optimization.
Profile-guided optimization is supported for C/C++ and pTAL applications.
Evaluate the code coverage provided by test cases or to understand what parts of
an application are used, or most heavily used, under a representative workload.
Code coverage is supported for C/C++, pTAL, and COBOL applications.
The Code Profiling Utilities consist of two utilities: the Profile Merge Utility (profmrg)
and the Code Cover Utility (codecov).
Features of the Utilities
The code generator used by COBOL, pTAL, and C/C++ compilers on NS-series
servers has the capability to create instrumented object files. Such object files contain
extra code that records which functions and statements are executed, and how many
times each is executed. You can use this information in either of two ways:
You can input the code profiling information to the compiler to produce an
optimized object file.
You can input the code profiling information to the Code Coverage Utility, codecov,
to produce a report indicating what code in a program file or DLL was actually
executed during one or more invocations. The code coverage report is a set of
HTML files that you can view with any standard HTML browser.
No source code changes are needed to instrument an application. The only required
changes are in the commands used to compile and link the application. If you choose
to instrument only a subset of your application, you specify code-profiling compiler
options for only that subset of your source files.
Compilation can occur on the Guardian, NonStop Open System Services (OSS), or
Windows platform. Execution must occur on either the Guardian or the OSS platform.
The Profile Merge Utility (profmrg) is used to assemble the code profiling data; it
runs on both the Windows platform and the NonStop server (Guardian and OSS). The
Note. The Code Profiling Utilities are intended for data generation and collection in a test
environment only. The use of instrumented code is not recommended for production
environments. Applications compiled with code profiling instrumentation will experience greatly
reduced performance.