+static char temp[BIG_STRING_LEN];
+
+void
+papi_mut_cycles()
+{
+ ullong_format_string(mutator_cycles,temp,rtsTrue/*commas*/);
+ statsPrintf(" (MUT_CYCLES) : %s\n",temp);
+}
+
+void
+papi_gc_cycles()
+{
+ ullong_format_string(gc_cycles,temp,rtsTrue/*commas*/);
+ statsPrintf(" (GC_CYCLES) : %s\n",temp);
+}
+
+/* This function reports counters for GC and mutator */
+void
+papi_report(long_long PapiCounters[])
+{
+
+ /* I need to improve formatting aesthetics */
+ PAPI_REPORT(PapiCounters,PAPI_TOT_INS);
+
+ if(RtsFlags.PapiFlags.eventType==PAPI_FLAG_BRANCH) {
+ PAPI_REPORT(PapiCounters,FR_BR);
+ PAPI_REPORT(PapiCounters,FR_BR_MIS);
+ PAPI_REPORT_PCT(PapiCounters,FR_BR_MIS,FR_BR);
+ PAPI_REPORT_PCT(PapiCounters,FR_BR_MISCOMPARE,FR_BR);
+ }
+
+ if(RtsFlags.PapiFlags.eventType==PAPI_FLAG_STALLS) {
+ PAPI_REPORT(PapiCounters,FR_DISPATCH_STALLS_BR);
+ //PAPI_REPORT_PCT(PapiCounters,FR_DISPATCH_STALLS_BR,PAPI_TOT_CYC);
+ PAPI_REPORT(PapiCounters,FR_DISPATCH_STALLS_FULL_LS);
+ //PAPI_REPORT_PCT(PapiCounters,FR_DISPATCH_STALLS_FULL_LS,PAPI_TOT_CYC);
+ }
+
+ if(RtsFlags.PapiFlags.eventType==PAPI_FLAG_CACHE_L1) {
+ PAPI_REPORT(PapiCounters,PAPI_L1_DCA);
+ PAPI_REPORT(PapiCounters,PAPI_L1_DCM);
+ PAPI_REPORT_PCT(PapiCounters,PAPI_L1_DCM,PAPI_L1_DCA);
+ }
+
+ if(RtsFlags.PapiFlags.eventType==PAPI_FLAG_CACHE_L2) {
+ PAPI_REPORT(PapiCounters,PAPI_L2_DCA);
+ PAPI_REPORT(PapiCounters,PAPI_L2_DCM);
+ PAPI_REPORT_PCT(PapiCounters,PAPI_L2_DCM,PAPI_L2_DCA);
+ }
+
+ if(RtsFlags.PapiFlags.eventType==PAPI_FLAG_CB_EVENTS) {
+ PAPI_REPORT(PapiCounters,DC_L2_REFILL_MOES);
+ PAPI_REPORT(PapiCounters,DC_SYS_REFILL_MOES);
+ PAPI_REPORT(PapiCounters,FR_BR_MIS);
+ }
+
+}
+
+
+
+void
+papi_init_eventsets(void)
+{
+
+ init_countable_events();
+
+ /* One event set for the mutator and another for the GC */
+ PAPI_CHECK( PAPI_create_eventset(&MutatorEvents));
+ PAPI_CHECK( PAPI_create_eventset(&GCEvents));
+
+ /* Both sets contain the same events */
+ papi_add_events(MutatorEvents);
+ papi_add_events(GCEvents);
+
+}