Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Simon Marlow <simonmarhaskell <at> gmail.com>
Subject: Re: patch applied (ghc): Addition of PAPI to RTS
Newsgroups: gmane.comp.lang.haskell.cvs.ghc
Date: Monday 20th November 2006 15:17:54 UTC (over 10 years ago)
Simon Marlow wrote:
> Wed Nov  8 09:14:52 PST 2006  [email protected]
>   * 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/
 
CD: 3ms