diff --git a/code/_compile_options.dm b/code/_compile_options.dm index 2949a7e70d7..22ca425a9e0 100644 --- a/code/_compile_options.dm +++ b/code/_compile_options.dm @@ -1,5 +1,4 @@ #define DEBUG //Enables byond profiling and full runtime logs - note, this may also be defined in your .dme file -//#define dellogging //Enables logging of forced del() calls (used for debugging) //#define TESTING //Enables in-depth debug messages to runtime log (used for debugging) //By using the testing("message") proc you can create debug-feedback for people with this //uncommented, but not visible in the release version) @@ -43,17 +42,6 @@ #define AI_CAMERA_LUMINOSITY 5 #define AI_VOX 1 // Comment out if you don't want VOX to be enabled and have players download the voice sounds. - -//Additional code for the above flags. -#ifdef dellogging -#warn compiling del logging. This will have additional overheads. //will warn you if compiling with dellogging -var/list/del_counter = list() -/proc/log_del(datum/X) - if(istype(X)){del_counter[X.type]++;} - del(X) -#define del(X) log_del(X) //overrides all del() calls with log_del() -#endif - #ifdef TESTING #warn compiling in TESTING mode. testing() debug messages will be visible. #endif diff --git a/code/controllers/garbage.dm b/code/controllers/garbage.dm index 53b1d8019a1..322bc086d89 100644 --- a/code/controllers/garbage.dm +++ b/code/controllers/garbage.dm @@ -11,6 +11,9 @@ var/datum/controller/garbage_collector/garbage = new() // refID's are associated with the time at which they time out and need to be manually del() // we do this so we aren't constantly locating them and preventing them from being gc'd + var/list/logging = 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 + /datum/controller/garbage_collector/proc/AddTrash(var/datum/A) if(!istype(A) || !isnull(A.gc_destroyed)) return @@ -37,6 +40,7 @@ var/datum/controller/garbage_collector/garbage = new() if(A && A.gc_destroyed == GCd_at_time) // So if something else coincidently gets the same ref, it's not deleted by mistake // Something's still referring to the qdel'd object. Kill it. testing("GC: -- \ref[A] | [A.type] was unable to be GC'd and was deleted --") + logging["[A.type]"]++ del(A) dels++ // else diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 0be71e2376b..b206dfa347b 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -1137,3 +1137,15 @@ var/global/list/g_fancy_list_of_safe_types = null usr << list2text(clients,",") if("Joined Clients") usr << list2text(joined_player_list,",") + +/client/proc/cmd_display_del_log() + set category = "Debug" + set name = "Display del() Log" + 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 garbage.logging) + dat += "[path] - [garbage.logging[path]] times
" + + usr << browse(dat, "window=dellog") diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm index 8745247f96e..a567d4eaec6 100644 --- a/code/modules/admin/verbs/mapping.dm +++ b/code/modules/admin/verbs/mapping.dm @@ -148,6 +148,7 @@ var/intercom_range_display_status = 0 src.verbs += /client/proc/print_pointers src.verbs += /client/proc/count_movable_instances src.verbs += /client/proc/SDQL2_query + src.verbs += /client/proc/cmd_display_del_log //src.verbs += /client/proc/cmd_admin_rejuvenate feedback_add_details("admin_verb","mDV") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/world.dm b/code/world.dm index 4d5f62ea91a..67e392d7c75 100644 --- a/code/world.dm +++ b/code/world.dm @@ -173,15 +173,6 @@ #undef CHAT_PULLR /world/Reboot(var/reason) -#ifdef dellogging - var/log = file("data/logs/del.log") - log << time2text(world.realtime) - //mergeSort(del_counter, /proc/cmp_descending_associative) //still testing the sorting procs. Use notepad++ to sort the resultant logfile for now. - for(var/index in del_counter) - var/count = del_counter[index] - if(count > 10) - log << "#[count]\t[index]" -#endif spawn(0) world << sound(pick('sound/AI/newroundsexy.ogg','sound/misc/apcdestroyed.ogg','sound/misc/bangindonk.ogg')) // random end sounds!! - LastyBatsy