*BSD News Article 6784


Return to BSD News archive

Path: sserve!manuel.anu.edu.au!munnari.oz.au!spool.mu.edu!caen!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!ljo
From: ljo@r2d2.eeap.cwru.edu (L. Jonas Olsson)
Newsgroups: comp.unix.bsd
Subject: [386BSD] gprof problems
Date: 20 Oct 1992 16:27:35 GMT
Organization: Case Western Reserve Univ. Cleveland, Ohio (USA)
Lines: 26
Message-ID: <1c1c1nINNjpg@usenet.INS.CWRU.Edu>
NNTP-Posting-Host: proteus.eeap.cwru.edu
Summary: gprof works partially
Keywords: profiling, gprof, gcc-2.2.2, gcrt0.o

I have been compiling the gprof from GNU binutils-1.9. Small mods are
necessary to the Makefile (-VSPRINTF-MISSING) and to gprof.c. The mods
in gprof.c are to eliminate some conflicting declarations and to skip
a test that fails for 386BSD, the test is: (around line 150)

    if ((hdr.high - hdr.low) != 4 * (nhist - 1))   
      abort ();

I get the left hand side to be 4 larger than the right hand side.
After skipping the abort()) the gprof seems to work so perhaps that
doesn't matter? I also had to change the name of the kernel and some
fields of FILE.
The resulting gprof works with the supplied gcc, but does not work
with the gcc-2.2.2 that I compiled. By putting in printfs in the
gcrt0.o (in file /usr/src/lib/csu.i386/gmon.c) I can see that the
routines monstart, moncontrol get run before the program, mcount gets
called, but _mcleanup and moncontrol do not get called after the program
and therefore no gmon.out is produced. Does anyone know how to fix this?

        Jonas
        ljo@po.cwru.edu

P.S. My gcc-2.2.2 and libg++-2.2 were derived from BSD386 patches at
bsdi.com. They work fine if you have an fpu and have no problems with
recursion in the libgcc.a routines.