[ ECLiPSe Prolog Environment built-in.|Group Index| Full Index]

get_statistics(+PredSpec, ?Counters)

Retrieve the statistics counters of the predicate PredSpec into the list Counters.

+PredSpec
Term of the form Atom/Integer.
?Counters
Variable or (partial) list.

Description

There is a set of 8 counters associated with every predicate. In profiling mode they count how often the execution passed the various ports of a predicate. This built-in creates a list of these counters and unifies it with Counters.

The order of the counters in the list is CALL, EXIT, TRY, CUT, NEXT, FAIL, DELAY, WAKE.

Fail Conditions

None

Resatisfiable

No

Exceptions

(4) Instantiation fault
PredSpec is not fully instantiated.
(5) Type error
PredSpec is not of the form Atom/Integer.
(60)
PredSpec is not a visible predicate.

Examples


Success:

    [eclipse]: set_flag(statistics, all).

    yes.
    [eclipse]: debug(true).
    Start debugging - leap mode
    Stop debugging.

    yes.
    [eclipse]: get_statistics(true/0, Counters).

    Counters = [1, 1, 0, 0, 0, 0, 0, 0]
    yes.

Error:
   get_statistics(P,[1,2,3,4,5,6,7,8]).      (Error 4)
   get_statistics(true,X).                   (Error 5)
   get_statistics(unknown/3,X).              (Error 60)


See Also

set_statistics / 2, print_statistics / 0, set_flag / 3, get_flag / 3