From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 9365 invoked from network); 20 May 1998 18:38:07 -0000 Received: from smtp.paralleldata.com (HELO paralleldata.com) (38.153.145.2) by mail2.redhat.com with SMTP; 20 May 1998 18:38:07 -0000 Received: by paralleldata.com from localhost (router,SLMail V2.5); Wed, 20 May 1998 13:39:01 -0500 Received: by paralleldata.com from paralleldata.com (208.254.18.140::mail daemon; unverified,SLMail V2.5); Wed, 20 May 1998 13:39:00 -0500 Sender: "Wsb" Message-ID: <356324A9.BA4DCCEF@paralleldata.com> Date: Wed, 20 May 1998 13:44:57 -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: <199805201513.LAA18527@melange.gnu.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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