Commit 87750c88 authored by Ben Gamari's avatar Ben Gamari 🐢

Introduce MUTLIST_DEBUG

parent de45acb0
...@@ -112,7 +112,7 @@ bool deadlock_detect_gc; ...@@ -112,7 +112,7 @@ bool deadlock_detect_gc;
static W_ g0_pcnt_kept = 30; // percentage of g0 live at last minor GC static W_ g0_pcnt_kept = 30; // percentage of g0 live at last minor GC
/* Mut-list stats */ /* Mut-list stats */
#if defined(DEBUG) #if defined(MUTLIST_DEBUG)
uint32_t mutlist_MUTVARS, uint32_t mutlist_MUTVARS,
mutlist_MUTARRS, mutlist_MUTARRS,
mutlist_MVARS, mutlist_MVARS,
...@@ -250,7 +250,7 @@ GarbageCollect (uint32_t collect_gen, ...@@ -250,7 +250,7 @@ GarbageCollect (uint32_t collect_gen,
// the table from occurring during GC. // the table from occurring during GC.
stablePtrLock(); stablePtrLock();
#if defined(DEBUG) #if defined(MUTLIST_DEBUG)
mutlist_MUTVARS = 0; mutlist_MUTVARS = 0;
mutlist_MUTARRS = 0; mutlist_MUTARRS = 0;
mutlist_MVARS = 0; mutlist_MVARS = 0;
...@@ -602,13 +602,15 @@ GarbageCollect (uint32_t collect_gen, ...@@ -602,13 +602,15 @@ GarbageCollect (uint32_t collect_gen,
} }
copied += mut_list_size; copied += mut_list_size;
debugTrace(DEBUG_gc, #if defined(MUTLIST_DEBUG)
"mut_list_size: %lu (%d vars, %d arrays, %d MVARs, %d TVARs, %d TVAR_WATCH_QUEUEs, %d TREC_CHUNKs, %d TREC_HEADERs, %d others)", trace(TRACE_gc,
(unsigned long)(mut_list_size * sizeof(W_)), "mut_list_size: %lu (%d vars, %d arrays, %d MVARs, %d TVARs, %d TVAR_WATCH_QUEUEs, %d TREC_CHUNKs, %d TREC_HEADERs, %d others)",
mutlist_MUTVARS, mutlist_MUTARRS, mutlist_MVARS, (unsigned long)(mut_list_size * sizeof(W_)),
mutlist_TVAR, mutlist_TVAR_WATCH_QUEUE, mutlist_MUTVARS, mutlist_MUTARRS, mutlist_MVARS,
mutlist_TREC_CHUNK, mutlist_TREC_HEADER, mutlist_TVAR, mutlist_TVAR_WATCH_QUEUE,
mutlist_OTHERS); mutlist_TREC_CHUNK, mutlist_TREC_HEADER,
mutlist_OTHERS);
#endif
} }
bdescr *next, *prev; bdescr *next, *prev;
......
...@@ -42,7 +42,8 @@ extern StgPtr mark_sp; ...@@ -42,7 +42,8 @@ extern StgPtr mark_sp;
extern bool work_stealing; extern bool work_stealing;
#if defined(DEBUG) #define MUTLIST_DEBUG
#if defined(MUTLIST_DEBUG)
extern uint32_t mutlist_MUTVARS, mutlist_MUTARRS, mutlist_MVARS, mutlist_OTHERS, extern uint32_t mutlist_MUTVARS, mutlist_MUTARRS, mutlist_MVARS, mutlist_OTHERS,
mutlist_TVAR, mutlist_TVAR,
mutlist_TVAR_WATCH_QUEUE, mutlist_TVAR_WATCH_QUEUE,
......
...@@ -1591,7 +1591,7 @@ scavenge_mutable_list(bdescr *bd, generation *gen) ...@@ -1591,7 +1591,7 @@ scavenge_mutable_list(bdescr *bd, generation *gen)
p = (StgPtr)*q; p = (StgPtr)*q;
ASSERT(LOOKS_LIKE_CLOSURE_PTR(p)); ASSERT(LOOKS_LIKE_CLOSURE_PTR(p));
#if defined(DEBUG) #if defined(MUTLIST_DEBUG)
const StgInfoTable *pinfo; const StgInfoTable *pinfo;
switch (get_itbl((StgClosure *)p)->type) { switch (get_itbl((StgClosure *)p)->type) {
case MUT_VAR_CLEAN: case MUT_VAR_CLEAN:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment