diff --git a/aurorastation.dme b/aurorastation.dme index f9698ecbadb..2e8abb610ba 100644 --- a/aurorastation.dme +++ b/aurorastation.dme @@ -29,6 +29,7 @@ #include "code\__defines\auxtools.dm" #include "code\__defines\battle_monsters.dm" #include "code\__defines\byond_compat.dm" +#include "code\__defines\profiler_tracy.dm" #include "code\__defines\callback.dm" #include "code\__defines\chemistry.dm" #include "code\__defines\color.dm" diff --git a/code/__defines/profiler_tracy.dm b/code/__defines/profiler_tracy.dm new file mode 100644 index 00000000000..190b3fa4a91 --- /dev/null +++ b/code/__defines/profiler_tracy.dm @@ -0,0 +1,31 @@ +// Implements https://github.com/mafemergency/byond-tracy +// Client https://github.com/wolfpld/tracy +// As of now, only 0.8.2 is supported as a client, this might change in the future however + +// In case you need to start the capture as soon as the server boots, uncomment the following lines and recompile: + +// /world/New() +// prof_init() +// . = ..() + +/client/verb/profiler_start() + set name = "Start Tracy Profiler" + set category = "Debug" + set desc = "Starts the tracy profiler, which will await the client connection." + switch(alert("Are you sure? Tracy will remain active until the server restarts.", "Tracy Init", "No", "Yes")) + if("Yes") + prof_init() + +/** + * Starts Tracy + */ +/proc/prof_init() + var/lib + + switch(world.system_type) + if(MS_WINDOWS) lib = "prof.dll" + if(UNIX) lib = "libprof.so" + else CRASH("Tracy initialization failed: unsupported platform or DLL not found.") + + var/init = LIBCALL(lib, "init")() + if("0" != init) CRASH("[lib] init error: [init]") diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 9cc6deb191a..d065ed51c89 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -225,7 +225,8 @@ var/list/admin_verbs_debug = list( /client/proc/connect_ntsl, /client/proc/disconnect_ntsl, /turf/proc/view_chunk, - /turf/proc/update_chunk + /turf/proc/update_chunk, + /client/verb/profiler_start ) var/list/admin_verbs_paranoid_debug = list( @@ -398,7 +399,8 @@ var/list/admin_verbs_hideable = list( /client/proc/edit_admin_permissions, /proc/possess, /proc/release, - /client/proc/force_away_mission + /client/proc/force_away_mission, + /client/verb/profiler_start ) var/list/admin_verbs_mod = list( /client/proc/cmd_admin_pm_context, // right-click adminPM interface, @@ -461,7 +463,8 @@ var/list/admin_verbs_dev = list( //will need to be altered - Ryan784 /client/proc/lighting_show_verbs, /client/proc/cmd_display_del_log, /client/proc/cmd_display_init_log, - /client/proc/create_poll //Allows to create polls + /client/proc/create_poll, //Allows to create polls + /client/verb/profiler_start ) var/list/admin_verbs_cciaa = list( /client/proc/cmd_admin_pm_panel, /*admin-pm list*/ diff --git a/html/changelogs/fluffyghost_tracyatlast.yml b/html/changelogs/fluffyghost_tracyatlast.yml new file mode 100644 index 00000000000..0d89df5ba0c --- /dev/null +++ b/html/changelogs/fluffyghost_tracyatlast.yml @@ -0,0 +1,41 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: FluffyGhost + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - backend: "Added tracy profiler, a verb to start it from the Debug tab, the precompiled library and the 0.8.2 client under tools." diff --git a/prof.dll b/prof.dll new file mode 100644 index 00000000000..58c6e50d9e7 Binary files /dev/null and b/prof.dll differ diff --git a/tools/tracy-client/Tracy.exe b/tools/tracy-client/Tracy.exe new file mode 100644 index 00000000000..fb537bdb2fb Binary files /dev/null and b/tools/tracy-client/Tracy.exe differ diff --git a/tools/tracy-client/capture.exe b/tools/tracy-client/capture.exe new file mode 100644 index 00000000000..445e3a13ffa Binary files /dev/null and b/tools/tracy-client/capture.exe differ diff --git a/tools/tracy-client/csvexport.exe b/tools/tracy-client/csvexport.exe new file mode 100644 index 00000000000..94e23548171 Binary files /dev/null and b/tools/tracy-client/csvexport.exe differ diff --git a/tools/tracy-client/import-chrome.exe b/tools/tracy-client/import-chrome.exe new file mode 100644 index 00000000000..30eaa6d8b67 Binary files /dev/null and b/tools/tracy-client/import-chrome.exe differ diff --git a/tools/tracy-client/tracy-0-8-2.pdf b/tools/tracy-client/tracy-0-8-2.pdf new file mode 100644 index 00000000000..eca88d6cc6a Binary files /dev/null and b/tools/tracy-client/tracy-0-8-2.pdf differ diff --git a/tools/tracy-client/update.exe b/tools/tracy-client/update.exe new file mode 100644 index 00000000000..c9a82955abb Binary files /dev/null and b/tools/tracy-client/update.exe differ