Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce delays in sceKernelReferThreadProfiler/ReferGlobalProfiler. #17676

Merged
merged 3 commits into from
Jul 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions Core/HLE/sceKernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -681,21 +681,17 @@ struct DebugProfilerRegs {

static u32 sceKernelReferThreadProfiler() {
// This seems to simply has no parameter:
// https://pspdev.github.io/pspsdk/group__ThreadMan.html#ga8fd30da51b9dc0507ac4dae04a7e4a17 ,
// And in testing it just returns null in 55 usec (which is surprisingly long).

// So, we log only if debug logging is enabled, and sleep for a bit.
// https://pspdev.github.io/pspsdk/group__ThreadMan.html#ga8fd30da51b9dc0507ac4dae04a7e4a17
// In testing it just returns null in around 140-150 cycles. See issue #17623.
DEBUG_LOG(SCEKERNEL, "0=sceKernelReferThreadProfiler()");

// The delay has been measured, 53-56 us.
hleEatMicro(55);
hleEatCycles(140);
return 0;
}

static int sceKernelReferGlobalProfiler() {
DEBUG_LOG(SCEKERNEL, "0=sceKernelReferGlobalProfiler()");
// The delay has been measured, 53-56 us.
hleEatMicro(55);
// See sceKernelReferThreadProfiler(), similar.
hleEatCycles(140);
return 0;
}

Expand Down