diff options
| author | Gabriel Corona <gabriel.corona@enst-bretagne.fr> | 2014-11-24 23:17:31 +0100 |
|---|---|---|
| committer | Gabriel Corona <gabriel.corona@enst-bretagne.fr> | 2014-11-24 23:30:29 +0100 |
| commit | 5b9aeaa686b0ffdf242a656f37ec34cf9a204f1d (patch) | |
| tree | 93d93a99495fd75cda6a0735be7e583d5ec84090 /Source | |
| parent | 9722ae2a5d3e3695b8f0bdeb6f03b5a6682ba3b8 (diff) | |
Use CLI argument for Linux perf JIT support
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/Core/Common/JitRegister.cpp | 8 | ||||
| -rw-r--r-- | Source/Core/Core/CoreParameter.h | 2 | ||||
| -rw-r--r-- | Source/Core/DolphinWX/Main.cpp | 14 |
3 files changed, 20 insertions, 4 deletions
diff --git a/Source/Core/Common/JitRegister.cpp b/Source/Core/Common/JitRegister.cpp index 3dafaac5d7..69ea7e5bba 100644 --- a/Source/Core/Common/JitRegister.cpp +++ b/Source/Core/Common/JitRegister.cpp @@ -5,7 +5,6 @@ #include <cinttypes> #include <cstddef> #include <cstdio> -#include <cstdlib> #include <fstream> #include <string> @@ -13,6 +12,7 @@ #include "Common/FileUtil.h" #include "Common/JitRegister.h" #include "Common/StringUtil.h" +#include "Core/ConfigManager.h" #ifdef _WIN32 #include <process.h> @@ -45,10 +45,10 @@ void Init() s_agent = op_open_agent(); #endif - const char* perf_dir = getenv("DOLPHIN_PERF_DIR"); - if (perf_dir && perf_dir[0]) + const std::string& perf_dir = SConfig::GetInstance().m_LocalCoreStartupParameter.m_perfDir; + if (!perf_dir.empty()) { - std::string filename = StringFromFormat("%s/perf-%d.map", perf_dir, getpid()); + std::string filename = StringFromFormat("%s/perf-%d.map", perf_dir.data(), getpid()); s_perf_map_file.Open(filename, "w"); // Disable buffering in order to avoid missing some mappings // if the event of a crash: diff --git a/Source/Core/Core/CoreParameter.h b/Source/Core/Core/CoreParameter.h index 28686a55bc..f7c4f03fe5 100644 --- a/Source/Core/Core/CoreParameter.h +++ b/Source/Core/Core/CoreParameter.h @@ -243,6 +243,8 @@ struct SCoreStartupParameter std::string m_strGameIniDefaultRevisionSpecific; std::string m_strGameIniLocal; + std::string m_perfDir; + // Constructor just calls LoadDefaults SCoreStartupParameter(); diff --git a/Source/Core/DolphinWX/Main.cpp b/Source/Core/DolphinWX/Main.cpp index 28be496fc2..69aafbad35 100644 --- a/Source/Core/DolphinWX/Main.cpp +++ b/Source/Core/DolphinWX/Main.cpp @@ -142,10 +142,12 @@ bool DolphinApp::OnInit() bool UseLogger = false; bool selectVideoBackend = false; bool selectAudioEmulation = false; + bool selectPerfDir = false; wxString videoBackendName; wxString audioEmulationName; wxString userPath; + wxString perfDir; #if wxUSE_CMDLINE_PARSER // Parse command lines wxCmdLineEntryDesc cmdLineDesc[] = @@ -196,6 +198,11 @@ bool DolphinApp::OnInit() wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL }, { + wxCMD_LINE_OPTION, "P", "perf_dir", + "Directory for Lionux perf perf-$pid.map file", + wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL + }, + { wxCMD_LINE_NONE, nullptr, nullptr, nullptr, wxCMD_LINE_VAL_NONE, 0 } }; @@ -219,6 +226,7 @@ bool DolphinApp::OnInit() BatchMode = parser.Found("batch"); selectVideoBackend = parser.Found("video_backend", &videoBackendName); selectAudioEmulation = parser.Found("audio_emulation", &audioEmulationName); + selectPerfDir = parser.Found("perf_dir", &perfDir); playMovie = parser.Found("movie", &movieFile); if (parser.Found("user", &userPath)) @@ -255,6 +263,12 @@ bool DolphinApp::OnInit() UICommon::CreateDirectories(); UICommon::Init(); + if (selectPerfDir) + { + SConfig::GetInstance().m_LocalCoreStartupParameter.m_perfDir = + WxStrToStr(perfDir); + } + if (selectVideoBackend && videoBackendName != wxEmptyString) SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoBackend = WxStrToStr(videoBackendName); |
