[erlang-questions] fprof doubts

Raimo Niskanen raimo+erlang-questions@REDACTED
Wed Sep 3 11:32:23 CEST 2008


On Wed, Sep 03, 2008 at 01:55:31PM +0530, Geevarghese Philip wrote:
> Hi,
> 
> I used fprof to profile my code. I got an analysis report, but I am confused
> about a couple of things in the report:
> 
>    a) There is not much information about /my/ functions in the report : it
> is mostly about the underlying Erlang library functions. While I expect that
> most of the work is done by the libraries, my own functions are the gateways
> (so to speak) to these library functions, so they should appear in the
> profile with large ACC numbers against them, but this doesn't happen.
> Wherever my functions appear, they have very small numbers against them, and
> only in /two/ places do they occur with a % against them -- which indicates
> that the information is about calls to these functions.
> 
> b) I checked every instance in the report where the module name is "graphs"
> (my module). Everywhere the function reported is a fun. Why isn't the parent
> function reported at all?
> 
> c) In nearly every block of information, there is an entry named "undefined"
> with large numbers against it. What does this mean?

Can you give an example?
'undefined' is an unknown or undefined function.
E.g when you spawn a new process the caller of the
first function is 'undefined'.

> Could these be because I have not invoked/named my functions in some
> specified manner?

Yes, probably. How _did_ you trace?

	fprof:apply(graph, func, [arg])
or	
	fprof:trace(start),
	graph:func(arg),
	fprof:trace(stop),
or
	fprof:trace(start),
	%wait a while
	fprof:trace(stop),
on a running system hoping to catch something interesting,

or?

> 
> Thanks,
> Philip

> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions

-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB



More information about the erlang-questions mailing list