From: "Wes Bauske" <wsb@paralleldata.com>
To: axp-list@redhat.com
Subject: Re: gprof on mixed gcc/g77 code
Date: Wed, 20 May 1998 16:40:32 -0500 [thread overview]
Message-ID: <35634DD0.5BB0C0C6@paralleldata.com> (raw)
In-Reply-To: 199805201903.PAA19569@melange.gnu.org
Craig Burley wrote:
>
> >
> >>From what I've used in the past, '-p' is for prof, '-pg' is for
> >gprof, and only gprof exists on my system.
>
> You're talking about the gcc and g77 commands there. What gcc and
> g77 accept for options is not always directly related to what
> the internal programs cc1 and f771 accept. There are some similarities,
> but it's incorrect to assume that any option you pass to gcc or g77
> must necessarily be passed "unmolested" through to cc1 or f771
> (or cc1plus or cc1obj, etc.).
>
Wonderful. Another way to confuse a user.
> >> 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.
>
> Yet, that's not what you said earlier. You said the bug was that
> f771 was passed `-p', yet that's the same thing cc1 is passed,
> as you now verify. I just don't think that's the bug, and
> your original reasoning as to why it was seemed clearly flawed
> to me, and, being unaccompanied by complete information on the
> problems you were encountering, made it difficult to guess as
> to what might be wrong.
>
I'm only looking at symptoms. I make no claims that what
I see and what is happening are necessarily related. I
only pick symptoms based on my knowledge of how the code
works. '-p' in user land is not the same as '-pg'. It
appears the compilers are converting things to '-p' and
it looks like that is OK from what I see in the specs
file. So it's off my list of worries.
> >What g77
> >does doesn't. Only clues I have are the '-p' and the resulting
> >gprof output contains NO FORTRAN routine information.
>
> Perhaps you should submit a bug report? Both g77 and gcc come
> with extensive documentation, including on how and where to
> file bug reports.
I look at bug reports as a last option. With source, available,
that would be where I look first.
>
> >Maybe FORTRAN
> >requires a MAIN routine to trigger the counting??
>
> That might be. I don't know how profiling works in the gcc/g77
> environment (yet). You might try making your own C version of
> the f/runtime/libF77/main.c file, compiling it with -pg, and
> linking it ahead of libf2c.a on the command line, and see if
> that helps.
>
> So this could just become Yet Another Reason Not To Put main()
> In A Library. g77 already has a longish such list for libf2c
> improvements.
>
> >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.
>
> See if `g77 -v -pg ...' reports the same kind of switching to
> gcrt1.o and such as does `gcc -v -pg ...' on your system. If
> so, then I'd guess it's the main-not-compiled-with--pg problem
> suggested above.
The link shows gcrt1.o at the front and C profiles OK so
I think things are basically working. Question is what
is missing for FORTRAN. I'll do some more looking.
No obvious differences now. The xxx.o has _mcount in it,
and the link uses the correct gcrt1.o file. Maybe it's
a library issue?
Wes
next prev parent reply other threads:[~1998-05-20 21:33 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
1998-05-20 19:03 ` Craig Burley
1998-05-20 21:40 ` Wes Bauske [this message]
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