From 5efad4b9a00839cb84ed56525540a023fb50edda Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Mon, 13 Feb 2017 14:11:40 -0500 Subject: [PATCH] Adds logging for path that slept in Destroy --- code/controllers/subsystem/garbage.dm | 4 ++++ code/controllers/subsystem/ticker.dm | 8 +++++++- code/modules/admin/verbs/debug.dm | 5 ++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/code/controllers/subsystem/garbage.dm b/code/controllers/subsystem/garbage.dm index 26dfbfee0ad..65dff21ef9c 100644 --- a/code/controllers/subsystem/garbage.dm +++ b/code/controllers/subsystem/garbage.dm @@ -24,6 +24,7 @@ var/datum/subsystem/garbage_collector/SSgarbage var/list/didntgc = list() // list of all types that have failed to GC associated with the number of times that's happened. // the types are stored as strings + var/list/sleptDestroy = list() //Same as above but these are paths that slept during their Destroy call var/list/noqdelhint = list()// list of all types that do not return a QDEL_HINT // all types that did not respect qdel(A, force=TRUE) and returned one @@ -168,7 +169,10 @@ var/datum/subsystem/garbage_collector/SSgarbage del(D) else if(isnull(D.gc_destroyed)) D.gc_destroyed = GC_CURRENTLY_BEING_QDELETED + var/start_time = world.time var/hint = D.Destroy(force) // Let our friend know they're about to get fucked up. + if(world.time != start_time) + SSgarbage.sleptDestroy["[D.type]"]++ if(!D) return switch(hint) diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 83d05b52da6..bb3f399bb37 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -545,11 +545,17 @@ var/datum/subsystem/ticker/ticker CHECK_TICK //Adds the del() log to world.log in a format condensable by the runtime condenser found in tools - if(SSgarbage.didntgc.len) + if(SSgarbage.didntgc.len || SSgarbage.sleptDestroy.len) var/dellog = "" for(var/path in SSgarbage.didntgc) dellog += "Path : [path] \n" dellog += "Failures : [SSgarbage.didntgc[path]] \n" + if(path in SSgarbage.sleptDestroy) + dellog += "Sleeps : [SSgarbage.sleptDestroy[path]] \n" + SSgarbage.sleptDestroy -= path + for(var/path in SSgarbage.sleptDestroy) + dellog += "Path : [path] \n" + dellog += "Sleeps : [SSgarbage.sleptDestroy[path]] \n" world.log << dellog CHECK_TICK diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index b7672484554..1e5e4a29647 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -683,7 +683,6 @@ var/list/TYPES_SHORTCUTS = list( set desc = "Displays a list of things that have failed to GC this round" var/dat = "List of things that failed to GC this round

" - for(var/path in SSgarbage.didntgc) dat += "[path] - [SSgarbage.didntgc[path]] times
" @@ -691,6 +690,10 @@ var/list/TYPES_SHORTCUTS = list( for(var/path in SSgarbage.noqdelhint) dat += "[path]
" + dat += "List of paths that slept in Destroy()

" + for(var/path in SSgarbage.sleptDestroy) + dat += "[path]
" + usr << browse(dat, "window=dellog") /client/proc/debug_huds(i as num)