patch applied (ghc): Addition of PAPI to RTS

Simon Marlow simonmarhaskell at gmail.com
Mon Nov 20 10:17:54 EST 2006


Simon Marlow wrote:
> Wed Nov  8 09:14:52 PST 2006  mrchebas at gmail.com
>   * Addition of PAPI to RTS
>   This patch still requires the addition of the USE_PAPI
>   define to compile with PAPI. Also, programs must be
>   compiled and linked with the appropriate library flags
>   for papi.
> 
>     A ./rts/Papi.c
>     A ./rts/Papi.h
>     M ./rts/RtsStartup.c -1 +23
>     M ./rts/Stats.c -4 +54
>     M ./rts/Stats.h +5
>     M ./rts/package.conf.in +3
>     M ./rts/posix/GetTime.c -1 +20

A little background on this: PAPI[1] is a library that supports use of the 
performance counters built into most CPUs for measuring things like cache misses 
and branch mispredictions.  Alexey Rodriguez has added support for PAPI to the 
RTS, so we can take measurements of any of the CPU performance counters during 
the run of a Haskell program, and we even separate out results for the GC from 
results for the mutator.  eg, L2 cache results for nofib/imaginary/exp_3_8:

   -- CPU Mutator counters --
   (PAPI_TOT_CYC)  : 515,281,283
   (PAPI_L2_DCA)  : 17,838,185
   (PAPI_L2_DCM)  : 16,572
   (PAPI_L2_DCM) % of (PAPI_L2_DCA) : 0.1%

   -- CPU GC counters --
   (PAPI_TOT_CYC)  : 175,057,160
   (PAPI_L2_DCA)  : 1,738,026
   (PAPI_L2_DCM)  : 6,490
   (PAPI_L2_DCM) % of (PAPI_L2_DCA) : 0.4%

Installing PAPI is not for the faint-hearted: you have to install a kernel patch 
on Linux (I haven't tried it on Windows yet).  But this stuff will be 
tremendously useful, I think.

Cheers,
	Simon

[1] http://icl.cs.utk.edu/papi/


More information about the Cvs-ghc mailing list