From: "Wes Bauske" <wsb@paralleldata.com>
To: axp-list@redhat.com
Subject: Re: gprof on mixed gcc/g77 code
Date: Wed, 20 May 1998 13:44:57 -0500 [thread overview]
Message-ID: <356324A9.BA4DCCEF@paralleldata.com> (raw)
In-Reply-To: 199805201513.LAA18527@melange.gnu.org
Craig Burley wrote:
> >I've got binaries where I mix C/FORTRAN and am trying
> >to gprof them on a RH5.0 system. Strictly C programs
> >appear to profile fine after adding the '-pg' flag to the
> >compile/link. However, when I add this flag to g77,
> >it seems to convert it to '-p'. Not what I want to
> >have happen. Is this what it does?? If so, why??
>
> 1) What does "appear to profile fine" have to do with "seems to convert
> it to `-p'"?
>
The C program shows maybe 50 routines, with reasonable
looking cpu times.
> 2) Why isn't converting it to `-p' what you want to have happen?
>
From what I've used in the past, '-p' is for prof, '-pg' is for
gprof, and only gprof exists on my system.
> 3) Are you sure gcc isn't doing the same thing -- converting `-pg'
> to `-p'? (It does on my box.)
It may, but whatever gcc does, it seems to work. What g77
does doesn't. Only clues I have are the '-p' and the resulting
gprof output contains NO FORTRAN routine information.
It does show the C routines though.
Usually that means one didn't use the '-pg' flag on those
routines. So, since I know it was added, somehow it got
dropped. Maybe FORTRAN doesn't hook up correctly
to the profile counting routines?? Maybe FORTRAN
requires a MAIN routine to trigger the counting?? That
won't happen in my code. C sits on top of the FORTRAN
code to allocate memory and initialize things. If someone
could explain how FORTRAN does profiling, that might
give me a clue on what to do. I do see that the C runtime
routine seems to be switched for profiling according to
the gcc specs file, gcrt1.o vs crt1.o. By looking at the
specs, it appears '-p' and '-pg' do the same thing. So,
that leads back to how does FORTRAN hook up
profiling.
Wes
next prev parent reply other threads:[~1998-05-20 18:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-05-20 8:56 gprof on mixed gcc/g77 code Wes Bauske
1998-05-20 15:13 ` Craig Burley
1998-05-20 18:44 ` Wes Bauske [this message]
1998-05-20 19:03 ` Craig Burley
1998-05-20 21:40 ` Wes Bauske
1998-05-21 1:38 ` Craig Burley
1998-05-21 2:56 ` Wes Bauske
1998-05-21 3:55 ` Craig Burley
1998-05-21 4:32 ` Wes Bauske
1998-05-21 5:37 ` Maurice Hilarius
1998-05-21 15:26 ` Craig Burley
[not found] <199805201453.IAA23638@ellpspace.math.ualberta.ca>
1998-05-20 21:45 ` Wes Bauske
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox