New syntax for GADT-style record declarations, and associated refactoring
[ghc-hetmet.git] / docs / users_guide / profiling.xml
index 9a1f289..adb7a33 100644 (file)
@@ -33,7 +33,9 @@
     <listitem>
       <para> Run your program with one of the profiling options, eg.
       <literal>+RTS -p -RTS</literal>.  This generates a file of
-      profiling information.</para>
+      profiling information.  Note that multi-processor execution
+      (e.g. <literal>+RTS -N2</literal>) is not supported while
+      profiling.</para>
       <indexterm><primary><option>-p</option></primary><secondary>RTS
       option</secondary></indexterm>
     </listitem>
@@ -264,6 +266,22 @@ MAIN                     MAIN             0    0.0   0.0    100.0 100.0
       far to the right as possible when parsing. (SCC stands for "Set
       Cost Centre").</para>
 
+      <para>Here is an example of a program with a couple of SCCs:</para>
+
+<programlisting>
+main :: IO ()
+main = do let xs = {-# SCC "X" #-} [1..1000000]
+          let ys = {-# SCC "Y" #-} [1..2000000]
+          print $ last xs
+          print $ last $ init xs
+          print $ last ys
+          print $ last $ init ys
+</programlisting>
+
+      <para>which gives this heap profile when run:</para>
+
+      <imagedata fileref="prof_scc"/>
+
     </sect2>
 
     <sect2 id="prof-rules">
@@ -1256,7 +1274,7 @@ to re-read its input file:
     <indexterm><primary>hpc</primary></indexterm>
 
     <para>
-      Code coverage tools allow a programer to determine what parts of
+      Code coverage tools allow a programmer to determine what parts of
       their code have been actually executed, and which parts have
       never actually been invoked.  GHC has an option for generating
       instrumented code that records code coverage as part of the