added some code for easy profiling of changes on the EE. can be enabled by uncommenting the #define EEPROFILING in r5900.h

This commit is contained in:
refractionpcsx2
2008-04-29 21:26:21 +00:00
parent f2760b983d
commit a2ae29d6c0
2 changed files with 33 additions and 4 deletions

View File

@@ -23,6 +23,9 @@
#include "PsxCommon.h"
#include "GS.h"
u64 profile_starttick = 0;
u64 profile_totalticks = 0;
int gates = 0;
extern u8 psxhblankgate;
int hblankend = 0;
@@ -265,10 +268,12 @@ void VSync()
SysUpdate();
} else { // VSync Start (240 hsyncs)
//UpdateVSyncRateEnd();
/*if( (iFrame%20) == 0 ) {
SysPrintf("Cycles for unpacks at %d frames %x\n", iFrame, unpacktotal);
unpacktotal = 0;
}*/
#ifdef EE_PROFILING
if( (iFrame%20) == 0 ) {
SysPrintf("Profiled Cycles at %d frames %d\n", iFrame, profile_totalticks);
CLEAR_EE_PROFILE();
}
#endif
//SysPrintf("c: %x, %x\n", cpuRegs.cycle, *(u32*)&VU1.Micro[16]);
@@ -613,6 +618,7 @@ void rcntUpdate()
rcntSet();
}

View File

@@ -277,5 +277,28 @@ extern u32 g_EEFreezeRegs;
#define EXC_TLB_STORE 1
#define EXC_TLB_LOAD 0
//#define EE_PROFILING //EE Profiling enable
#ifdef EE_PROFILING //EE Profiling code
extern u64 profile_starttick;
extern u64 profile_totalticks;
#define START_EE_PROFILE() \
profile_starttick = GetCPUTick();
#define END_EE_PROFILE() \
profile_totalticks += GetCPUTick()-profile_starttick;
#define CLEAR_EE_PROFILE() \
profile_totalticks = 0;
#else
#define START_EE_PROFILE()
#define END_EE_PROFILE()
#define CLEAR_EE_PROFILE()
#endif
#endif /* __R5900_H__ */