Merge pull request #5844 from Plagman/plagman/stats_mr

DiskCache: add some SHM stats
This commit is contained in:
LC authored and GitHub committed 2026-08-23 18:08:36 -04:00
commit 44f69f4dd7
2 files changed
+8

No files matched your search

+3
View File
@@ -865,6 +865,7 @@ uintptr_t ContextImpl::CompileBlock(FEXCore::Core::CpuStateFrame* Frame, uint64_
bool DiskCacheHitRelocationsApplied = false;
bool LoadDiskCacheCode = true;
if (Region && Region->FileStartVA != 0) {
FEXCORE_PROFILE_ACCUMULATION(Thread, AccumulatedDiskCacheLookupTime);
Hit = DiskCache.Lookup(Thread, *Region, GuestRIP);
if (Hit) {
DiskCacheHitRelocationsApplied = CodeCache.ApplyCodeRelocations(GuestRIP, std::as_writable_bytes(Hit->HostCode), Hit->Relocations, 0, false);
@@ -888,10 +889,12 @@ uintptr_t ContextImpl::CompileBlock(FEXCore::Core::CpuStateFrame* Frame, uint64_
}
uint64_t ModuleOffset = GuestRIP - Region->FileStartVA;
FEXCORE_PROFILE_INSTANT_INCREMENT(Thread, AccumulatedDiskCacheHitCount, 1);
return reinterpret_cast<uintptr_t>(LoadedCode.EntryPoints[ModuleOffset]);
}
}
}
FEXCORE_PROFILE_INSTANT_INCREMENT(Thread, AccumulatedDiskCacheMissCount, 1);
}
// Accumulate a JIT count now, as even if another thread raced us, it should count as a compile.
+5
View File
@@ -70,6 +70,11 @@ struct ThreadStats {
uint64_t AccumulatedCacheWriteLockTime;
uint64_t AccumulatedJITCount;
uint64_t AccumulatedDiskCacheHitCount;
uint64_t AccumulatedDiskCacheMissCount;
uint64_t AccumulatedDiskCacheLookupTime;
uint64_t Padding;
};
// Ensure 16-byte alignment to take advantage of ARM single-copy atomicity.