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

print_statistics

Prints the results of the profiling execution.

Description

This predicate prints the statistics about the predicate calls in the profiling session. It prints to the output stream a table which contains the number of ports executed for each predicate selected for profiling and visible to the debugger. Predicates executed with the debugger switched off, untraceable predicates and predicates that were skipped are not counted and they will not be shown in the table. The profiled goal is usually invoked using the debug/1 predicate.

The table contains a header line with the port names, one line with port statistics for each predicate and the last line with the statistics summary. The table is not sorted. Usually the output stream is redirected into a file where the table can be sorted using the Unix sort(1) command, e.g. to sort the table according to the number of calls, use

   sort -n +3 table
and similarly for other columns. The columns have the following meaning:

* CALL - The number of times the procedure was called

* EXIT - The number of times the procedure successfully exited. This number might be higher than the number of calls if the procedure is nondeterministic.

* TRY - The number of choice points created by the procedure. A choice point contains all information which is necessary to restore a previous state on backtracking. It is created when the system cannot decide which clause will match the current call, or if there are several (possibly) matching clauses.

* CUT - The number of times the procedure was cut. This corresponds to the number of times a choicepoint of the procedure was removed by a cut executed in its body or in one of its ancestors. This might not correspond to the number of times the cut was executed over this procedure, it counts only the cut invocations which were not redundant and which removed a choice point of the procedure.

* NEXT - The number of times the execution backtracked to an alternative clause of this procedure without exiting it before.

* FAIL - The number of times the procedure failed.

* DELAY - The number of times the procedure was delayed. This column is shown only in coroutining mode.

* WAKE - The number of times the procedure was woken after being delayed. A procedure might be woken more often than it was delayed in case that the system backtracks to a point where it was still delayed. This column is shown only in coroutining mode.

Fail Conditions

Fails if the statistics flag is set to off.

Resatisfiable

No.

Exceptions

Examples

   Success:
[eclipse]: set_flag(statistics, all).
yes.

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

no.
[eclipse]: print_statistics.
 PROCEDURE         #    MODULE    #CALL   #EXIT    #TRY    #CUT   #NEXT   #FAIL
 diff               /0   eclipse       1       0       1       0       3       1
 ops8               /1   eclipse       1       1       0       0       0       0
 d                  /3   eclipse      62      62      62      59       3       0
 !                  /0   eclipse_k    59      59       0       0       0       0
 integer            /1   eclipse_k     2       2       0       0       0       0
 is                 /2   eclipse_k     2       2       0       0       0       0
 fail               /0   eclipse_k     4       0       0       0       0       4
 divide10           /1   eclipse       1       1       0       0       0       0
 log10              /1   eclipse       1       1       0       0       0       0
 times10            /1   eclipse       1       1       0       0       0       0
 |TOTAL:     PROCEDURES: 10          134     129      63      59       6       5
Fail:
    set_flag(statistics, off), print_statistics.


See Also

compile / 1, dbgcomp / 0, debug / 1, get_flag / 3, set_flag / 3, print_modes / 0, set_statistics / 2