diff options
| author | Tillmann Karras <tilkax@gmail.com> | 2015-10-10 16:42:53 +0200 |
|---|---|---|
| committer | Tillmann Karras <tilkax@gmail.com> | 2015-10-10 16:42:53 +0200 |
| commit | 19a490a82d4e82c50ab18fd8d5ac328eecdcac00 (patch) | |
| tree | cab0a90a202887a1116558b89df41fef66c65100 /Source/Core/Common/JitRegister.cpp | |
| parent | e955a3a1910f7648f2577531d62694cab675d616 (diff) | |
Linux: detect perf and default map dir to /tmp
This obviously only works when Dolphin is run by perf rather than being
started separately.
Diffstat (limited to 'Source/Core/Common/JitRegister.cpp')
| -rw-r--r-- | Source/Core/Common/JitRegister.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/Core/Common/JitRegister.cpp b/Source/Core/Common/JitRegister.cpp index 33dbcb52f9..4b8fd0b619 100644 --- a/Source/Core/Common/JitRegister.cpp +++ b/Source/Core/Common/JitRegister.cpp @@ -5,6 +5,7 @@ #include <cinttypes> #include <cstddef> #include <cstdio> +#include <cstdlib> #include <fstream> #include <string> @@ -43,9 +44,10 @@ void Init(const std::string& perf_dir) s_agent = op_open_agent(); #endif - if (!perf_dir.empty()) + if (!perf_dir.empty() || getenv("PERF_BUILDID_DIR")) { - std::string filename = StringFromFormat("%s/perf-%d.map", perf_dir.data(), getpid()); + std::string dir = perf_dir.empty() ? "/tmp" : perf_dir; + std::string filename = StringFromFormat("%s/perf-%d.map", 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: |
