From 5d0316db6f94f7e4555e31595b0a609f89e08a5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 3 Dec 2024 21:08:37 +0100 Subject: [PATCH] Tune some log verbosity, remove timestamp on outputdebugstring logs --- Common/Log/LogManager.cpp | 5 ++--- Core/HLE/HLE.cpp | 3 ++- Core/Util/BlockAllocator.cpp | 6 +++--- GPU/GPUCommon.cpp | 6 +++--- UWP/PPSSPP_UWPMain.cpp | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Common/Log/LogManager.cpp b/Common/Log/LogManager.cpp index 9cbd6f58b8..95183389f8 100644 --- a/Common/Log/LogManager.cpp +++ b/Common/Log/LogManager.cpp @@ -114,8 +114,6 @@ void LogManager::Init(bool *enabledSetting, bool headless) { } initialized_ = true; - g_bLogEnabledSetting = enabledSetting; - _dbg_assert_(ARRAY_SIZE(g_logTypeNames) == (size_t)Log::NUMBER_OF_LOGS); for (size_t i = 0; i < ARRAY_SIZE(g_logTypeNames); i++) { @@ -370,7 +368,8 @@ void FileLogListener::Log(const LogMessage &message) { void OutputDebugStringLogListener::Log(const LogMessage &message) { char buffer[4096]; - snprintf(buffer, sizeof(buffer), "%s %s %s", message.timestamp, message.header, message.msg.c_str()); + // We omit the timestamp for easy copy-paste-diffing. + snprintf(buffer, sizeof(buffer), "%s %s", message.header, message.msg.c_str()); #if _MSC_VER OutputDebugStringUTF8(buffer); #endif diff --git a/Core/HLE/HLE.cpp b/Core/HLE/HLE.cpp index cdc8a8d7ba..24c5acad3c 100644 --- a/Core/HLE/HLE.cpp +++ b/Core/HLE/HLE.cpp @@ -697,7 +697,8 @@ void *GetQuickSyscallFunc(MIPSOpcode op) { const HLEFunction *info = GetSyscallFuncPointer(op); if (!info || !info->func) return nullptr; - DEBUG_LOG(Log::HLE, "Compiling syscall to %s", info->name); + + VERBOSE_LOG(Log::HLE, "Compiling syscall to '%s'", info->name); // TODO: Do this with a flag? if (op == idleOp) diff --git a/Core/Util/BlockAllocator.cpp b/Core/Util/BlockAllocator.cpp index e580c2eb7a..b2b30c2314 100644 --- a/Core/Util/BlockAllocator.cpp +++ b/Core/Util/BlockAllocator.cpp @@ -222,12 +222,12 @@ u32 BlockAllocator::AllocAt(u32 position, u32 size, const char *tag) void BlockAllocator::MergeFreeBlocks(Block *fromBlock) { - DEBUG_LOG(Log::sceKernel, "Merging Blocks"); + VERBOSE_LOG(Log::sceKernel, "Merging Blocks"); Block *prev = fromBlock->prev; while (prev != NULL && prev->taken == false) { - DEBUG_LOG(Log::sceKernel, "Block Alloc found adjacent free blocks - merging"); + VERBOSE_LOG(Log::sceKernel, "Block Alloc found adjacent free blocks - merging"); prev->size += fromBlock->size; if (fromBlock->next == NULL) top_ = prev; @@ -247,7 +247,7 @@ void BlockAllocator::MergeFreeBlocks(Block *fromBlock) Block *next = fromBlock->next; while (next != NULL && next->taken == false) { - DEBUG_LOG(Log::sceKernel, "Block Alloc found adjacent free blocks - merging"); + VERBOSE_LOG(Log::sceKernel, "Block Alloc found adjacent free blocks - merging"); fromBlock->size += next->size; fromBlock->next = next->next; delete next; diff --git a/GPU/GPUCommon.cpp b/GPU/GPUCommon.cpp index ca32367867..31bd1d55b4 100644 --- a/GPU/GPUCommon.cpp +++ b/GPU/GPUCommon.cpp @@ -857,13 +857,13 @@ DLResult GPUCommon::ProcessDLQueue(DLRunType run, DLStepType step) { for (int listIndex = GetNextListIndex(); listIndex != -1; listIndex = GetNextListIndex()) { DisplayList &l = dls[listIndex]; - DEBUG_LOG(Log::G3D, "Starting DL execution at %08x - stall = %08x", l.pc, l.stall); + DEBUG_LOG(Log::G3D, "Starting DL execution at %08x - stall = %08x (startingTicks=%d)", l.pc, l.stall, startingTicks); if (!InterpretList(l)) { return DLResult::Error; } - // Some other list could've taken the spot while we dilly-dallied around. - // LATER: Hm, really? Not unless we start time-slicing... + // Some other list could've taken the spot while we dilly-dallied around, so we need the check. + // Yes, this does happen. if (l.state != PSP_GE_DL_STATE_QUEUED) { // At the end, we can remove it from the queue and continue. dlQueue.erase(std::remove(dlQueue.begin(), dlQueue.end(), listIndex), dlQueue.end()); diff --git a/UWP/PPSSPP_UWPMain.cpp b/UWP/PPSSPP_UWPMain.cpp index e98fc63a7b..7312944275 100644 --- a/UWP/PPSSPP_UWPMain.cpp +++ b/UWP/PPSSPP_UWPMain.cpp @@ -72,10 +72,10 @@ PPSSPP_UWPMain::PPSSPP_UWPMain(App ^app, const std::shared_ptrSetAllLogLevels(LogLevel::LDEBUG); + g_logManager.SetAllLogLevels(LogLevel::LDEBUG); if (g_Config.bEnableLogging) { - LogManager::GetInstance()->ChangeFileLog(GetLogFile().c_str()); + g_logManager.ChangeFileLog(GetLogFile().c_str()); } #endif