RTS tidyup sweep, first phase
[ghc-hetmet.git] / rts / Papi.h
index 835eea6..8f58f6d 100644 (file)
@@ -5,16 +5,8 @@
  *
  * ---------------------------------------------------------------------------*/
 
-
-#include <papi.h>
-
-
-
-#define PAPI_CHECK(CALL) \
-  if((papi_error=(CALL)) != PAPI_OK) { \
-   debugBelch("PAPI function failed in module %s at line %d with error code %d\n", \
-             __FILE__,__LINE__,papi_error);                            \
-  }
+#ifndef PAPI_H
+#define PAPI_H
 
 /* Check the error value of a PAPI call, reporting an error, if needed */
 extern int papi_error;
@@ -22,24 +14,19 @@ extern int papi_error;
 /* While PAPI reporting is going on this flag is on */
 extern int papi_is_reporting;
 
-/* Event sets and counter arrays for GC and mutator */
-
-extern int MutatorEvents;
-extern int GCEvents;
-
-extern long_long MutatorCounters[];
-extern long_long GCCounters[];
-
-long_long papi_counter(long_long values[],int event);
-void papi_report(long_long PapiCounters[]);
-void papi_mut_cycles(void);
-void papi_gc_cycles(void);
-void papi_add_events(int EventSet);
-
-void papi_init_eventsets(void);
+void papi_stats_report(void);
+void papi_init_eventset(int * event_set);
+void papi_init(void);
 void papi_start_mutator_count(void);
 void papi_stop_mutator_count(void);
+
 void papi_start_gc_count(void);
-void papi_stop_gc_count(void);
+void papi_stop_gc0_count(void);
+void papi_stop_gc1_count(void);
 
+// for multithreaded GC, each sub-thread uses these functions to count
+// events and aggregate them into the main GC counters.
+void papi_thread_start_gc1_count(int event_set);
+void papi_thread_stop_gc1_count(int event_set);
 
+#endif /* PAPI_H */