This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: how to profile gfortran code?
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: sgk at troutmask dot apl dot washington dot edu (Steve Kargl)
- Cc: howarth at bromo dot msbb dot uc dot edu (Jack Howarth), fortran at gcc dot gnu dot org
- Date: Mon, 28 Nov 2005 13:01:26 -0500 (EST)
- Subject: Re: how to profile gfortran code?
>
> On Mon, Nov 28, 2005 at 10:18:24AM -0500, Jack Howarth wrote:
> > Can anyone describe the procedure for profiling gfortran code
> > using the typical gnu devtools? While I could run Shark on MacOS X
> > I was going to first try with the normal approach to profiling which
> > subroutines in xplor-nih are most used in the gfortran build compared
> > to the xlf build. Of course, on Darwin we don't have the option of
> > using valgrind. Thanks in advance for any pointers on how to get
> > started with this.
> > Jack
>
> Does darwin have gprof? If so, you can add tha -pg flag
> to your gfortran flags.
>
> gfortran -pg -O -o z z.f90
> ./z
> gprof -l -b z gmon.prof | more
gprof is now adays is not that good of profiler at all as it
only tells you what functions are the heavy setters and not
where in the function or even if an inlined function is the issue.
-- Pinski