Merge pull request #24075 from Cyberboss/DestroySleep

Adds logging for path that slept in Destroy
This commit is contained in:
oranges
2017-02-17 14:14:37 +13:00
committed by GitHub
3 changed files with 15 additions and 2 deletions
+4
View File
@@ -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)
+7 -1
View File
@@ -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"
log_world(dellog)
CHECK_TICK
+4 -1
View File
@@ -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 = "<B>List of things that failed to GC this round</B><BR><BR>"
for(var/path in SSgarbage.didntgc)
dat += "[path] - [SSgarbage.didntgc[path]] times<BR>"
@@ -691,6 +690,10 @@ var/list/TYPES_SHORTCUTS = list(
for(var/path in SSgarbage.noqdelhint)
dat += "[path]<BR>"
dat += "<B>List of paths that slept in Destroy()</B><BR><BR>"
for(var/path in SSgarbage.sleptDestroy)
dat += "[path]<BR>"
usr << browse(dat, "window=dellog")
/client/proc/debug_huds(i as num)