[Top][All Lists]

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

Re: [gprof] strange behavior, esp spontaneous

From: Ross Boylan
Subject: Re: [gprof] strange behavior, esp spontaneous
Date: Thu, 13 Jan 2005 19:47:17 -0800
User-agent: Mutt/1.5.6+20040907i

On Fri, Jan 14, 2005 at 02:26:57PM +1100, Ben Elliston wrote:
> Ross Boylan <address@hidden> writes:
> > On both, I see lots of <spontaneous> entries.  This puzzles me,
> > since the functions called "spontaneously" are actually called by
> > other functions in my program.  Some of them indicate very little
> > time (and no children) though I know most of the action happens
> > below them.
> Do you understand the meaning of the <spontaneous> entries?  
I think so, though perhaps not the implications.  The only thing I see
in the manual is that spontaneous appears when the caller can't be

I have been assuming that, for all calls within my code, it should be
possible to determine the caller, and that spontaneous should appear
only once at the top.

As I've said, I'm not sure how this interacts with calls out to lower
level, potentially non-instrumend code in system libraries.

My code has only a single thread, and I don't think any of the
low-level calls I'm making (mostly to math functions and memory
allocation) should start up any new threads.  I have no signal
handlers.  There's no forking.

None of the library functions I call do call-backs, which I imagine
might confuse things.  So the call stack should always look like
(higher level calls on top)

my code


my code
low-level libraries


my code
low-level libs
my code

> This is
> described in reasonable detail in the gprof manual.  You didn't say
> whether your program forks or not.
> Cheers, Ben

By the way, I think I've identified the source for gprof on OS X; it
appears to be *BSD in origin (Berkeley, not GNU license).  I'm not
sure what its relation is to the GNU gprof.  The OS X compilers are
basically GNU, with some Apple tweaks.

reply via email to

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