bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gprof: function count showing up for only some of my functions


From: Hans-Bernhard Broeker
Subject: Re: gprof: function count showing up for only some of my functions
Date: 31 Jul 2002 08:18:48 GMT

isaac <address@hidden> wrote:
> Here's something weird, I compiled my gcc program with -pg flags, ran
> gprof, and get output that seems reasonable.  However, in the
> calls-count column, some but not all of the numbers for my routines
> are missing.

Usually, that's a symptom of calls to those routines coming from other
routines which were not compiled with -pg.  So check where those calls
to your functions are supposed to come from.  'gprof -c' may help with
that: it inspects the actual machine code to find all subroutine
'call' instructions.

There are problems with some versions of GCC and binutils regarding
gprof --- gprof may fail to find the function and/or source line it's
currently in, because the marker sumbols are at unexpected positions
since gcc defaults to outputting function entry codes as RTL instead
of fixed target assembly sequences.

> I don't know if this has anything to do with it, but to get it to link
> with -pg, I had to include "-lm" twice in the link step;  otherwise
> the mysqlclient library complains that "floor" ( a std func in libm )
> is undefined.

You may try and emove the first of those occurences of -lm.  The
linker treats -l libraries in order, so only the last instance of any
library should usually be important.  Unless there's a potentially
serious design flaw, that is, like mutual dependencies of libraries
upon each other.

-- 
Hans-Bernhard Broeker (address@hidden)
Even if all the snow were burnt, ashes would remain.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]