diff options
author | Kirk <kklobe@gmail.com> | 2022-06-29 04:27:22 +0300 |
---|---|---|
committer | Kirk <kklobe@gmail.com> | 2022-06-29 04:27:22 +0300 |
commit | 8a7d2b1c8e699ee0b616afc07ba9a6957bcaa21d (patch) | |
tree | ca76f6e631490836d7c7ea7c5bbe7af2fa3bc0f6 | |
parent | 58f3e3bfcd08de7162dd7294ea0448e0a334899f (diff) |
Instrument some core subsystems with Tracykk/tracy-1
-rw-r--r-- | src/cpu/core_dyn_x86.cpp | 3 | ||||
-rw-r--r-- | src/cpu/core_dynrec.cpp | 3 | ||||
-rw-r--r-- | src/cpu/core_full.cpp | 4 | ||||
-rw-r--r-- | src/cpu/core_normal.cpp | 3 | ||||
-rw-r--r-- | src/cpu/core_simple.cpp | 3 | ||||
-rw-r--r-- | src/cpu/meson.build | 1 | ||||
-rw-r--r-- | src/dosbox.cpp | 3 | ||||
-rw-r--r-- | src/gui/meson.build | 1 | ||||
-rw-r--r-- | src/gui/sdlmain.cpp | 3 | ||||
-rw-r--r-- | src/hardware/meson.build | 1 | ||||
-rw-r--r-- | src/hardware/mixer.cpp | 2 |
11 files changed, 26 insertions, 1 deletions
diff --git a/src/cpu/core_dyn_x86.cpp b/src/cpu/core_dyn_x86.cpp index 0ae048efc..77920f6bc 100644 --- a/src/cpu/core_dyn_x86.cpp +++ b/src/cpu/core_dyn_x86.cpp @@ -40,6 +40,8 @@ #endif // HAVE_MPROTECT +#include <Tracy.hpp> + #include "callback.h" #include "regs.h" #include "mem.h" @@ -248,6 +250,7 @@ static void dyn_restoreregister(DynReg * src_reg, DynReg * dst_reg) { #include "core_dyn_x86/decoder.h" Bits CPU_Core_Dyn_X86_Run(void) { + ZoneScoped // helper class to auto-save DH_FPU state on function exit class auto_dh_fpu { public: diff --git a/src/cpu/core_dynrec.cpp b/src/cpu/core_dynrec.cpp index 92c109efd..07cff6f7f 100644 --- a/src/cpu/core_dynrec.cpp +++ b/src/cpu/core_dynrec.cpp @@ -40,6 +40,8 @@ #endif // HAVE_MPROTECT +#include <Tracy.hpp> + #include "callback.h" #include "regs.h" #include "mem.h" @@ -208,6 +210,7 @@ CacheBlock *LinkBlocks(BlockReturn ret) */ Bits CPU_Core_Dynrec_Run(void) { + ZoneScoped for (;;) { // Determine the linear address of CS:EIP PhysPt ip_point=SegPhys(cs)+reg_eip; diff --git a/src/cpu/core_full.cpp b/src/cpu/core_full.cpp index 07b9b6a0e..7f34fd411 100644 --- a/src/cpu/core_full.cpp +++ b/src/cpu/core_full.cpp @@ -18,6 +18,8 @@ #include "dosbox.h" +#include <Tracy.hpp> + #include "pic.h" #include "regs.h" #include "cpu.h" @@ -28,7 +30,6 @@ #include "inout.h" #include "callback.h" - typedef PhysPt EAPoint; #define SegBase(c) SegPhys(c) @@ -62,6 +63,7 @@ typedef PhysPt EAPoint; } Bits CPU_Core_Full_Run(void) { + ZoneScoped FullData inst{}; while (CPU_Cycles-->0) { #if C_DEBUG diff --git a/src/cpu/core_normal.cpp b/src/cpu/core_normal.cpp index 94e28e236..566d3af9c 100644 --- a/src/cpu/core_normal.cpp +++ b/src/cpu/core_normal.cpp @@ -18,6 +18,8 @@ #include <stdio.h> +#include <Tracy.hpp> + #include "dosbox.h" #include "mem.h" #include "cpu.h" @@ -139,6 +141,7 @@ static inline uint32_t Fetchd() { #define EALookupTable (core.ea_table) Bits CPU_Core_Normal_Run(void) { + ZoneScoped while (CPU_Cycles-->0) { LOADIP; core.opcode_index=cpu.code.big*0x200; diff --git a/src/cpu/core_simple.cpp b/src/cpu/core_simple.cpp index a41a486fa..063b2733f 100644 --- a/src/cpu/core_simple.cpp +++ b/src/cpu/core_simple.cpp @@ -18,6 +18,8 @@ #include <stdio.h> +#include <Tracy.hpp> + #include "dosbox.h" #include "mem.h" #include "cpu.h" @@ -135,6 +137,7 @@ static inline uint32_t Fetchd() { #define EALookupTable (core.ea_table) Bits CPU_Core_Simple_Run(void) { + ZoneScoped while (CPU_Cycles-->0) { LOADIP; core.opcode_index=cpu.code.big*0x200; diff --git a/src/cpu/meson.build b/src/cpu/meson.build index b82502548..8cbb330ab 100644 --- a/src/cpu/meson.build +++ b/src/cpu/meson.build @@ -70,6 +70,7 @@ libcpu = static_library('cpu', libcpu_sources, include_directories : incdir, dependencies : [sdl2_dep, libghc_dep, + tracy_dep, libloguru_dep, ]) diff --git a/src/dosbox.cpp b/src/dosbox.cpp index 19634ac64..490a46893 100644 --- a/src/dosbox.cpp +++ b/src/dosbox.cpp @@ -31,6 +31,8 @@ #include <chrono> #include <thread> +#include <Tracy.hpp> + #include "debug.h" #include "cpu.h" #include "video.h" @@ -170,6 +172,7 @@ static Bitu Normal_Loop() { } void increaseticks() { //Make it return ticksRemain and set it in the function above to remove the global variable. + ZoneScoped if (GCC_UNLIKELY(ticksLocked)) { // For Fast Forward Mode ticksRemain=5; /* Reset any auto cycle guessing for this frame */ diff --git a/src/gui/meson.build b/src/gui/meson.build index d039366f6..429e42497 100644 --- a/src/gui/meson.build +++ b/src/gui/meson.build @@ -13,6 +13,7 @@ libgui = static_library('gui', libgui_sources, opengl_dep, libghc_dep, libloguru_dep, + tracy_dep, libppscale_dep, ]) diff --git a/src/gui/sdlmain.cpp b/src/gui/sdlmain.cpp index 0b2bb9c43..74bd51710 100644 --- a/src/gui/sdlmain.cpp +++ b/src/gui/sdlmain.cpp @@ -47,6 +47,8 @@ #include <SDL_opengl.h> #endif +#include <Tracy.hpp> + #include "control.h" #include "cpu.h" #include "cross.h" @@ -2318,6 +2320,7 @@ void GFX_EndUpdate(const uint16_t *changedLines) break; } sdl.updating = false; + FrameMark } // Texture update and presentation diff --git a/src/hardware/meson.build b/src/hardware/meson.build index 76ba02b20..c213f0d5e 100644 --- a/src/hardware/meson.build +++ b/src/hardware/meson.build @@ -70,6 +70,7 @@ libhardware = static_library('hardware', libhardware_sources, sdl2_dep, sdl2_net_dep, speexdsp_dep, + tracy_dep, winsock2_dep, zlib_dep, ]) diff --git a/src/hardware/mixer.cpp b/src/hardware/mixer.cpp index 6dc5e1c61..e2cfa0971 100644 --- a/src/hardware/mixer.cpp +++ b/src/hardware/mixer.cpp @@ -44,6 +44,7 @@ #include <SDL.h> #include <speex/speex_resampler.h> +#include <Tracy.hpp> #include "ansi_code_markup.h" #include "control.h" @@ -1144,6 +1145,7 @@ static void MIXER_Mix_NoSound() static void SDLCALL MIXER_CallBack([[maybe_unused]] void *userdata, Uint8 *stream, int len) { + ZoneScoped memset(stream, 0, len); auto frames_requested = len / mixer_frame_size; |