11.3.163 print_profile/[0,1] [development]

Synopsis

print_profile

Prints the profiling data accumulated so far, to the current output stream, in a format similar to gprof(1).

print_profile(+Data)

Prints the profiling data Data, to the current output stream, in a format similar to gprof(1). Data should be of type list of profile_pair; see profile_data/1.

Arguments

Data
list of profile_pair

Description

The output is formatted into blocks of lines. There is one block per predicate with profiling data. A typical block looks like:

     ----------------------------------------------------------------
                                     6667/11582      user:extract_index_2/5
                                     4915/11582      user:safe_insns/5
           174446       21862       11582        user:safe_insns/5
                                   *10280/37221      user:safe_insn/1
                                     4915/11582      user:safe_insns/5
     ----------------------------------------------------------------

This block concerns user:safe_insns/5. We are told that 174446 virtual instructions were executed and 21862 choicepoints were accessed, and that it was called 11582 times. There are two callers: user:extract_index_2/5 and user:safe_insns/5 itself, which called user:safe_insns/5 6667 and 4915 times respectively. Finally user:safe_insns/5 accounts for 10280 out of the 37221 calls to user:safe_insn/1 and, as we already know, for 4915 out of the 11582 calls to itself. The asterisk in front 10280 tells us that for at least one of the 10280 calls, user:safe_insn/1 left a choicepoint behind, which could be a case of unwanted nondeterminacy; see The Determinacy Checker.

The variant print_profile/1 is useful e.g. if you want to somehow filter the execution profile computed by profile_data/1 before printing it.

See Also

Execution Profiling.


Send feedback on this subject.