#include "RetainerProfile.h"
#include "RaiseAsync.h"
#include "Sparks.h"
+#include "Papi.h"
#include "GC.h"
#include "Compact.h"
init_gc_thread(t);
+#ifdef USE_PAPI
+ t->papi_events = -1;
+#endif
+
t->steps = stgMallocBytes(RtsFlags.GcFlags.generations *
sizeof(step_workspace *),
"initialise_gc_thread");
gct->wakeup = rtsFalse;
if (gct->exit) break;
+#ifdef USE_PAPI
+ // start performance counters in this thread...
+ if (gct->papi_events == -1) {
+ papi_init_eventset(&gct->papi_events);
+ }
+ papi_thread_start_gc_count(gct->papi_events);
+#endif
+
gc_thread_work();
+
+#ifdef USE_PAPI
+ // count events in this thread towards the GC totals
+ papi_thread_stop_gc_count(gct->papi_events);
+#endif
}
}
#endif