{-# SCC "name" #-} <expression>
</programlisting>
- <para>where <literal>"name"</literal> is an aribrary string,
+ <para>where <literal>"name"</literal> is an arbitrary string,
that will become the name of your cost centre as it appears
in the profiling output, and
<literal><expression></literal> is any Haskell
<variablelist>
<varlistentry>
- <term><option>-prof</option>:</term>
- <indexterm><primary><option>-prof</option></primary></indexterm>
+ <term>
+ <option>-prof</option>:
+ <indexterm><primary><option>-prof</option></primary></indexterm>
+ </term>
<listitem>
<para> To make use of the profiling system
<emphasis>all</emphasis> modules must be compiled and linked
<variablelist>
<varlistentry>
- <term><option>-auto</option>:</term>
- <indexterm><primary><option>-auto</option></primary></indexterm>
- <indexterm><primary>cost centres</primary><secondary>automatically inserting</secondary></indexterm>
+ <term>
+ <option>-auto</option>:
+ <indexterm><primary><option>-auto</option></primary></indexterm>
+ <indexterm><primary>cost centres</primary><secondary>automatically inserting</secondary></indexterm>
+ </term>
<listitem>
<para> GHC will automatically add
<function>_scc_</function> constructs for all
</varlistentry>
<varlistentry>
- <term><option>-auto-all</option>:</term>
- <indexterm><primary><option>-auto-all</option></primary></indexterm>
+ <term>
+ <option>-auto-all</option>:
+ <indexterm><primary><option>-auto-all</option></primary></indexterm>
+ </term>
<listitem>
<para> <emphasis>All</emphasis> top-level functions,
exported or not, will be automatically
</varlistentry>
<varlistentry>
- <term><option>-caf-all</option>:</term>
- <indexterm><primary><option>-caf-all</option></primary></indexterm>
+ <term>
+ <option>-caf-all</option>:
+ <indexterm><primary><option>-caf-all</option></primary></indexterm>
+ </term>
<listitem>
<para> The costs of all CAFs in a module are usually
attributed to one “big” CAF cost-centre. With
</varlistentry>
<varlistentry>
- <term><option>-ignore-scc</option>:</term>
- <indexterm><primary><option>-ignore-scc</option></primary></indexterm>
+ <term>
+ <option>-ignore-scc</option>:
+ <indexterm><primary><option>-ignore-scc</option></primary></indexterm>
+ </term>
<listitem>
<para>Ignore any <function>_scc_</function>
constructs, so a module which already has
<variablelist>
<varlistentry>
- <term><option>-p</option> or <option>-P</option>:</term>
- <indexterm><primary><option>-p</option></primary></indexterm>
- <indexterm><primary><option>-P</option></primary></indexterm>
- <indexterm><primary>time profile</primary></indexterm>
+ <term>
+ <option>-p</option> or <option>-P</option>:
+ <indexterm><primary><option>-p</option></primary></indexterm>
+ <indexterm><primary><option>-P</option></primary></indexterm>
+ <indexterm><primary>time profile</primary></indexterm>
+ </term>
<listitem>
<para>The <option>-p</option> option produces a standard
<emphasis>time profile</emphasis> report. It is written
</varlistentry>
<varlistentry>
- <term><option>-px</option>:</term>
- <indexterm><primary><option>-px</option></primary></indexterm>
+ <term>
+ <option>-px</option>:
+ <indexterm><primary><option>-px</option></primary></indexterm>
+ </term>
<listitem>
<para>The <option>-px</option> option generates profiling
information in the XML format understood by our new
</varlistentry>
<varlistentry>
- <term><option>-xc</option></term>
- <indexterm><primary><option>-xc</option></primary><secondary>RTS
- option</secondary></indexterm>
+ <term>
+ <option>-xc</option>
+ <indexterm><primary><option>-xc</option></primary><secondary>RTS option</secondary></indexterm>
+ </term>
<listitem>
<para>This option makes use of the extra information
maintained by the cost-centre-stack profiler to provide
over time. This is useful for detecting the causes of
<firstterm>space leaks</firstterm>, when your program holds on to
more memory at run-time that it needs to. Space leaks lead to
- longer run-times due to heavy garbage collector ativity, and may
+ longer run-times due to heavy garbage collector activity, and may
even cause the program to run out of memory altogether.</para>
<para>To generate a heap profile from your program:</para>
<variablelist>
<varlistentry>
- <term><option>-hc</option></term>
- <indexterm><primary><option>-hc</option></primary><secondary>RTS
- option</secondary></indexterm>
+ <term>
+ <option>-hc</option>
+ <indexterm><primary><option>-hc</option></primary><secondary>RTS option</secondary></indexterm>
+ </term>
<listitem>
<para>Breaks down the graph by the cost-centre stack which
produced the data.</para>
</varlistentry>
<varlistentry>
- <term><option>-hm</option></term>
- <indexterm><primary><option>-hm</option></primary><secondary>RTS
- option</secondary></indexterm>
+ <term>
+ <option>-hm</option>
+ <indexterm><primary><option>-hm</option></primary><secondary>RTS option</secondary></indexterm>
+ </term>
<listitem>
<para>Break down the live heap by the module containing
the code which produced the data.</para>
</varlistentry>
<varlistentry>
- <term><option>-hd</option></term>
- <indexterm><primary><option>-hd</option></primary><secondary>RTS
- option</secondary></indexterm>
+ <term>
+ <option>-hd</option>
+ <indexterm><primary><option>-hd</option></primary><secondary>RTS option</secondary></indexterm>
+ </term>
<listitem>
<para>Breaks down the graph by <firstterm>closure
description</firstterm>. For actual data, the description
</varlistentry>
<varlistentry>
- <term><option>-hy</option></term>
- <indexterm><primary><option>-hy</option></primary><secondary>RTS
- option</secondary></indexterm>
+ <term>
+ <option>-hy</option>
+ <indexterm><primary><option>-hy</option></primary><secondary>RTS option</secondary></indexterm>
+ </term>
<listitem>
<para>Breaks down the graph by
<firstterm>type</firstterm>. For closures which have
</varlistentry>
<varlistentry>
- <term><option>-hr</option></term>
- <indexterm><primary><option>-hr</option></primary><secondary>RTS
- option</secondary></indexterm>
+ <term>
+ <option>-hr</option>
+ <indexterm><primary><option>-hr</option></primary><secondary>RTS option</secondary></indexterm>
+ </term>
<listitem>
<para>Break down the graph by <firstterm>retainer
set</firstterm>. Retainer profiling is described in more
</varlistentry>
<varlistentry>
- <term><option>-hb</option></term>
- <indexterm><primary><option>-hb</option></primary><secondary>RTS
- option</secondary></indexterm>
+ <term>
+ <option>-hb</option>
+ <indexterm><primary><option>-hb</option></primary><secondary>RTS option</secondary></indexterm>
+ </term>
<listitem>
<para>Break down the graph by
<firstterm>biography</firstterm>. Biographical profiling
<variablelist>
<varlistentry>
- <term><option>-hc</option><replaceable>name</replaceable>,...</term>
- <indexterm><primary><option>-hc</option></primary><secondary>RTS
- option</secondary></indexterm>
+ <term>
+ <option>-hc</option><replaceable>name</replaceable>,...
+ <indexterm><primary><option>-hc</option></primary><secondary>RTS option</secondary></indexterm>
+ </term>
<listitem>
<para>Restrict the profile to closures produced by
cost-centre stacks with one of the specified cost centres
</varlistentry>
<varlistentry>
- <term><option>-hC</option><replaceable>name</replaceable>,...</term>
- <indexterm><primary><option>-hC</option></primary><secondary>RTS
- option</secondary></indexterm>
+ <term>
+ <option>-hC</option><replaceable>name</replaceable>,...
+ <indexterm><primary><option>-hC</option></primary><secondary>RTS option</secondary></indexterm>
+ </term>
<listitem>
<para>Restrict the profile to closures produced by
cost-centre stacks with one of the specified cost centres
</varlistentry>
<varlistentry>
- <term><option>-hm</option><replaceable>module</replaceable>,...</term>
- <indexterm><primary><option>-hm</option></primary><secondary>RTS
- option</secondary></indexterm>
+ <term>
+ <option>-hm</option><replaceable>module</replaceable>,...
+ <indexterm><primary><option>-hm</option></primary><secondary>RTS option</secondary></indexterm>
+ </term>
<listitem>
<para>Restrict the profile to closures produced by the
specified modules.</para>
</varlistentry>
<varlistentry>
- <term><option>-hd</option><replaceable>desc</replaceable>,...</term>
- <indexterm><primary><option>-hd</option></primary><secondary>RTS
- option</secondary></indexterm>
+ <term>
+ <option>-hd</option><replaceable>desc</replaceable>,...
+ <indexterm><primary><option>-hd</option></primary><secondary>RTS option</secondary></indexterm>
+ </term>
<listitem>
<para>Restrict the profile to closures with the specified
description strings.</para>
</varlistentry>
<varlistentry>
- <term><option>-hy</option><replaceable>type</replaceable>,...</term>
- <indexterm><primary><option>-hy</option></primary><secondary>RTS
- option</secondary></indexterm>
+ <term>
+ <option>-hy</option><replaceable>type</replaceable>,...
+ <indexterm><primary><option>-hy</option></primary><secondary>RTS option</secondary></indexterm>
+ </term>
<listitem>
<para>Restrict the profile to closures with the specified
types.</para>
</varlistentry>
<varlistentry>
- <term><option>-hr</option><replaceable>cc</replaceable>,...</term>
- <indexterm><primary><option>-hr</option></primary><secondary>RTS
- option</secondary></indexterm>
+ <term>
+ <option>-hr</option><replaceable>cc</replaceable>,...
+ <indexterm><primary><option>-hr</option></primary><secondary>RTS option</secondary></indexterm>
+ </term>
<listitem>
<para>Restrict the profile to closures with retainer sets
containing cost-centre stacks with one of the specified
</varlistentry>
<varlistentry>
- <term><option>-hb</option><replaceable>bio</replaceable>,...</term>
- <indexterm><primary><option>-hb</option></primary><secondary>RTS
- option</secondary></indexterm>
+ <term>
+ <option>-hb</option><replaceable>bio</replaceable>,...
+ <indexterm><primary><option>-hb</option></primary><secondary>RTS option</secondary></indexterm>
+ </term>
<listitem>
<para>Restrict the profile to closures with one of the
specified biographies, where
<variablelist>
<varlistentry>
- <term><option>-i<replaceable>secs</replaceable></option>:</term>
- <indexterm><primary><option>-i</option></primary></indexterm>
+ <term>
+ <option>-i<replaceable>secs</replaceable></option>:
+ <indexterm><primary><option>-i</option></primary></indexterm>
+ </term>
<listitem>
<para>Set the profiling (sampling) interval to
<replaceable>secs</replaceable> seconds (the default is
</varlistentry>
<varlistentry>
- <term><option>-xt</option></term>
- <indexterm><primary><option>-xt</option></primary><secondary>RTS option</secondary>
- </indexterm>
+ <term>
+ <option>-xt</option>
+ <indexterm><primary><option>-xt</option></primary><secondary>RTS option</secondary></indexterm>
+ </term>
<listitem>
<para>Include the memory occupied by threads in a heap
profile. Each thread takes up a small area for its thread
<para>The definition of retainers is designed to reflect a
common cause of space leaks: a large structure is retained by
an unevaluated computation, and will be released once the
- compuation is forced. A good example is looking up a value in
+ computation is forced. A good example is looking up a value in
a finite map, where unless the lookup is forced in a timely
manner the unevaluated lookup will cause the whole mapping to
be retained. These kind of space leaks can often be