11.3.161 profile_data/4 [development]

Synopsis

profile_data(+Spec, ?Selection, ?Resolution, ?Data)

Data is profiling data collected from the predicates covered by the generalized predicate spec Spec.

Arguments

:Spec
pred_spec_tree

A predicate specification, or a list of such.

Selection
one of [calls,choice_points,instructions]

The kind of profiling data to be collected.

Resolution
one of [predicate,clause]

The level of resolution of the profiling data.

Data
list of pair

Will be instantiated to a list of key-value pairs.

Description

The Selection argument determines the kind of profiling data to be collected. If uninstantiated, the predicate will backtrack over its possible values, which are:

calls
All instances of entering a clause by a procedure call are counted. This is equivalent to counting all procedure calls that have not been determined to fail by indexing on the first argument.
choice_points
All instances of accessing a choicepoint are counted. This occurs, roughly, when there are more than one possibly matching clauses for a procedure call, when a disjunction is entered, as well as when profiled code is re-entered upon backtracking.
instructions
The (number of virtual machine instructions) executed in the selected piece of code, plus 2*(number of choiceopint accesses).

The Resolution argument determines the level of resolution of the profiling data to be collected. If uninstantiated, the predicate will backtrack over its possible values, which are:

predicate
Data is a list of terms Module:Name/Arity-Count, where Count is a sum of the corresponding counts per clause.
clause
Data is a list of terms Module:Name/Arity/ClauseNo-Count.

Backtracking

Can be used to backtrack over all profiling data for the given Spec.

See Also

Execution Profiling.


Send feedback on this subject.