Remove obsolete accounting for time spent stepping the GE (we no longer block)

This commit is contained in:
Henrik Rydgård 2024-12-12 17:57:43 +01:00
parent 07e6c35532
commit a858032e46
6 changed files with 12 additions and 47 deletions

View file

@ -758,16 +758,11 @@ void *GetQuickSyscallFunc(MIPSOpcode op) {
return (void *)&CallSyscallWithoutFlags;
}
void hleSetSteppingTime(double t) {
hleSteppingTime += t;
}
void hleSetFlipTime(double t) {
hleFlipTime = t;
}
void CallSyscall(MIPSOpcode op)
{
void CallSyscall(MIPSOpcode op) {
PROFILE_THIS_SCOPE("syscall");
double start = 0.0; // need to initialize to fix the race condition where coreCollectDebugStats is enabled in the middle of this func.
if (coreCollectDebugStats) {
@ -797,11 +792,10 @@ void CallSyscall(MIPSOpcode op)
u32 callno = (op >> 6) & 0xFFFFF; //20 bits
int funcnum = callno & 0xFFF;
int modulenum = (callno & 0xFF000) >> 12;
double total = time_now_d() - start - hleSteppingTime;
double total = time_now_d() - start;
if (total >= hleFlipTime)
total -= hleFlipTime;
_dbg_assert_msg_(total >= 0.0, "Time spent in syscall became negative");
hleSteppingTime = 0.0;
hleFlipTime = 0.0;
updateSyscallStats(modulenum, funcnum, total);
}

View file

@ -114,8 +114,6 @@ void hleRunInterrupts();
void hleDebugBreak();
// Don't set temp regs to 0xDEADBEEF.
void hleSkipDeadbeef();
// Set time spent in debugger (for more useful debug stats while debugging.)
void hleSetSteppingTime(double t);
// Set time spent in realtime sync.
void hleSetFlipTime(double t);
// Check if the current syscall context is kernel.

View file

@ -213,10 +213,6 @@ public:
virtual GPUDebugOp DisassembleOp(u32 pc, u32 op) = 0;
virtual std::vector<GPUDebugOp> DisassembleOpRange(u32 startpc, u32 endpc) = 0;
// Enter/exit stepping mode. Mainly for better debug stats on time taken.
virtual void NotifySteppingEnter() = 0;
virtual void NotifySteppingExit() = 0;
virtual u32 GetRelativeAddress(u32 data) = 0;
virtual u32 GetVertexAddress() = 0;
virtual u32 GetIndexAddress() = 0;

View file

@ -21,6 +21,7 @@
#include "Common/Log.h"
#include "Common/Thread/ThreadUtil.h"
#include "Core/Core.h"
#include "Core/HW/Display.h"
#include "GPU/Common/GPUDebugInterface.h"
#include "GPU/Debugger/Stepping.h"
#include "GPU/GPUState.h"
@ -44,6 +45,10 @@ static bool isStepping;
// Number of times we've entered stepping, to detect a resume asynchronously.
static int stepCounter = 0;
// Debug stats.
static double g_timeSteppingStarted;
static double g_timeSpentStepping;
static std::mutex pauseLock;
static PauseAction pauseAction = PAUSE_CONTINUE;
static std::mutex actionLock;
@ -162,13 +167,11 @@ static void StartStepping() {
// Play it safe so we don't keep resetting.
lastGState.cmdmem[1] |= 0x01000000;
}
gpuDebug->NotifySteppingEnter();
isStepping = true;
stepCounter++;
}
static void StopStepping() {
gpuDebug->NotifySteppingExit();
lastGState = gstate;
isStepping = false;
}

View file

@ -44,6 +44,7 @@
#include "GPU/Common/TextureCacheCommon.h"
#include "GPU/Debugger/Debugger.h"
#include "GPU/Debugger/Record.h"
#include "GPU/Debugger/Stepping.h"
void GPUCommon::Flush() {
drawEngineCommon_->DispatchFlush();
@ -105,7 +106,6 @@ void GPUCommon::Reinitialize() {
isbreak = false;
drawCompleteTicks = 0;
busyTicks = 0;
timeSpentStepping_ = 0.0;
interruptsEnabled_ = true;
if (textureCache_)
@ -615,23 +615,6 @@ u32 GPUCommon::Break(int mode) {
return currentList->id;
}
void GPUCommon::NotifySteppingEnter() {
if (coreCollectDebugStats) {
timeSteppingStarted_ = time_now_d();
}
}
void GPUCommon::NotifySteppingExit() {
if (coreCollectDebugStats) {
if (timeSteppingStarted_ <= 0.0) {
ERROR_LOG(Log::G3D, "Mismatched stepping enter/exit.");
}
double total = time_now_d() - timeSteppingStarted_;
_dbg_assert_msg_(total >= 0.0, "Time spent stepping became negative");
timeSpentStepping_ += total;
timeSteppingStarted_ = 0.0;
}
}
bool GPUCommon::InterpretList(DisplayList &list) {
// Initialized to avoid a race condition with bShowDebugStats changing.
double start = 0.0;
@ -683,6 +666,9 @@ bool GPUCommon::InterpretList(DisplayList &list) {
FinishDeferred();
_dbg_assert_(!GPURecord::IsActive());
gpuState = GPUSTATE_BREAK;
if (coreCollectDebugStats) {
gpuStats.msProcessingDisplayLists += time_now_d() - start;
}
return false;
}
}
@ -706,12 +692,7 @@ bool GPUCommon::InterpretList(DisplayList &list) {
list.offsetAddr = gstate_c.offsetAddr;
if (coreCollectDebugStats) {
double total = time_now_d() - start - timeSpentStepping_;
_dbg_assert_msg_(total >= 0.0, "Time spent DL processing became negative");
hleSetSteppingTime(timeSpentStepping_);
DisplayNotifySleep(timeSpentStepping_);
timeSpentStepping_ = 0.0;
gpuStats.msProcessingDisplayLists += total;
gpuStats.msProcessingDisplayLists += time_now_d() - start;
}
return gpuState == GPUSTATE_DONE || gpuState == GPUSTATE_ERROR;
}

View file

@ -349,9 +349,6 @@ public:
GPUDebugOp DisassembleOp(u32 pc, u32 op) override;
std::vector<GPUDebugOp> DisassembleOpRange(u32 startpc, u32 endpc) override;
void NotifySteppingEnter() override;
void NotifySteppingExit() override;
u32 GetRelativeAddress(u32 data) override;
u32 GetVertexAddress() override;
u32 GetIndexAddress() override;
@ -510,8 +507,4 @@ private:
void PopDLQueue();
void CheckDrawSync();
int GetNextListIndex();
// Debug stats.
double timeSteppingStarted_;
double timeSpentStepping_;
};