will contain something like this:</para>
<screen>
- Tue Apr 18 12:52 2000 Time and Allocation Profiling Report (Final)
+ Fri May 12 14:06 2000 Time and Allocation Profiling Report (Final)
Main +RTS -p -RTS
nfib Main 100.0 100.0
-COST CENTRE MODULE scc %time %alloc inner cafs
+ individual inherited
+COST CENTRE MODULE scc %time %alloc %time %alloc
-MAIN MAIN 0 0.0 0.0 0 1
- main Main 0 0.0 0.0 0 1
- CAF PrelHandle 3 0.0 0.0 0 3
- CAF PrelAddr 1 0.0 0.0 0 0
- CAF Main 6 0.0 0.0 1 0
- main Main 1 0.0 0.0 1 1
- nfib Main 242785 100.0 100.0 242784 4
+MAIN MAIN 0 0.0 0.0 100.0 100.0
+ main Main 0 0.0 0.0 0.0 0.0
+ CAF PrelHandle 3 0.0 0.0 0.0 0.0
+ CAF PrelAddr 1 0.0 0.0 0.0 0.0
+ CAF Main 6 0.0 0.0 100.0 100.0
+ main Main 1 0.0 0.0 100.0 100.0
+ nfib Main 242785 100.0 100.0 100.0 100.0
</screen>
the costly call to <function>nfib</function> came from
<function>main</function>.</para>
+ <para>The time and allocation incurred by a given part of the
+ program is displayed in two ways: “individual”, which
+ are the costs incurred by the code covered by this cost centre
+ stack alone, and “inherited”, which includes the costs
+ incurred by all the children of this node.</para>
+
<para>The usefulness of cost-centre stacks is better demonstrated
by modifying the example slightly:</para>
the new profiling results:</para>
<screen>
-COST CENTRE MODULE scc %time %alloc inner cafs
-
-MAIN MAIN 0 0.0 0.0 0 1
- main Main 0 0.0 0.0 0 1
- CAF PrelHandle 3 0.0 0.0 0 3
- CAF PrelAddr 1 0.0 0.0 0 0
- CAF Main 9 0.0 0.0 1 1
- main Main 1 0.0 0.0 2 2
- g Main 1 0.0 0.0 1 3
- nfib Main 465 0.0 0.2 464 0
- f Main 1 0.0 0.0 1 1
- nfib Main 242785 100.0 99.8 242784 1
+COST CENTRE MODULE scc %time %alloc %time %alloc
+
+MAIN MAIN 0 0.0 0.0 100.0 100.0
+ main Main 0 0.0 0.0 0.0 0.0
+ CAF PrelHandle 3 0.0 0.0 0.0 0.0
+ CAF PrelAddr 1 0.0 0.0 0.0 0.0
+ CAF Main 9 0.0 0.0 100.0 100.0
+ main Main 1 0.0 0.0 100.0 100.0
+ g Main 1 0.0 0.0 0.0 0.2
+ nfib Main 465 0.0 0.2 0.0 0.2
+ f Main 1 0.0 0.0 100.0 99.8
+ nfib Main 242785 100.0 99.8 100.0 99.8
</screen>
<para>Now although we had two calls to <function>nfib</function>
<variablelist>
<varlistentry>
- <term>scc</term>
+ <term>entries</term>
<listitem>
<para>The number of times this particular point in the call
graph was entered.</para>
</varlistentry>
<varlistentry>
- <term>%time</term>
+ <term>individual %time</term>
<listitem>
<para>The percentage of the total run time of the program
spent at this point in the call graph.</para>
</varlistentry>
<varlistentry>
- <term>%alloc</term>
+ <term>individual %alloc</term>
<listitem>
<para>The percentage of the total memory allocations
(excluding profiling overheads) of the program made by this
</varlistentry>
<varlistentry>
- <term>inner</term>
+ <term>inherited %time</term>
<listitem>
- <para>The number of times an inner call-graph context was
- entered from here (including recursive calls).</para>
+ <para>The percentage of the total run time of the program
+ spent below this point in the call graph.</para>
</listitem>
</varlistentry>
<varlistentry>
- <term>cafs</term>
+ <term>inherited %alloc</term>
<listitem>
- <para>The number of times a CAF context was entered from
- here. CAFs are described in <xref
- linkend="prof-rules">.</para>
+ <para>The percentage of the total memory allocations
+ (excluding profiling overheads) of the program made by this
+ call and all of its sub-calls.</para>
</listitem>
</varlistentry>
</variablelist>