From e3aaf93e28aea767e0a88108caf32b0057296cbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 10 Dec 2024 10:34:26 +0100 Subject: [PATCH] Add a new log category --- Common/Log.h | 2 +- GPU/Debugger/Debugger.cpp | 10 +++++----- GPU/Debugger/Playback.cpp | 23 +++++++++++------------ GPU/Debugger/Stepping.cpp | 7 ++++--- GPU/Debugger/Stepping.h | 1 - 5 files changed, 21 insertions(+), 22 deletions(-) diff --git a/Common/Log.h b/Common/Log.h index d0199dc02b..158e7e0c19 100644 --- a/Common/Log.h +++ b/Common/Log.h @@ -48,7 +48,7 @@ enum class Log { HTTP, Printf, TexReplacement, - Debugger, + GeDebugger, sceAudio, sceCtrl, diff --git a/GPU/Debugger/Debugger.cpp b/GPU/Debugger/Debugger.cpp index 0e9fc20097..ed1729c679 100644 --- a/GPU/Debugger/Debugger.cpp +++ b/GPU/Debugger/Debugger.cpp @@ -163,7 +163,7 @@ NotifyResult NotifyCommand(u32 pc) { } if (isBreakpoint && pc == g_skipPcOnce) { - INFO_LOG(Log::G3D, "Skipping break at %08x (last break was here)", g_skipPcOnce); + INFO_LOG(Log::GeDebugger, "Skipping GE break at %08x (last break was here)", g_skipPcOnce); g_skipPcOnce = 0; return process ? NotifyResult::Execute : NotifyResult::Skip; } @@ -179,10 +179,10 @@ NotifyResult NotifyCommand(u32 pc) { auto info = gpuDebug->DisassembleOp(pc); if (lastStepTime >= 0.0) { - NOTICE_LOG(Log::G3D, "Waiting at %08x, %s (%fms)", pc, info.desc.c_str(), (time_now_d() - lastStepTime) * 1000.0); + NOTICE_LOG(Log::GeDebugger, "Waiting at %08x, %s (%fms)", pc, info.desc.c_str(), (time_now_d() - lastStepTime) * 1000.0); lastStepTime = -1.0; } else { - NOTICE_LOG(Log::G3D, "Waiting at %08x, %s", pc, info.desc.c_str()); + NOTICE_LOG(Log::GeDebugger, "Waiting at %08x, %s", pc, info.desc.c_str()); } g_skipPcOnce = pc; @@ -199,10 +199,10 @@ void NotifyDraw() { return; if (breakNext == BreakNext::DRAW && !GPUStepping::IsStepping()) { if (lastStepTime >= 0.0) { - NOTICE_LOG(Log::G3D, "Waiting at a draw (%fms)", (time_now_d() - lastStepTime) * 1000.0); + NOTICE_LOG(Log::GeDebugger, "Waiting at a draw (%fms)", (time_now_d() - lastStepTime) * 1000.0); lastStepTime = -1.0; } else { - NOTICE_LOG(Log::G3D, "Waiting at a draw"); + NOTICE_LOG(Log::GeDebugger, "Waiting at a draw"); } g_drawNotified = true; } diff --git a/GPU/Debugger/Playback.cpp b/GPU/Debugger/Playback.cpp index 09db244ce8..1a2b951bb1 100644 --- a/GPU/Debugger/Playback.cpp +++ b/GPU/Debugger/Playback.cpp @@ -383,7 +383,7 @@ private: void DumpExecute::SyncStall() { if (execListBuf == 0) { - VERBOSE_LOG(Log::G3D, "SyncStall: No active display list"); + VERBOSE_LOG(Log::GeDebugger, "SyncStall: No active display list"); return; } @@ -411,7 +411,7 @@ void DumpExecute::Registers(u32 ptr, u32 sz) { execListBuf = 0; } if (execListBuf == 0) { - ERROR_LOG(Log::System, "Unable to allocate for display list"); + ERROR_LOG(Log::GeDebugger, "Unable to allocate for display list"); return; } @@ -514,7 +514,7 @@ void DumpExecute::Init(u32 ptr, u32 sz) { void DumpExecute::Vertices(u32 ptr, u32 sz) { u32 psp = mapping_.Map(ptr, sz, std::bind(&DumpExecute::SyncStall, this)); if (psp == 0) { - ERROR_LOG(Log::System, "Unable to allocate for vertices"); + ERROR_LOG(Log::GeDebugger, "Unable to allocate for vertices"); return; } @@ -528,7 +528,7 @@ void DumpExecute::Vertices(u32 ptr, u32 sz) { void DumpExecute::Indices(u32 ptr, u32 sz) { u32 psp = mapping_.Map(ptr, sz, std::bind(&DumpExecute::SyncStall, this)); if (psp == 0) { - ERROR_LOG(Log::System, "Unable to allocate for indices"); + ERROR_LOG(Log::GeDebugger, "Unable to allocate for indices"); return; } @@ -565,7 +565,7 @@ void DumpExecute::Clut(u32 ptr, u32 sz) { } else { u32 psp = mapping_.Map(ptr, sz, std::bind(&DumpExecute::SyncStall, this)); if (psp == 0) { - ERROR_LOG(Log::System, "Unable to allocate for clut"); + ERROR_LOG(Log::GeDebugger, "Unable to allocate for clut"); return; } @@ -577,7 +577,7 @@ void DumpExecute::Clut(u32 ptr, u32 sz) { void DumpExecute::TransferSrc(u32 ptr, u32 sz) { u32 psp = mapping_.Map(ptr, sz, std::bind(&DumpExecute::SyncStall, this)); if (psp == 0) { - ERROR_LOG(Log::System, "Unable to allocate for transfer"); + ERROR_LOG(Log::GeDebugger, "Unable to allocate for transfer"); return; } @@ -622,7 +622,7 @@ void DumpExecute::Memcpy(u32 ptr, u32 sz) { void DumpExecute::Texture(int level, u32 ptr, u32 sz) { u32 psp = mapping_.Map(ptr, sz, std::bind(&DumpExecute::SyncStall, this)); if (psp == 0) { - ERROR_LOG(Log::System, "Unable to allocate for texture"); + ERROR_LOG(Log::GeDebugger, "Unable to allocate for texture"); return; } @@ -791,7 +791,7 @@ ReplayResult DumpExecute::Run() { break; default: - ERROR_LOG(Log::System, "Unsupported GE dump command: %d", (int)cmd.type); + ERROR_LOG(Log::GeDebugger, "Unsupported GE dump command: %d", (int)cmd.type); return ReplayResult::Error; } } @@ -840,7 +840,7 @@ static u32 LoadReplay(const std::string &filename) { u32 version = header.version; if (memcmp(header.magic, HEADER_MAGIC, sizeof(header.magic)) != 0 || header.version > VERSION || header.version < MIN_VERSION) { - ERROR_LOG(Log::System, "Invalid GE dump or unsupported version"); + ERROR_LOG(Log::GeDebugger, "Invalid GE dump or unsupported version"); pspFileSystem.CloseFile(fp); return 0; } @@ -869,7 +869,7 @@ static u32 LoadReplay(const std::string &filename) { pspFileSystem.CloseFile(fp); if (truncated) { - ERROR_LOG(Log::System, "Truncated GE dump detected - can't replay"); + ERROR_LOG(Log::GeDebugger, "Truncated GE dump detected - can't replay"); return 0; } @@ -921,7 +921,7 @@ ReplayResult RunMountedReplay(const std::string &filename) { } version = LoadReplay(filename); if (!version) { - ERROR_LOG(Log::G3D, "bad version %08x", version); + ERROR_LOG(Log::GeDebugger, "bad version %08x", version); return ReplayResult::Error; } } @@ -971,7 +971,6 @@ ReplayResult RunMountedReplay(const std::string &filename) { u32 execListPos = g_opToExec.param; auto optParam = PSPPointer::Create(0); g_retVal = gpu->EnqueueList(listPC, execListPos, -1, optParam, false, &runList); - INFO_LOG(Log::G3D, "Enqueued: dl=%d", g_retVal); if (runList) { hleSplitSyscallOverGe(); } diff --git a/GPU/Debugger/Stepping.cpp b/GPU/Debugger/Stepping.cpp index d952a23a0b..122cde8714 100644 --- a/GPU/Debugger/Stepping.cpp +++ b/GPU/Debugger/Stepping.cpp @@ -102,7 +102,7 @@ static void RunPauseAction() { return; } - INFO_LOG(Log::G3D, "RunPauseAction: %s", PauseActionToString(pauseAction)); + DEBUG_LOG(Log::GeDebugger, "RunPauseAction: %s", PauseActionToString(pauseAction)); switch (pauseAction) { case PAUSE_BREAK: @@ -141,7 +141,8 @@ static void RunPauseAction() { break; default: - ERROR_LOG(Log::G3D, "Unsupported pause action, forgot to add it to the switch."); + ERROR_LOG(Log::GeDebugger, "Unsupported pause action, forgot to add it to the switch."); + break; } actionComplete = true; @@ -185,7 +186,7 @@ bool ProcessStepping() { if (pauseAction == PAUSE_CONTINUE) { // This is fine, can just mean to run to the next breakpoint/event. - INFO_LOG(Log::G3D, "Continuing..."); + DEBUG_LOG(Log::GeDebugger, "Continuing..."); actionComplete = true; actionWait.notify_all(); coreState = CORE_RUNNING_GE; diff --git a/GPU/Debugger/Stepping.h b/GPU/Debugger/Stepping.h index 38c192b8f3..1393ffc7c7 100644 --- a/GPU/Debugger/Stepping.h +++ b/GPU/Debugger/Stepping.h @@ -30,7 +30,6 @@ namespace GPUStepping { bool EnterStepping(); bool IsStepping(); void ResumeFromStepping(); - void WaitForAction(); int GetSteppingCounter();