Go to the first, previous, next, last section, table of contents.

Compiling programs for profiling

To make use of the cost centre profiling system all modules must be compiled and linked with the `-prof' option. Any `_scc_' constructs you've put in your source will spring to life.

Without a `-prof' option, your `_scc_'s are ignored; so you can compiled `_scc_'-laden code without changing it.

There are a few other profiling-related compilation options. Use them in addition to `-prof'. These do not have to be used consistently for all modules in a program.

`-auto':
GHC will automatically add `_scc_' constructs for all top-level, exported functions.
`-auto-all':
All top-level functions, exported or not, will be automatically `_scc_''d.
`-caf-all':
The costs of all CAFs in a module are usually attributed to one "big" CAF cost-centre. With this option, all CAFs get their own cost-centre. An "if all else fails" option...
`-ignore-scc':
Ignore any `_scc_' constructs, so a module which already has `_scc_'s can be compiled for profiling with the annotations ignored.
`-G<group>':
Specifies the <group> to be attached to all the cost-centres declared in the module. If no group is specified it defaults to the module name.

In addition to the `-prof' option your system might be setup to enable you to compile and link with the `-prof-details' option instead. This enables additional detailed counts to be reported with the `-P' RTS option.


Go to the first, previous, next, last section, table of contents.