5.5. Graphical time/allocation profile
Prev | Chapter 5. Profiling | Next

## 5.5. Graphical time/allocation profile

You can view the time and allocation profiling graph of your program graphically, using ghcprof. This is a new tool with GHC 4.08, and will eventually be the de-facto standard way of viewing GHC profiles[7]

To run ghcprof, you need uDraw(Graph)™ installed, which can be obtained from uDraw(Graph). Install one of the binary distributions, and set your `UDG_HOME` environment variable to point to the installation directory.

ghcprof uses an XML-based profiling log format, and you therefore need to run your program with a different option: `-px`. The file generated is still called `<prog>.prof`. To see the profile, run ghcprof like this:

    $ ghcprof <prog>.prof

which should pop up a window showing the call-graph of your program in glorious detail. More information on using ghcprof can be found at The Cost-Centre Stack Profiling Tool for GHC.

[7] Actually this isn't true any more, we are working on a new tool for displaying heap profiles using Gtk+HS, so ghcprof may go away at some point in the future.

Prev | Up | Next
5.4. Profiling memory usage | Home | 5.6. hp2ps––heap profile to PostScript