From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 24029 invoked from network); 20 May 1998 21:33:47 -0000 Received: from smtp.paralleldata.com (HELO paralleldata.com) (38.153.145.2) by mail2.redhat.com with SMTP; 20 May 1998 21:33:47 -0000 Received: by paralleldata.com from localhost (router,SLMail V2.5); Wed, 20 May 1998 16:34:43 -0500 Received: by paralleldata.com from paralleldata.com (208.254.18.124::mail daemon; unverified,SLMail V2.5); Wed, 20 May 1998 16:34:41 -0500 Sender: "Wsb" Message-ID: <35634DD0.5BB0C0C6@paralleldata.com> Date: Wed, 20 May 1998 16:40:32 -0500 From: "Wes Bauske" Organization: PDS Inc. X-Mailer: Mozilla 4.04 [en] (X11; U; Linux 2.0.31 i686) MIME-Version: 1.0 To: axp-list@redhat.com Subject: Re: gprof on mixed gcc/g77 code References: <199805201903.PAA19569@melange.gnu.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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