mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-12 18:51:53 +00:00
[MIRROR] Adds handy define that enables the most common configuration of reftracking (#27461)
* Adds handy define that enables the most common configuration of reftracking (#82860) ## About The Pull Request This shit has confused people too many times, let's give them an easy pathway to use reftracking Also split the separate logging bit into its own thing * Adds handy define that enables the most common configuration of reftracking --------- Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
This commit is contained in:
6
.github/guides/HARDDELETES.md
vendored
6
.github/guides/HARDDELETES.md
vendored
@@ -135,11 +135,11 @@ If that fails, search the object's typepath, and look and see if anything is hol
|
|||||||
BYOND currently doesn't have the capability to give us information about where a hard delete is. Fortunately we can search for most all of then ourselves.
|
BYOND currently doesn't have the capability to give us information about where a hard delete is. Fortunately we can search for most all of then ourselves.
|
||||||
The procs to perform this search are hidden behind compile time defines, since they'd be way too risky to expose to admin button pressing
|
The procs to perform this search are hidden behind compile time defines, since they'd be way too risky to expose to admin button pressing
|
||||||
|
|
||||||
If you're having issues solving a harddel and want to perform this check yourself, go to `_compile_options.dm` and uncomment `TESTING`, `REFERENCE_TRACKING`, and `GC_FAILURE_HARD_LOOKUP`
|
If you're having issues solving a harddel and want to perform this check yourself, go to `_compile_options.dm` and uncomment `REFERENCE_TRACKING_STANDARD`.
|
||||||
|
|
||||||
You can read more about what each of these do in that file, but the long and short of it is if something would hard delete our code will search for the reference (This will look like your game crashing, just hold out) and print information about anything it finds to the runtime log, which you can find inside the round folder inside `/data/logs/year/month/day`
|
You can read more about what each of these do in that file, but the long and short of it is if something would hard delete our code will search for the reference (This will look like your game crashing, just hold out) and print information about anything it finds to [log_dir]/harddels.log, which you can find inside the round folder inside `/data/logs/year/month/day`
|
||||||
|
|
||||||
It'll tell you what object is holding the ref if it's in an object, or what pattern of list transversal was required to find the ref if it's hiding in a list of some sort
|
It'll tell you what object is holding the ref if it's in an object, or what pattern of list transversal was required to find the ref if it's hiding in a list of some sort, alongside the references remaining.
|
||||||
|
|
||||||
## Techniques For Fixing Hard Deletes
|
## Techniques For Fixing Hard Deletes
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ GLOBAL_LIST_INIT(testing_global_profiler, list("_PROFILE_NAME" = "Global"))
|
|||||||
SEND_TEXT(world.log, text)
|
SEND_TEXT(world.log, text)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(REFERENCE_DOING_IT_LIVE)
|
#if defined(REFERENCE_TRACKING_LOG_APART)
|
||||||
#define log_reftracker(msg) log_harddel("## REF SEARCH [msg]")
|
#define log_reftracker(msg) log_harddel("## REF SEARCH [msg]")
|
||||||
|
|
||||||
/proc/log_harddel(text)
|
/proc/log_harddel(text)
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
#define FIND_REF_NO_CHECK_TICK
|
#define FIND_REF_NO_CHECK_TICK
|
||||||
#endif //ifdef GC_FAILURE_HARD_LOOKUP
|
#endif //ifdef GC_FAILURE_HARD_LOOKUP
|
||||||
|
|
||||||
|
// Log references in their own file, rather then in runtimes.log
|
||||||
|
//#define REFERENCE_TRACKING_LOG_APART
|
||||||
#endif //ifdef REFERENCE_TRACKING
|
#endif //ifdef REFERENCE_TRACKING
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -60,8 +62,24 @@
|
|||||||
#define REFERENCE_TRACKING
|
#define REFERENCE_TRACKING
|
||||||
// actually look for refs
|
// actually look for refs
|
||||||
#define GC_FAILURE_HARD_LOOKUP
|
#define GC_FAILURE_HARD_LOOKUP
|
||||||
|
// Log references in their own file
|
||||||
|
#define REFERENCE_TRACKING_LOG_APART
|
||||||
#endif // REFERENCE_DOING_IT_LIVE
|
#endif // REFERENCE_DOING_IT_LIVE
|
||||||
|
|
||||||
|
/// Sets up the reftracker to be used locally, to hunt for hard deletions
|
||||||
|
/// Errors are logged to [log_dir]/harddels.log
|
||||||
|
//#define REFERENCE_TRACKING_STANDARD
|
||||||
|
#ifdef REFERENCE_TRACKING_STANDARD
|
||||||
|
// compile the backend
|
||||||
|
#define REFERENCE_TRACKING
|
||||||
|
// actually look for refs
|
||||||
|
#define GC_FAILURE_HARD_LOOKUP
|
||||||
|
// spend ALL our time searching, not just part of it
|
||||||
|
#define FIND_REF_NO_CHECK_TICK
|
||||||
|
// Log references in their own file
|
||||||
|
#define REFERENCE_TRACKING_LOG_APART
|
||||||
|
#endif // REFERENCE_TRACKING_STANDARD
|
||||||
|
|
||||||
// If this is uncommented, we do a single run though of the game setup and tear down process with unit tests in between
|
// If this is uncommented, we do a single run though of the game setup and tear down process with unit tests in between
|
||||||
// #define UNIT_TESTS
|
// #define UNIT_TESTS
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ GLOBAL_PROTECT(##log_var_name);\
|
|||||||
DECLARE_LOG(config_error_log, DONT_START_LOG)
|
DECLARE_LOG(config_error_log, DONT_START_LOG)
|
||||||
DECLARE_LOG(perf_log, DONT_START_LOG) // Declared here but name is set in time_track subsystem
|
DECLARE_LOG(perf_log, DONT_START_LOG) // Declared here but name is set in time_track subsystem
|
||||||
|
|
||||||
#ifdef REFERENCE_DOING_IT_LIVE
|
#ifdef REFERENCE_TRACKING_LOG_APART
|
||||||
DECLARE_LOG_NAMED(harddel_log, "harddels", START_LOG)
|
DECLARE_LOG_NAMED(harddel_log, "harddels", START_LOG)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user