Add defines for byond-tracy support (#70931)
Adds `USE_BYOND_TRACY`, which automatically loads a given prof.dll/libprof.so using https://github.com/mafemergency/byond-tracy/. Not intended for use in production, and we do not ship a copy of byond-tracy. It is extremely easy to compile yourself, but if you're someone interesting enough to play around with this then let me know and I can just give you a build. I'm going to be using this for init profiling.
This commit is contained in:
@@ -14,6 +14,11 @@ GLOBAL_LIST(topic_status_cache)
|
||||
LIBCALL(dll, "auxtools_init")()
|
||||
enable_debugging()
|
||||
|
||||
#ifdef USE_BYOND_TRACY
|
||||
#warn USE_BYOND_TRACY is enabled
|
||||
init_byond_tracy()
|
||||
#endif
|
||||
|
||||
world.Profile(PROFILE_START)
|
||||
log_world("World loaded at [TIME_STAMP("hh:mm:ss", FALSE)]!")
|
||||
|
||||
@@ -369,3 +374,19 @@ GLOBAL_LIST(topic_status_cache)
|
||||
|
||||
/world/proc/on_tickrate_change()
|
||||
SStimer?.reset_buckets()
|
||||
|
||||
/world/proc/init_byond_tracy()
|
||||
var/library
|
||||
|
||||
switch (system_type)
|
||||
if (MS_WINDOWS)
|
||||
library = "prof.dll"
|
||||
if (UNIX)
|
||||
library = "libprof.so"
|
||||
else
|
||||
CRASH("Unsupported platform: [system_type]")
|
||||
|
||||
var/init_result = call(library, "init")()
|
||||
if (init_result != "0")
|
||||
CRASH("Error initializing byond-tracy: [init_result]")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user