diff --git a/Common/ConsoleListener.cpp b/Common/ConsoleListener.cpp index 069270606f..63d943d137 100644 --- a/Common/ConsoleListener.cpp +++ b/Common/ConsoleListener.cpp @@ -20,6 +20,7 @@ #include // System: To be able to add strings with "+" #include #ifdef _WIN32 +#include #include "CommonWindows.h" #include #else @@ -293,7 +294,7 @@ COORD ConsoleListener::GetCoordinates(int BytesRead, int BufferWidth) unsigned int WINAPI ConsoleListener::RunThread(void *lpParam) { - setCurrentThreadName("ConsoleThread"); + setCurrentThreadName("Console"); ConsoleListener *consoleLog = (ConsoleListener *)lpParam; consoleLog->LogWriterThread(); return 0; diff --git a/Core/HLE/sceIo.cpp b/Core/HLE/sceIo.cpp index f62666f916..42467ae9c5 100644 --- a/Core/HLE/sceIo.cpp +++ b/Core/HLE/sceIo.cpp @@ -425,7 +425,7 @@ static VFSFileSystem *flash0System = NULL; #endif void __IoManagerThread() { - setCurrentThreadName("IOThread"); + setCurrentThreadName("IO"); while (ioManagerThreadEnabled && coreState != CORE_ERROR && coreState != CORE_POWERDOWN) { ioManager.RunEventsUntil(CoreTiming::GetTicks() + msToCycles(1000)); } diff --git a/Core/HLE/sceKernelSemaphore.cpp b/Core/HLE/sceKernelSemaphore.cpp index a78b6cce9e..1a88499c86 100644 --- a/Core/HLE/sceKernelSemaphore.cpp +++ b/Core/HLE/sceKernelSemaphore.cpp @@ -295,7 +295,7 @@ int sceKernelSignalSema(SceUID id, int signal) { if (s->ns.currentCount + signal - (int) s->waitingThreads.size() > s->ns.maxCount) { - DEBUG_LOG(SCEKERNEL, "sceKernelSignalSema(%i, %i): overflow (at %i)", id, signal, s->ns.currentCount); + VERBOSE_LOG(SCEKERNEL, "sceKernelSignalSema(%i, %i): overflow (at %i)", id, signal, s->ns.currentCount); return SCE_KERNEL_ERROR_SEMA_OVF; } diff --git a/Core/HLE/sceKernelTime.cpp b/Core/HLE/sceKernelTime.cpp index 29e7cbd95e..087e8f115b 100644 --- a/Core/HLE/sceKernelTime.cpp +++ b/Core/HLE/sceKernelTime.cpp @@ -79,7 +79,7 @@ u32 sceKernelGetSystemTimeLow() u64 sceKernelGetSystemTimeWide() { u64 t = CoreTiming::GetGlobalTimeUsScaled(); - DEBUG_LOG(SCEKERNEL,"%i=sceKernelGetSystemTimeWide()",(u32)t); + VERBOSE_LOG(SCEKERNEL,"%i=sceKernelGetSystemTimeWide()",(u32)t); hleEatCycles(250); hleReSchedule("system time"); return t; @@ -87,7 +87,7 @@ u64 sceKernelGetSystemTimeWide() int sceKernelUSec2SysClock(u32 usec, u32 clockPtr) { - DEBUG_LOG(SCEKERNEL,"sceKernelUSec2SysClock(%i, %08x)", usec, clockPtr); + VERBOSE_LOG(SCEKERNEL, "sceKernelUSec2SysClock(%i, %08x)", usec, clockPtr); if (Memory::IsValidAddress(clockPtr)) Memory::Write_U64((usec & 0xFFFFFFFFL), clockPtr); hleEatCycles(165); @@ -96,7 +96,7 @@ int sceKernelUSec2SysClock(u32 usec, u32 clockPtr) u64 sceKernelUSec2SysClockWide(u32 usec) { - DEBUG_LOG(SCEKERNEL, "sceKernelUSec2SysClockWide(%i)", usec); + VERBOSE_LOG(SCEKERNEL, "sceKernelUSec2SysClockWide(%i)", usec); hleEatCycles(150); return usec; } diff --git a/Core/System.cpp b/Core/System.cpp index 8117e11c1b..437b1f6716 100644 --- a/Core/System.cpp +++ b/Core/System.cpp @@ -250,7 +250,7 @@ void CPU_Shutdown() { } void CPU_RunLoop() { - setCurrentThreadName("CPUThread"); + setCurrentThreadName("CPU"); FPU_SetFastMode(); if (!CPU_NextState(CPU_THREAD_PENDING, CPU_THREAD_STARTING)) { diff --git a/Windows/DSoundStream.cpp b/Windows/DSoundStream.cpp index c9fbe59d9d..390d20a281 100644 --- a/Windows/DSoundStream.cpp +++ b/Windows/DSoundStream.cpp @@ -113,7 +113,7 @@ namespace DSound unsigned int WINAPI soundThread(void *) { - setCurrentThreadName("DSoundThread"); + setCurrentThreadName("DSound"); currentPos = 0; lastPos = 0; //writeDataToBuffer(0,realtimeBuffer,bufferSize); diff --git a/Windows/EmuThread.cpp b/Windows/EmuThread.cpp index 7e6412ae2c..35d7cd2633 100644 --- a/Windows/EmuThread.cpp +++ b/Windows/EmuThread.cpp @@ -82,7 +82,7 @@ unsigned int WINAPI TheThread(void *) { _InterlockedExchange(&emuThreadReady, THREAD_INIT); - setCurrentThreadName("EmuThread"); + setCurrentThreadName("Emu"); // And graphics... // Native overwrites host. Can't allow that. diff --git a/Windows/InputDevice.cpp b/Windows/InputDevice.cpp index cdfebc7899..3e781102fb 100644 --- a/Windows/InputDevice.cpp +++ b/Windows/InputDevice.cpp @@ -37,6 +37,9 @@ static condition_variable inputEndCond; extern InputState input_state; inline static void ExecuteInputPoll() { + // Hm, we may hold the input_state lock for quite a while (time it takes to poll all devices)... + // If that becomes an issue, maybe should poll to a copy of inputstate and only hold the lock while + // copying that one to the real one? lock_guard guard(input_state.lock); input_state.pad_buttons = 0; input_state.pad_lstick_x = 0; @@ -50,7 +53,7 @@ inline static void ExecuteInputPoll() { } static void RunInputThread() { - setCurrentThreadName("InputThread"); + setCurrentThreadName("Input"); // NOTE: The keyboard and mouse buttons are handled via raw input, not here. // This is mainly for controllers which need to be polled, instead of generating events. @@ -58,7 +61,7 @@ static void RunInputThread() { while (inputThreadEnabled) { ExecuteInputPoll(); - // Update 250 times per second. + // Try to update 250 times per second. Sleep(4); } diff --git a/Windows/WndMainWindow.cpp b/Windows/WndMainWindow.cpp index 4bed7b075a..78979f1a99 100644 --- a/Windows/WndMainWindow.cpp +++ b/Windows/WndMainWindow.cpp @@ -33,6 +33,7 @@ #include "i18n/i18n.h" #include "input/input_state.h" #include "input/keycodes.h" +#include "thread/threadutil.h" #include "util/text/utf8.h" #include "Core/Debugger/SymbolMap.h" @@ -221,6 +222,7 @@ namespace MainWindow { } static void ResizeDisplay(bool noWindowMovement = false) { + AssertCurrentThreadName("Main"); int width = 0, height = 0; RECT rc; GetClientRect(hwndMain, &rc); diff --git a/Windows/main.cpp b/Windows/main.cpp index 2c227b7794..255bd985ad 100644 --- a/Windows/main.cpp +++ b/Windows/main.cpp @@ -23,6 +23,7 @@ #include "file/vfs.h" #include "file/zip_read.h" #include "base/NativeApp.h" +#include "thread/threadutil.h" #include "util/text/utf8.h" #include "Core/Config.h" @@ -235,6 +236,8 @@ void MakePPSSPPDPIAware() int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLine, int iCmdShow) { + setCurrentThreadName("Main"); + // Windows Vista and above: alert Windows that PPSSPP is DPI aware, // so that we don't flicker in fullscreen on some PCs. MakePPSSPPDPIAware(); diff --git a/lang b/lang index 86099719d9..9823efad04 160000 --- a/lang +++ b/lang @@ -1 +1 @@ -Subproject commit 86099719d90e68f3b25681e088f0708982e25eda +Subproject commit 9823efad0408c743df91a15b5ea0fc0e4e383621 diff --git a/native b/native index 320f5f1952..e651601025 160000 --- a/native +++ b/native @@ -1 +1 @@ -Subproject commit 320f5f1952c1c462e67c634af7455105967fc602 +Subproject commit e65160102599ddbce3410ec17f39364b93e22424 diff --git a/pspautotests b/pspautotests index 2f17852afb..aa7c731d93 160000 --- a/pspautotests +++ b/pspautotests @@ -1 +1 @@ -Subproject commit 2f17852afb6cd878598323c70584bf3067c8c5ec +Subproject commit aa7c731d93e0de1433cc65511e94bd3ea5682043