Tick Profiler

The tick profiler works by interrupting the Prolog code every so often and checking at each point the code was.

The profiler must be able to retrace the state of the abstract machine at every moment. The major advantage of this approach is that it gives the actual amount of time being spent per procedure, or whether garbage collection dominates execution time. The major drawback is that tracking down the state of the abstract machine may take significant time, and in the worst case may slow down the whole execution.

The following procedures are available:

  • profinit

Initialise the data-structures for the profiler. Unnecessary for dynamic profiler.

  • profon

Start profiling.

  • profoff

Stop profiling.

Define:

1. CONTEXT_PC:

1. CONTEXT_BP:

Functions:

1. void Yap_InitLowProf(void):