Cleam up thread names a bit, name the Main thread.

Also makes some logging VERBOSE.
This commit is contained in:
Henrik Rydgard 2014-06-29 12:53:03 +02:00
parent fe4246452c
commit 38609f3e6b
13 changed files with 23 additions and 14 deletions

View File

@ -20,6 +20,7 @@
#include <string> // System: To be able to add strings with "+"
#include <math.h>
#ifdef _WIN32
#include <process.h>
#include "CommonWindows.h"
#include <array>
#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;

View File

@ -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));
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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)) {

View File

@ -113,7 +113,7 @@ namespace DSound
unsigned int WINAPI soundThread(void *)
{
setCurrentThreadName("DSoundThread");
setCurrentThreadName("DSound");
currentPos = 0;
lastPos = 0;
//writeDataToBuffer(0,realtimeBuffer,bufferSize);

View File

@ -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.

View File

@ -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);
}

View File

@ -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);

View File

@ -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();

2
lang

@ -1 +1 @@
Subproject commit 86099719d90e68f3b25681e088f0708982e25eda
Subproject commit 9823efad0408c743df91a15b5ea0fc0e4e383621

2
native

@ -1 +1 @@
Subproject commit 320f5f1952c1c462e67c634af7455105967fc602
Subproject commit e65160102599ddbce3410ec17f39364b93e22424

@ -1 +1 @@
Subproject commit 2f17852afb6cd878598323c70584bf3067c8c5ec
Subproject commit aa7c731d93e0de1433cc65511e94bd3ea5682043