[erlang-questions] fprof.dump: what is CP?
Mon Sep 1 09:26:39 CEST 2008
On Sat, Aug 30, 2008 at 11:47:05PM +0100, Joel Reymont wrote:
> What does CP stand for in the following fprof dump?
> Is it Swedish for caller function or is it an abbreviation for
> something else?
It is the Continuation Pointer, that is the return
address - where execution should contiue when a function
When a function does a tail recursive call the CP does
not change. If the call is non-tail recursive (deep,
nested, ...), the CP is first pushed on the stack
and then set to the current (next) Program
Counter before the call, so CP changes.
It is chiefly this information Fprof uses to
deduce the true call stack from the execution trace.
> Thanks, Joel
> erlang-questions mailing list
/ Raimo Niskanen, Erlang/OTP, Ericsson AB
More information about the erlang-questions