summaryrefslogtreecommitdiff
path: root/simpleperf/thread_tree.cpp
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2016-06-23 17:11:14 -0700
committerYabin Cui <yabinc@google.com>2016-06-23 17:26:25 -0700
commit1761a271faf98050891ba6e918993225782c811a (patch)
treea97f1ecc2a0e7a16222229d9468d77c43d03c168 /simpleperf/thread_tree.cpp
parent965a99e493aea5ec88bda89629e969e3226c262c (diff)
downloadextras-1761a271faf98050891ba6e918993225782c811a.tar.gz
Simpleperf: Add SPLIT and SPLIT_END records to handle big records.
Previously we split KernelSymbolRecord because it is > 65535. Then I found TracingDataRecord can also be > 65535. So it is better to handle big records when reading and writing perf.data. record_file_writer.cpp splits a big record into multiple SPLIT records followed by a SPLIT_END record, and record_file_reader.cpp restores the big record when reading SPLIT and SPLIT_END records. Also Add RecordHeader to represent record having size > 65535. Bug: 29581559 Change-Id: I0b4556988f77b3431c7f1a28fce65cf225d6a067 Test: run simpleperf_unit_test.
Diffstat (limited to 'simpleperf/thread_tree.cpp')
-rw-r--r--simpleperf/thread_tree.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/simpleperf/thread_tree.cpp b/simpleperf/thread_tree.cpp
index 58b02006..8e4e9e9d 100644
--- a/simpleperf/thread_tree.cpp
+++ b/simpleperf/thread_tree.cpp
@@ -253,12 +253,7 @@ void ThreadTree::Update(const Record& record) {
ForkThread(r.data.pid, r.data.tid, r.data.ppid, r.data.ptid);
} else if (record.type() == SIMPLE_PERF_RECORD_KERNEL_SYMBOL) {
const auto& r = *static_cast<const KernelSymbolRecord*>(&record);
- static std::string kallsyms;
- kallsyms += r.kallsyms;
- if (r.end_of_symbols) {
- Dso::SetKallsyms(std::move(kallsyms));
- kallsyms.clear();
- }
+ Dso::SetKallsyms(std::move(r.kallsyms));
} else if (record.type() == SIMPLE_PERF_RECORD_DSO) {
auto& r = *static_cast<const DsoRecord*>(&record);
Dso* dso = nullptr;