24.05.2014 Views

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

-p Option<br />

Syntax<br />

-p[g]<br />

Sets up the object file <strong>for</strong> profiling.<br />

-p prepares the program <strong>for</strong> profiling. When you execute the program, it produces<br />

a mon.out file with the profiling in<strong>for</strong>mation. You can then use the prof command<br />

to generate a run-time profile.<br />

-pg is like -p, but it produces more extensive statistics. Running a program<br />

compiled with -pg produces a gmon.out file, which you use with the gprof<br />

command to generate a run-time profile.<br />

Rules<br />

For profiling, the compiler produces monitoring code that counts the number of<br />

times each routine is called. The compiler replaces the startup routine of each<br />

subprogram with one that calls the monitor subroutine at the start. When the<br />

program ends normally, it writes the recorded in<strong>for</strong>mation to the mon.out or<br />

gmon.out file.<br />

Examples<br />

$ xlf95 -p needs_tuning.f<br />

$ a.out<br />

$ prof<br />

.<br />

.<br />

.<br />

profiling data<br />

.<br />

.<br />

.<br />

$ xlf95 -pg needs_tuning.f<br />

$ a.out<br />

$ gprof<br />

.<br />

.<br />

.<br />

detailed and verbose profiling data<br />

.<br />

.<br />

.<br />

Related In<strong>for</strong>mation<br />

For more in<strong>for</strong>mation on profiling and the prof and gprof commands, see the <strong>AIX</strong><br />

Commands Reference.<br />

118 <strong>XL</strong> <strong>Fortran</strong> <strong>Enterprise</strong> <strong>Edition</strong> <strong>for</strong> <strong>AIX</strong> : User’s <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!