X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=rts%2FPapi.c;h=0963ca7583ab76ef90deec7bc49d6ef55b7b57f9;hp=8ce3cc2381134a8e083961c8af3d038e82218af1;hb=45202530612593a0ba7a6c559a38dc1ff26670a4;hpb=fe07f054d7ae5e10b14d5fed730fe4424dabd587 diff --git a/rts/Papi.c b/rts/Papi.c index 8ce3cc2..0963ca7 100644 --- a/rts/Papi.c +++ b/rts/Papi.c @@ -1,38 +1,38 @@ - +/* ----------------------------------------------------------------------------- + * (c) The GHC Team 2006 + * + * Initialization and use of the PAPI performance monitoring library + * + * + * For adding events or add your processor counters modify + * + * init_countable_events + * papi_report + * + * ---------------------------------------------------------------------------*/ + + +#ifdef USE_PAPI /* ugly */ #include "Papi.h" #include "Rts.h" #include "RtsUtils.h" #include "Stats.h" +#include "RtsFlags.h" -/* These constants specify which events to keep track of. - * Probably it is better to count one set of events at a time. - * The reason is that processors have limited counters and - * multiplexing is not enabled (yet). - */ -#define PAPI_COUNT_BRANCHES 0 -/* The one below is Opteron specific. - */ -#define PAPI_COUNT_STALLS 0 -#define PAPI_COUNT_DCACHE1_MISSES 1 -#define PAPI_COUNT_DCACHE2_MISSES 0 - struct _papi_events { int event_code; char * event_name; }; -#define PAPI_ADD_EVENT(EVENT) { EVENT, #EVENT } - -/* Beware, these counters are Opteron specific */ -#define FR_BR 0x40000040 -#define FR_BR_MIS 0x40000041 -#define FR_BR_MISCOMPARE 0x40000048 -#define DC_ACCESS 0x40000019 -#define DC_MISS 0x4000001a -#define FR_DISPATCH_STALLS_BR 0x40000055 -#define FR_DISPATCH_STALLS_FULL_LS 0x4000005b +#define PAPI_ADD_EVENT(EVENT) \ + { \ + ASSERT(n_papi_events