summaryrefslogtreecommitdiff
path: root/Source/Core/Common/JitRegister.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@innovatetechnologi.es>2017-08-25 20:59:31 +0200
committerLéo Lam <leo@innovatetechnologi.es>2017-09-10 11:42:12 +0200
commit8cd8e9d905694eb4b892cecee7fcb2f6e0f46103 (patch)
tree7d9bb2a407256ed4b15e38763dd243a00b508bdc /Source/Core/Common/JitRegister.cpp
parent432117047b9c4693ad74b78d5a7d21aedd10f455 (diff)
JIT: Don't always look up symbols for blocks
With tons of symbols, this results in noticeable stuttering, so skip lookups if the perf dir option isn't set anyway.
Diffstat (limited to 'Source/Core/Common/JitRegister.cpp')
-rw-r--r--Source/Core/Common/JitRegister.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/Core/Common/JitRegister.cpp b/Source/Core/Common/JitRegister.cpp
index 61d7e05685..08b93e39da 100644
--- a/Source/Core/Common/JitRegister.cpp
+++ b/Source/Core/Common/JitRegister.cpp
@@ -37,10 +37,13 @@ static File::IOFile s_perf_map_file;
namespace JitRegister
{
+static bool s_is_enabled = false;
+
void Init(const std::string& perf_dir)
{
#if defined USE_OPROFILE && USE_OPROFILE
s_agent = op_open_agent();
+ s_is_enabled = true;
#endif
if (!perf_dir.empty() || getenv("PERF_BUILDID_DIR"))
@@ -51,6 +54,7 @@ void Init(const std::string& perf_dir)
// Disable buffering in order to avoid missing some mappings
// if the event of a crash:
std::setvbuf(s_perf_map_file.GetHandle(), nullptr, _IONBF, 0);
+ s_is_enabled = true;
}
}
@@ -67,6 +71,13 @@ void Shutdown()
if (s_perf_map_file.IsOpen())
s_perf_map_file.Close();
+
+ s_is_enabled = false;
+}
+
+bool IsEnabled()
+{
+ return s_is_enabled;
}
void RegisterV(const void* base_address, u32 code_size, const char* format, va_list args)