mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-26 07:39:45 -06:00
JitCache: Add WipeBlockProfilingData Function
Accessible from DolphinQt and Android.
This commit is contained in:
@ -117,6 +117,15 @@ void JitBaseBlockCache::RunOnBlocks(const Core::CPUThreadGuard&,
|
||||
f(e.second);
|
||||
}
|
||||
|
||||
void JitBaseBlockCache::WipeBlockProfilingData(const Core::CPUThreadGuard&)
|
||||
{
|
||||
for (const auto& kv : block_map)
|
||||
{
|
||||
if (JitBlock::ProfileData* const profile_data = kv.second.profile_data.get())
|
||||
*profile_data = {};
|
||||
}
|
||||
}
|
||||
|
||||
JitBlock* JitBaseBlockCache::AllocateBlock(u32 em_address)
|
||||
{
|
||||
const u32 physical_address = m_jit.m_mmu.JitCache_TranslateAddress(em_address).address;
|
||||
|
@ -161,6 +161,7 @@ public:
|
||||
u8** GetEntryPoints();
|
||||
JitBlock** GetFastBlockMapFallback();
|
||||
void RunOnBlocks(const Core::CPUThreadGuard& guard, std::function<void(const JitBlock&)> f) const;
|
||||
void WipeBlockProfilingData(const Core::CPUThreadGuard& guard);
|
||||
|
||||
JitBlock* AllocateBlock(u32 em_address);
|
||||
void FinalizeBlock(JitBlock& block, bool block_link, const std::set<u32>& physical_addresses);
|
||||
|
@ -182,6 +182,12 @@ void JitInterface::JitBlockLogDump(const Core::CPUThreadGuard& guard, std::FILE*
|
||||
}
|
||||
}
|
||||
|
||||
void JitInterface::WipeBlockProfilingData(const Core::CPUThreadGuard& guard)
|
||||
{
|
||||
if (m_jit)
|
||||
m_jit->GetBlockCache()->WipeBlockProfilingData(guard);
|
||||
}
|
||||
|
||||
std::variant<JitInterface::GetHostCodeError, JitInterface::GetHostCodeResult>
|
||||
JitInterface::GetHostCode(u32 address) const
|
||||
{
|
||||
|
@ -57,6 +57,7 @@ public:
|
||||
|
||||
void UpdateMembase();
|
||||
void JitBlockLogDump(const Core::CPUThreadGuard& guard, std::FILE* file) const;
|
||||
void WipeBlockProfilingData(const Core::CPUThreadGuard& guard);
|
||||
std::variant<GetHostCodeError, GetHostCodeResult> GetHostCode(u32 address) const;
|
||||
|
||||
// Memory Utilities
|
||||
|
@ -155,7 +155,8 @@ void MenuBar::OnEmulationStateChanged(Core::State state)
|
||||
m_jit_clear_cache->setEnabled(running);
|
||||
m_jit_log_coverage->setEnabled(!running);
|
||||
m_jit_search_instruction->setEnabled(running);
|
||||
m_jit_write_cache_log_dump->setEnabled(running && jit_exists);
|
||||
m_jit_wipe_profiling_data->setEnabled(jit_exists);
|
||||
m_jit_write_cache_log_dump->setEnabled(jit_exists);
|
||||
|
||||
// Symbols
|
||||
m_symbols->setEnabled(running);
|
||||
@ -196,6 +197,12 @@ void MenuBar::OnDebugModeToggled(bool enabled)
|
||||
}
|
||||
}
|
||||
|
||||
void MenuBar::OnWipeJitBlockProfilingData()
|
||||
{
|
||||
auto& system = Core::System::GetInstance();
|
||||
system.GetJitInterface().WipeBlockProfilingData(Core::CPUThreadGuard{system});
|
||||
}
|
||||
|
||||
void MenuBar::OnWriteJitBlockLogDump()
|
||||
{
|
||||
const std::string filename = fmt::format("{}{}.txt", File::GetUserPath(D_DUMPDEBUG_JITBLOCKS_IDX),
|
||||
@ -922,6 +929,8 @@ void MenuBar::AddJITMenu()
|
||||
connect(m_jit_profile_blocks, &QAction::toggled, [](bool enabled) {
|
||||
Config::SetBaseOrCurrent(Config::MAIN_DEBUG_JIT_ENABLE_PROFILING, enabled);
|
||||
});
|
||||
m_jit_wipe_profiling_data = m_jit->addAction(tr("Wipe JIT Block Profiling Data"), this,
|
||||
&MenuBar::OnWipeJitBlockProfilingData);
|
||||
m_jit_write_cache_log_dump =
|
||||
m_jit->addAction(tr("Write JIT Block Log Dump"), this, &MenuBar::OnWriteJitBlockLogDump);
|
||||
|
||||
|
@ -185,6 +185,7 @@ private:
|
||||
void OnRecordingStatusChanged(bool recording);
|
||||
void OnReadOnlyModeChanged(bool read_only);
|
||||
void OnDebugModeToggled(bool enabled);
|
||||
void OnWipeJitBlockProfilingData();
|
||||
void OnWriteJitBlockLogDump();
|
||||
|
||||
QString GetSignatureSelector() const;
|
||||
@ -270,6 +271,7 @@ private:
|
||||
QAction* m_jit_log_coverage;
|
||||
QAction* m_jit_search_instruction;
|
||||
QAction* m_jit_profile_blocks;
|
||||
QAction* m_jit_wipe_profiling_data;
|
||||
QAction* m_jit_write_cache_log_dump;
|
||||
QAction* m_jit_off;
|
||||
QAction* m_jit_loadstore_off;
|
||||
|
Reference in New Issue
Block a user