diff options
Diffstat (limited to 'includes')
-rw-r--r-- | includes/Cmm.h | 2 | ||||
-rw-r--r-- | includes/RtsAPI.h | 24 | ||||
-rw-r--r-- | includes/rts/Flags.h | 1 | ||||
-rw-r--r-- | includes/rts/SpinLock.h | 5 | ||||
-rw-r--r-- | includes/rts/Threads.h | 2 | ||||
-rw-r--r-- | includes/rts/storage/GC.h | 2 | ||||
-rw-r--r-- | includes/stg/MiscClosures.h | 3 |
7 files changed, 35 insertions, 4 deletions
diff --git a/includes/Cmm.h b/includes/Cmm.h index 57d78ccaa5..18b2aaf324 100644 --- a/includes/Cmm.h +++ b/includes/Cmm.h @@ -161,9 +161,11 @@ /* TO_W_(n) converts n to W_ type from a smaller type */ #if SIZEOF_W == 4 +#define TO_I64(x) %sx64(x) #define TO_W_(x) %sx32(x) #define HALF_W_(x) %lobits16(x) #elif SIZEOF_W == 8 +#define TO_I64(x) (x) #define TO_W_(x) %sx64(x) #define HALF_W_(x) %lobits32(x) #endif diff --git a/includes/RtsAPI.h b/includes/RtsAPI.h index 27a5080220..6f011cbf6e 100644 --- a/includes/RtsAPI.h +++ b/includes/RtsAPI.h @@ -210,6 +210,30 @@ typedef struct _RTSStats { GCDetails gc; + // ----------------------------------- + // Internal Counters + + // The number of times a GC thread spun on its 'gc_spin' lock. + // Will be zero if the rts was not built with PROF_SPIN + uint64_t gc_spin_spin; + // The number of times a GC thread yielded on its 'gc_spin' lock. + // Will be zero if the rts was not built with PROF_SPIN + uint64_t gc_spin_yield; + // The number of times a GC thread spun on its 'mut_spin' lock. + // Will be zero if the rts was not built with PROF_SPIN + uint64_t mut_spin_spin; + // The number of times a GC thread yielded on its 'mut_spin' lock. + // Will be zero if the rts was not built with PROF_SPIN + uint64_t mut_spin_yield; + // The number of times a GC thread has checked for work across all parallel + // GCs + uint64_t any_work; + // The number of times a GC thread has checked for work and found none across + // all parallel GCs + uint64_t no_work; + // The number of times a GC thread has iterated it's outer loop across all + // parallel GCs + uint64_t scav_find_work; } RTSStats; void getRTSStats (RTSStats *s); diff --git a/includes/rts/Flags.h b/includes/rts/Flags.h index aed4dca384..6487947749 100644 --- a/includes/rts/Flags.h +++ b/includes/rts/Flags.h @@ -195,6 +195,7 @@ typedef struct _MISC_FLAGS { bool generate_dump_file; bool generate_stack_trace; bool machineReadable; + bool internalCounters; /* See Note [Internal Counter Stats] */ StgWord linkerMemBase; /* address to ask the OS for memory * for the linker, NULL ==> off */ } MISC_FLAGS; diff --git a/includes/rts/SpinLock.h b/includes/rts/SpinLock.h index 6530a3a2f0..1dca02f795 100644 --- a/includes/rts/SpinLock.h +++ b/includes/rts/SpinLock.h @@ -27,7 +27,8 @@ typedef struct SpinLock_ { StgWord lock; - StgWord64 spin; // DEBUG version counts how much it spins + StgWord64 spin; // incremented every time we spin in ACQUIRE_SPIN_LOCK + StgWord64 yield; // incremented every time we yield in ACQUIRE_SPIN_LOCK } SpinLock; #else typedef StgWord SpinLock; @@ -49,6 +50,7 @@ INLINE_HEADER void ACQUIRE_SPIN_LOCK(SpinLock * p) p->spin++; busy_wait_nop(); } + p->yield++; yieldThread(); } while (1); } @@ -66,6 +68,7 @@ INLINE_HEADER void initSpinLock(SpinLock * p) write_barrier(); p->lock = 1; p->spin = 0; + p->yield = 0; } #else diff --git a/includes/rts/Threads.h b/includes/rts/Threads.h index fceacdc75d..f72f5ed121 100644 --- a/includes/rts/Threads.h +++ b/includes/rts/Threads.h @@ -43,8 +43,6 @@ StgRegTable * resumeThread (void *); // int cmp_thread (StgPtr tso1, StgPtr tso2); int rts_getThreadId (StgPtr tso); -HsInt64 rts_getThreadAllocationCounter (StgPtr tso); -void rts_setThreadAllocationCounter (StgPtr tso, HsInt64 i); void rts_enableThreadAllocationLimit (StgPtr tso); void rts_disableThreadAllocationLimit (StgPtr tso); diff --git a/includes/rts/storage/GC.h b/includes/rts/storage/GC.h index 2aed7c57ee..d4182dd7f9 100644 --- a/includes/rts/storage/GC.h +++ b/includes/rts/storage/GC.h @@ -120,7 +120,7 @@ typedef struct generation_ { // stats information uint32_t collections; uint32_t par_collections; - uint32_t failed_promotions; + uint32_t failed_promotions; // Currently unused // ------------------------------------ // Fields below are used during GC only diff --git a/includes/stg/MiscClosures.h b/includes/stg/MiscClosures.h index 76cfbd6c8c..1fbfab9fbe 100644 --- a/includes/stg/MiscClosures.h +++ b/includes/stg/MiscClosures.h @@ -468,6 +468,9 @@ RTS_FUN_DECL(stg_traceCcszh); RTS_FUN_DECL(stg_clearCCSzh); RTS_FUN_DECL(stg_traceEventzh); RTS_FUN_DECL(stg_traceMarkerzh); +RTS_FUN_DECL(stg_getThreadAllocationCounterzh); +RTS_FUN_DECL(stg_setThreadAllocationCounterzh); + /* Other misc stuff */ // See wiki:Commentary/Compiler/Backends/PprC#Prototypes |