JITSymbols: Grab PID from the frontend

This is necessary to get JIT Symbols working under arm64ec/wow64
This commit is contained in:
Ryan Houdek committed 2026-09-18 17:00:17 -07:00
1 parent ec502b99d8
commit 69a3da4f31
3 files changed
+4 -9

No files matched your search

+2 -7
View File
@@ -15,14 +15,9 @@ JITSymbols::~JITSymbols() {
}
}
void JITSymbols::InitFile() {
void JITSymbols::InitFile(uint32_t ProcessPID) {
// We can't use FILE here since we must be robust against forking processes closing our FD from under us.
#ifdef __ANDROID__
// Android simpleperf looks in /data/local/tmp instead of /tmp
const auto PerfMap = fextl::fmt::format("/data/local/tmp/perf-{}.map", getpid());
#else
const auto PerfMap = fextl::fmt::format("/tmp/perf-{}.map", getpid());
#endif
const auto PerfMap = fextl::fmt::format("/tmp/perf-{}.map", ProcessPID);
fd = open(PerfMap.c_str(), O_CREAT | O_TRUNC | O_WRONLY | O_APPEND, 0644);
}
+1 -1
View File
@@ -35,7 +35,7 @@ public:
JITSymbols();
~JITSymbols();
void InitFile();
void InitFile(uint32_t ProcessPID);
void RegisterNamedRegion(const void* HostAddr, uint32_t CodeSize, std::string_view Name);
void RegisterJITSpace(const void* HostAddr, uint32_t CodeSize);
+1 -1
View File
@@ -90,7 +90,7 @@ ContextImpl::ContextImpl(const FEXCore::HostFeatures& Features)
if (Config.BlockJITNaming() || Config.GlobalJITNaming() || Config.LibraryJITNaming()) {
// Only initialize symbols file if enabled. Ensures we don't pollute /tmp with empty files.
Symbols.InitFile();
Symbols.InitFile(Features.ProcessPID);
}
uint64_t FrequencyCounter = FEXCore::GetCycleCounterFrequency();