Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Thorkil Naur <naur <at> post11.tele.dk>
Subject: ANNOUNCE: hpc-strobe-0.1: Hpc-generated strobes for a running Haskell program
Newsgroups: gmane.comp.lang.haskell.cafe
Date: Friday 8th May 2009 19:11:35 UTC (over 7 years ago)
I am pleased to announce the initial release of hpc-strobe: Hpc-generated 
strobes for a running Haskell program. hpc-strobe is a rudimentary library 
that demonstrates the possibility of using Hpc (Haskell Program Coverage)
to 
inspect the state of a running Haskell program. hpc-strobe-0.1 has been 
uploaded to hackage:

http://hackage.haskell.org/packages/archive/hpc-strobe/0.1/hpc-strobe-0.1.tar.gz

In ordinary use of Hpc, a single so-called tix file is produced at the end
of 
a run. The tix file records how many times each expression has been used 
during the run. This can be used to mark up the source code, identifying 
expressions that have not been used.

hpc-strobe uses the basic machinery provided by Hpc to produce multiple tix

files, also called strobes, representing the coverage at different times 
while the program is running. By subtracting such two tix files, again
using 
Hpc machinery, a tix file representing the expressions used between the
times 
of recording the subtracted tix files is produced. This may be used, for 
example, to get a better idea of what a long-running program is doing. It 
could also be used as a profiling tool, getting information about how many 
times individual expressions are used.

A program is included whose strobe differences produce a crude rendering of
an 
analog clock when they are used to mark up the source code using Hpc.
Please 
see the attached example (gunzip the file, point you browser to it, scroll 
down to view the canvas function).

Use of the library involves a simple change of the main function and also 
requires the program to be enabled for hpc. At the time of writing, this 
means using a fairly recent version of GHC and compiling the Haskell code 
with the -fhpc option.

For additional details, see the README included in the package.

Best regards
Thorkil
 
CD: 4ms