| Did you know ... | Search Documentation: |
| prolog_profile.pl -- Execution profiler |
This module provides a simple frontend on the execution profiler with a
hook to the GUI visualiser for profiling results defined in
library(swi/pce_profile).
profile(:Goal)
profile(:Goal, +Options)once(Goal) under the execution profiler. If the (xpce) GUI is
enabled this predicate is hooked by library(swi/pce_profile) and
results are presented in a gui that enables navigating the call tree
and jump to predicate implementations. Without the GUI, a simple
textual report is generated. Defined options are:
cpu or wall time. The default is CPU time.true, do not sample, but read the clock each time
execution moves to another node of the call tree. This gives
exact wall times, also for short running goals. For CPU time,
the thread's CPU time is read once per sample period (see
sample_rate(Rate)) and after each long interval, where the
thread may have been off the CPU. If auto, use exact
timing if reading the clock is cheap and, for CPU time, the
thread CPU clock is precise. This is typically not the case
in virtual machines. Otherwise use sampling. Default is
defined by the Prolog flag profile_exact, which defaults to
auto.profile_sample_rate,
which defaults to 200.true (all ports), false (call
port only) or classic (all with some errors).
Accomodates space/accuracy tradeoff building call tree.
Default is defined by the Prolog flag profile_ports,
which defaults to true.true (default false), show cumulative output in
a textual report.
show_profile(+Options)true (default false), show cumulative output in
a textual report.
profile_data(-Data) is detexact
is true, the number of times execution moved to another
node of the call tree.true, false or classiccpu or wall, the time that was profiled.exact(true)Relative is a term of the shape below that represents a caller or callee. Future versions are likely to use a dict instead.
node(PredicateIndicator, CycleID, Ticks, TicksSiblings,
Calls, Redos, Exits)
profile_procedure_data(?Pred, -Data:dict) is nondetnodes key.The following predicates are exported from this file while their implementation is defined in imported modules or non-module files loaded by this module.
profile(:Goal)
profile(:Goal, +Options)once(Goal) under the execution profiler. If the (xpce) GUI is
enabled this predicate is hooked by library(swi/pce_profile) and
results are presented in a gui that enables navigating the call tree
and jump to predicate implementations. Without the GUI, a simple
textual report is generated. Defined options are:
cpu or wall time. The default is CPU time.true, do not sample, but read the clock each time
execution moves to another node of the call tree. This gives
exact wall times, also for short running goals. For CPU time,
the thread's CPU time is read once per sample period (see
sample_rate(Rate)) and after each long interval, where the
thread may have been off the CPU. If auto, use exact
timing if reading the clock is cheap and, for CPU time, the
thread CPU clock is precise. This is typically not the case
in virtual machines. Otherwise use sampling. Default is
defined by the Prolog flag profile_exact, which defaults to
auto.profile_sample_rate,
which defaults to 200.true (all ports), false (call
port only) or classic (all with some errors).
Accomodates space/accuracy tradeoff building call tree.
Default is defined by the Prolog flag profile_ports,
which defaults to true.true (default false), show cumulative output in
a textual report.