5.7. Using “ticky-ticky” profiling (for implementors)

(ToDo: document properly.)

It is possible to compile Glasgow Haskell programs so that
they will count lots and lots of interesting things, e.g., number
of updates, number of data constructors entered, etc., etc. We
call this “ticky-ticky”
profiling, because that's the sound a Sun4
makes when it is running up all those counters
(slowly).

Ticky-ticky profiling is mainly intended for implementors;
it is quite separate from the main “cost-centre”
profiling system, intended for all users everywhere.

To be able to use ticky-ticky profiling, you will need to
have built appropriate libraries and things when you made the
system. See “Customising what libraries to build,” in
the installation guide.

To get your compiled program to spit out the ticky-ticky
numbers, use a -r RTS
option.
See Section 4.14.

Compiling your program with the -ticky
switch yields an executable that performs these counts. Here is a
sample ticky-ticky statistics file, generated by the invocation
foo +RTS -rfoo.ticky.

The formatting of the information above the row of asterisks
is subject to change, but hopefully provides a useful
human-readable summary. Below the asterisks all
counters maintained by the ticky-ticky system are
dumped, in a format intended to be machine-readable: zero or more
spaces, an integer, a space, the counter name, and a newline.

In fact, not all counters are
necessarily dumped; compile- or run-time flags can render certain
counters invalid. In this case, either the counter will simply
not appear, or it will appear with a modified counter name,
possibly along with an explanation for the omission (notice
ENT_PERM_IND_ctr appears
with an inserted ! above). Software analysing
this output should always check that it has the counters it
expects. Also, beware: some of the counters can have
large values!