DolphinQt: Access Software JIT Profiling
This commit is contained in:
parent
30c63fa4a6
commit
6dad5cee65
|
@ -15,9 +15,12 @@
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
|
||||||
|
#include <fmt/format.h>
|
||||||
|
|
||||||
#include "Common/Align.h"
|
#include "Common/Align.h"
|
||||||
#include "Common/CommonPaths.h"
|
#include "Common/CommonPaths.h"
|
||||||
#include "Common/FileUtil.h"
|
#include "Common/FileUtil.h"
|
||||||
|
#include "Common/IOFile.h"
|
||||||
#include "Common/StringUtil.h"
|
#include "Common/StringUtil.h"
|
||||||
|
|
||||||
#include "Core/AchievementManager.h"
|
#include "Core/AchievementManager.h"
|
||||||
|
@ -150,6 +153,7 @@ void MenuBar::OnEmulationStateChanged(Core::State state)
|
||||||
!Core::System::GetInstance().GetMovie().IsPlayingInput());
|
!Core::System::GetInstance().GetMovie().IsPlayingInput());
|
||||||
|
|
||||||
// JIT
|
// JIT
|
||||||
|
const bool jit_exists = Core::System::GetInstance().GetJitInterface().GetCore() != nullptr;
|
||||||
m_jit_interpreter_core->setEnabled(running);
|
m_jit_interpreter_core->setEnabled(running);
|
||||||
m_jit_block_linking->setEnabled(!running);
|
m_jit_block_linking->setEnabled(!running);
|
||||||
m_jit_disable_cache->setEnabled(!running);
|
m_jit_disable_cache->setEnabled(!running);
|
||||||
|
@ -158,6 +162,7 @@ void MenuBar::OnEmulationStateChanged(Core::State state)
|
||||||
m_jit_clear_cache->setEnabled(running);
|
m_jit_clear_cache->setEnabled(running);
|
||||||
m_jit_log_coverage->setEnabled(!running);
|
m_jit_log_coverage->setEnabled(!running);
|
||||||
m_jit_search_instruction->setEnabled(running);
|
m_jit_search_instruction->setEnabled(running);
|
||||||
|
m_jit_write_cache_log_dump->setEnabled(running && jit_exists);
|
||||||
|
|
||||||
// Symbols
|
// Symbols
|
||||||
m_symbols->setEnabled(running);
|
m_symbols->setEnabled(running);
|
||||||
|
@ -198,6 +203,30 @@ void MenuBar::OnDebugModeToggled(bool enabled)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MenuBar::OnWriteJitBlockLogDump()
|
||||||
|
{
|
||||||
|
const std::string filename = fmt::format("{}{}.txt", File::GetUserPath(D_DUMPDEBUG_JITBLOCKS_IDX),
|
||||||
|
SConfig::GetInstance().GetGameID());
|
||||||
|
File::IOFile f(filename, "w");
|
||||||
|
if (!f)
|
||||||
|
{
|
||||||
|
ModalMessageBox::warning(
|
||||||
|
this, tr("Error"),
|
||||||
|
tr("Failed to open \"%1\" for writing.").arg(QString::fromStdString(filename)));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
auto& system = Core::System::GetInstance();
|
||||||
|
system.GetJitInterface().JitBlockLogDump(Core::CPUThreadGuard{system}, f.GetHandle());
|
||||||
|
if (static bool ignore = false; ignore == false)
|
||||||
|
{
|
||||||
|
const int button_pressed = ModalMessageBox::information(
|
||||||
|
this, tr("Success"), tr("Wrote to \"%1\".").arg(QString::fromStdString(filename)),
|
||||||
|
QMessageBox::Ok | QMessageBox::Ignore);
|
||||||
|
if (button_pressed == QMessageBox::Ignore)
|
||||||
|
ignore = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MenuBar::AddFileMenu()
|
void MenuBar::AddFileMenu()
|
||||||
{
|
{
|
||||||
QMenu* file_menu = addMenu(tr("&File"));
|
QMenu* file_menu = addMenu(tr("&File"));
|
||||||
|
@ -892,6 +921,17 @@ void MenuBar::AddJITMenu()
|
||||||
|
|
||||||
m_jit->addSeparator();
|
m_jit->addSeparator();
|
||||||
|
|
||||||
|
m_jit_profile_blocks = m_jit->addAction(tr("Enable JIT Block Profiling"));
|
||||||
|
m_jit_profile_blocks->setCheckable(true);
|
||||||
|
m_jit_profile_blocks->setChecked(Config::Get(Config::MAIN_DEBUG_JIT_ENABLE_PROFILING));
|
||||||
|
connect(m_jit_profile_blocks, &QAction::toggled, [](bool enabled) {
|
||||||
|
Config::SetBaseOrCurrent(Config::MAIN_DEBUG_JIT_ENABLE_PROFILING, enabled);
|
||||||
|
});
|
||||||
|
m_jit_write_cache_log_dump =
|
||||||
|
m_jit->addAction(tr("Write JIT Block Log Dump"), this, &MenuBar::OnWriteJitBlockLogDump);
|
||||||
|
|
||||||
|
m_jit->addSeparator();
|
||||||
|
|
||||||
m_jit_off = m_jit->addAction(tr("JIT Off (JIT Core)"));
|
m_jit_off = m_jit->addAction(tr("JIT Off (JIT Core)"));
|
||||||
m_jit_off->setCheckable(true);
|
m_jit_off->setCheckable(true);
|
||||||
m_jit_off->setChecked(Config::Get(Config::MAIN_DEBUG_JIT_OFF));
|
m_jit_off->setChecked(Config::Get(Config::MAIN_DEBUG_JIT_OFF));
|
||||||
|
|
|
@ -185,6 +185,7 @@ private:
|
||||||
void OnRecordingStatusChanged(bool recording);
|
void OnRecordingStatusChanged(bool recording);
|
||||||
void OnReadOnlyModeChanged(bool read_only);
|
void OnReadOnlyModeChanged(bool read_only);
|
||||||
void OnDebugModeToggled(bool enabled);
|
void OnDebugModeToggled(bool enabled);
|
||||||
|
void OnWriteJitBlockLogDump();
|
||||||
|
|
||||||
QString GetSignatureSelector() const;
|
QString GetSignatureSelector() const;
|
||||||
|
|
||||||
|
@ -268,6 +269,8 @@ private:
|
||||||
QAction* m_jit_clear_cache;
|
QAction* m_jit_clear_cache;
|
||||||
QAction* m_jit_log_coverage;
|
QAction* m_jit_log_coverage;
|
||||||
QAction* m_jit_search_instruction;
|
QAction* m_jit_search_instruction;
|
||||||
|
QAction* m_jit_profile_blocks;
|
||||||
|
QAction* m_jit_write_cache_log_dump;
|
||||||
QAction* m_jit_off;
|
QAction* m_jit_off;
|
||||||
QAction* m_jit_loadstore_off;
|
QAction* m_jit_loadstore_off;
|
||||||
QAction* m_jit_loadstore_lbzx_off;
|
QAction* m_jit_loadstore_lbzx_off;
|
||||||
|
|
Loading…
Reference in New Issue