mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-13 07:49:19 +01:00
Linux: detect perf and default map dir to /tmp
This obviously only works when Dolphin is run by perf rather than being started separately.
This commit is contained in:
parent
e955a3a191
commit
19a490a82d
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user