Developer Guide and Reference


PGO API Support

The Profile-Guided Optimizations (PGO) API lets you control the generation of profile information during the instrumented execution phase of profile-guided optimizations.
A set of functions and an environment variable comprise the PGO API. The remaining topics in this section describe the associated functions and environment variables.
The compiler sets a
for the
pre-processor macro when you compile with
options, to instrument your code. Without instrumentation, the PGO API functions cannot provide PGO API support.
Normally, profile information is generated by an instrumented application when it terminates by calling the standard
To ensure that profile information is generated, the functions described in this section may be necessary or useful in the following situations:
  • The instrumented application exits using a non-standard exit routine.
  • The instrumented application is a non-terminating application:
    is never called.
  • The application requires control of when the profile information is generated.
You can use the PGO API functions in your application by including the
header file at the top of any source file where the functions may be used.
#include <pgouser.h>
You do not need to remove the PGO API functions from your code when you have completed the instrumentation step. Changes to the source code at this stage could inhibit obtaining profile data feedback on the routines that were modified. For the instrumentation step (using
option, where <aug> can be srcpos, globdata, or default), the definition for the
macro is automatically set, allowing instrumentation library routines to be used. For the production step (using
option), the definition for the
macro is removed, allowing profile data to be fed back.

The Profile IGS Environment Variables

The environment variable for PGO API is
. This environment variable may be used to initiate Interval Profile Dumping in an instrumented user application.
The environment variable
can be used to provide additional control over the internal profiling dumping behavior.
The environment variable,