improvements to PAPI support
[ghc-hetmet.git] / rts / Stats.c
index 1b0abaa..4bb9c82 100644 (file)
@@ -171,8 +171,6 @@ stat_endInit(void)
        InitElapsedTime = elapsed - ElapsedTimeStart;
     }
 #if USE_PAPI
-    papi_init_eventsets();
-
     /* We start counting events for the mutator
      * when garbage collection starts
      * we switch to the GC event set. */
@@ -349,7 +347,11 @@ stat_endGC (lnat alloc, lnat live, lnat copied, lnat gen)
 #if USE_PAPI
     if(papi_is_reporting) {
       /* Switch to counting mutator events */
-      papi_stop_gc_count();
+      if (gen == 0) {
+          papi_stop_gc0_count();
+      } else {
+          papi_stop_gc1_count();
+      }
       papi_start_mutator_count();
     }
 #endif
@@ -606,16 +608,7 @@ stat_exit(int alloc)
             */
 
 #if USE_PAPI
-           /* PAPI reporting, should put somewhere else?
-            * Note that the cycles are counted _after_ the initialization of the RTS -- AR */
-
-           statsPrintf("  -- CPU Mutator counters --\n");
-           papi_mut_cycles();
-           papi_report(MutatorCounters);
-
-           statsPrintf("\n  -- CPU GC counters --\n");
-           papi_gc_cycles();
-           papi_report(GCCounters);
+            papi_stats_report();
 #endif
        }