Code Profiling Utilities Manual

HP Code Profiling Utilities Manual542684-003
10-1
10 Usage Considerations
This section summarizes usage considerations for the Code Profiling Utilities. Most of
these issues are discussed in other sections of this manual but are repeated here for
your convenience.
Compilation Issues
To support profile-guided optimization or code coverage analysis, you must recompile
existing program files or DLLs with the appropriate compiler and linker options,
described in Section 3, Building the Application. When a source file changes, the code
profiling information for that source file is incorrect until you recompile that source file
with the code profiling compiler options and repeat the later steps to generate code
profiling information.
An instrumented program file or DLL has the following characteristics:
Some code optimizations--for example, partial redundancy elimination, function
inlining, and loop unrolling--are limited or disabled.
Instrumented code can be much larger than noninstrumented code.
The maximum supported size for an object file has not increased. Thus, a very
large program file, compiled with instrumentation, could exceed the supported
object size.
The maximum supported data area for an object file has not increased.
Instrumenting a program file or DLL adds counters to the data area. The total size
of data for these counters is proportional to the size (number of functions and basic
blocks) in the instrumented code. Thus, a program file that already uses a large
data area could, when compiled with instrumentation, exceed the maximum
supported data area.
Dynamically unloading an instrumented DLL is not supported.
Code profiling is not available for source code that is textually included within the
body of a function. This limitation exists for all languages, but this style of source
inclusion is commonly used only in COBOL programs.
Compiling an application to produce an instrumented object file can take longer
than a conventional compilation.
Code coverage analysis and profile-guided optimization have different usage
scenarios. With code coverage, you are usually trying to determine what portions
of your code are being executed during testing; the goal is to execute as much of
the application as possible. With profile-guided optimization, your objective should
be to limit the execution of your application to only those portions that are most
likely to execute under a typical workload.\
Code coverage is supported for all three optimization levels (0, 1, and 2). Profile-
guided optimization is supported only for optimization level 2.