summaryrefslogtreecommitdiff
path: root/simpleperf/environment.cpp
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2020-07-23 15:30:14 -0700
committerYabin Cui <yabinc@google.com>2020-07-28 16:13:11 -0700
commite32ed2b96ed8692f4071b36640322600d344c1e3 (patch)
treeac39a9c593acca23c9c9e5d05a7547404eaae232 /simpleperf/environment.cpp
parent682156e46d861038047f382cdfe86b10abf52e07 (diff)
downloadextras-e32ed2b96ed8692f4071b36640322600d344c1e3.tar.gz
simpleperf: dump jit symfiles to a single file.
Currently, each jit symfile is dumped to a distinct temporary file. This creates many temporary files, having two drawbacks: 1. It leaves many junk files if simpleperf is killed in the middle. 2. The names of the temporary files change in different recording files, making them harder to compare. This CL fixes it by making changes below: 1. Store jit symfiles in a single file. The location of a symfile is passed via a special path format: <file_path>:<file_start>-<file_end>. So the unwinder and ElfFile class can read it correctly. 2. Add Dso::GetReportPath() to give a unified name for jit symfiles. And use it in different reporting methods. Also split JITDebugReader::ReadProcess() into smaller functions. Bug: 159155297 Test: run simpleperf_unit_test Test: run simpleperf manually Change-Id: I37cd1888b855b4b88bb83e453e39230b96fb304f
Diffstat (limited to 'simpleperf/environment.cpp')
-rw-r--r--simpleperf/environment.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/simpleperf/environment.cpp b/simpleperf/environment.cpp
index b779aba1..5873f56b 100644
--- a/simpleperf/environment.cpp
+++ b/simpleperf/environment.cpp
@@ -863,6 +863,10 @@ std::unique_ptr<TemporaryFile> ScopedTempFiles::CreateTempFile(bool delete_in_de
return tmp_file;
}
+void ScopedTempFiles::RegisterTempFile(const std::string& path) {
+ files_to_delete_.emplace_back(path);
+}
+
bool SignalIsIgnored(int signo) {
struct sigaction act;
if (sigaction(signo, nullptr, &act) != 0) {