| 16 | } |
| 17 | |
| 18 | void JITSymbols::InitFile() { |
| 19 | // We can't use FILE here since we must be robust against forking processes closing our FD from under us. |
| 20 | #ifdef __ANDROID__ |
| 21 | // Android simpleperf looks in /data/local/tmp instead of /tmp |
| 22 | const auto PerfMap = fextl::fmt::format("/data/local/tmp/perf-{}.map", getpid()); |
| 23 | #else |
| 24 | const auto PerfMap = fextl::fmt::format("/tmp/perf-{}.map", getpid()); |
| 25 | #endif |
| 26 | fd = open(PerfMap.c_str(), O_CREAT | O_TRUNC | O_WRONLY | O_APPEND, 0644); |
| 27 | } |
| 28 | |
| 29 | void JITSymbols::RegisterNamedRegion(const void* HostAddr, uint32_t CodeSize, std::string_view Name) { |
| 30 | if (fd == -1) { |
no test coverage detected