Refactoring and tidy up in the build system
[ghc-hetmet.git] / docs / users_guide / profiling.xml
index 4d6e835..00bbcdb 100644 (file)
@@ -249,8 +249,8 @@ MAIN                     MAIN             0    0.0   0.0    100.0 100.0
       <para>Cost centres are just program annotations.  When you say
       <option>-auto-all</option> to the compiler, it automatically
       inserts a cost centre annotation around every top-level function
-      in your program, but you are entirely free to add the cost
-      centre annotations yourself.</para>
+      not marked INLINE in your program, but you are entirely free to
+      add the cost centre annotations yourself.</para>
 
       <para>The syntax of a cost centre annotation is</para>
 
@@ -280,7 +280,12 @@ main = do let xs = {-# SCC "X" #-} [1..1000000]
 
       <para>which gives this heap profile when run:</para>
 
-      <imagedata fileref="prof_scc.png"/>
+      <!-- contentwidth/contentheight don't appear to have any effect
+           other than making the PS file generation work, rather than
+           falling over.  The result seems to be broken PS on the page
+           with the image. -->
+      <imagedata fileref="prof_scc" contentwidth="645px"
+      contentdepth="428px"/>
 
     </sect2>
 
@@ -396,7 +401,9 @@ x = nfib 25
        <listitem>
          <para> GHC will automatically add
           <function>&lowbar;scc&lowbar;</function> constructs for all
-          top-level, exported functions.</para>
+          top-level, exported functions not marked INLINE. If you
+          want a cost centre on an INLINE function, you have to add
+          it manually.</para>
        </listitem>
       </varlistentry>
       
@@ -406,9 +413,11 @@ x = nfib 25
           <indexterm><primary><option>-auto-all</option></primary></indexterm>
         </term>
        <listitem>
-         <para> <emphasis>All</emphasis> top-level functions,
-         exported or not, will be automatically
-         <function>&lowbar;scc&lowbar;</function>'d.</para>
+          <para> <emphasis>All</emphasis> top-level functions
+          not marked INLINE, exported or not, will be automatically
+          <function>&lowbar;scc&lowbar;</function>'d.
+          The functions marked INLINE must be given a cost centre
+          manually.</para>
        </listitem>
       </varlistentry>
 
@@ -453,9 +462,10 @@ x = nfib 25
     <variablelist>
       <varlistentry>
        <term>
-          <option>-p</option> or <option>-P</option>:
+          <option>-p</option> or <option>-P</option> or <option>-pa</option>:
           <indexterm><primary><option>-p</option></primary></indexterm>
           <indexterm><primary><option>-P</option></primary></indexterm>
+          <indexterm><primary><option>-pa</option></primary></indexterm>
           <indexterm><primary>time profile</primary></indexterm>
         </term>
        <listitem>
@@ -467,9 +477,24 @@ x = nfib 25
          <para>The <option>-P</option> option produces a more
           detailed report containing the actual time and allocation
           data as well.  (Not used much.)</para>
+
+          <para>The <option>-pa</option> option produces the most detailed
+          report containing all cost centres in addition to the actual time
+          and allocation data.</para>
        </listitem>
       </varlistentry>
 
+     <varlistentry>
+       <term><option>-V<replaceable>secs</replaceable></option>
+       <indexterm><primary><option>-V</option></primary><secondary>RTS
+       option</secondary></indexterm></term>
+       <listitem>
+         <para>Sets the interval that the RTS clock ticks at, which is
+         also the sampling interval of the time and allocation profile.
+         The default is 0.02&nbsp;second.</para>
+       </listitem>
+     </varlistentry>
+
       <varlistentry>
        <term>
           <option>-xc</option>
@@ -735,7 +760,8 @@ x = nfib 25
             0.1&nbsp;second).  Fractions are allowed: for example
             <option>-i0.2</option> will get 5 samples per second.
             This only affects heap profiling; time profiles are always
-            sampled on a 1/50 second frequency.</para>
+            sampled with the frequency of the RTS clock. See
+            <xref linkend="prof-time-options"/> for changing that.</para>
          </listitem>
        </varlistentry>
 
@@ -1758,7 +1784,6 @@ Total bytes copied during GC: 190096
 
 <!-- Emacs stuff:
      ;;; Local Variables: ***
-     ;;; mode: xml ***
      ;;; sgml-parent-document: ("users_guide.xml" "book" "chapter") ***
      ;;; End: ***
  -->