-p

Category

Optimization and tuning

@PROCESS

None.

Purpose

Prepares the object files produced by the compiler for profiling.

The compiler produces monitoring code that counts the number of times each routine is called. The compiler inserts a call to the monitor subroutine at the start of each subprogram.

Syntax

Read syntax diagramSkip visual syntax diagram
>>- -p--+---+--------------------------------------------------><
        '-g-'   

Defaults

Not applicable.

Usage

When you run a program compiled with -p or -pg and it ends normally, it produces a gmon.out file with the profiling information. You can then use the gprof command to generate a runtime profile.

Examples

$ xlf95 -pg needs_tuning.f
$ a.out
$ gprof
 .
 .
 .

detailed and verbose profiling data
 .
 .
 .

Related information