diff options
author | Yabin Cui <yabinc@google.com> | 2016-10-24 13:38:38 -0700 |
---|---|---|
committer | Yabin Cui <yabinc@google.com> | 2016-10-31 10:40:03 -0700 |
commit | c5b4a3106a0845d1bd8fd2c1b1c724eeb719ec62 (patch) | |
tree | 8d045224b547f708cadcd4c7c23476b0a78e262e /simpleperf/cmd_report.cpp | |
parent | d2fcab88ef855a9a415159b669f7ea7e00f5a575 (diff) | |
download | extras-c5b4a3106a0845d1bd8fd2c1b1c724eeb719ec62.tar.gz |
simpleperf: dump file feature section.
For `record --dump-symbols` option, change from dumping
DsoRecord and SymbolRecord to dumping file feature section.
It is to avoid reading symbols from elf files during recording,
which takes a lot of time. And we don't want to mix optional
data (the symbol tables) with necessary data (the profiling records).
Bug: http://b/32340274
Test: run simpleperf_unit_test.
Test: run simpleperf runtest.py.
Change-Id: I0a387de243afac93486fc885f223a58060ec07f4
Diffstat (limited to 'simpleperf/cmd_report.cpp')
-rw-r--r-- | simpleperf/cmd_report.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/simpleperf/cmd_report.cpp b/simpleperf/cmd_report.cpp index 7fd0f61f..6a043c5f 100644 --- a/simpleperf/cmd_report.cpp +++ b/simpleperf/cmd_report.cpp @@ -629,6 +629,8 @@ bool ReportCommand::ReadEventAttrFromRecordFile() { } bool ReportCommand::ReadFeaturesFromRecordFile() { + // TODO: process features not only for report command, but also for + // other report ways: report_sample, report_lib_interface, etc. std::vector<BuildIdRecord> records = record_file_reader_->ReadBuildIdFeature(); std::vector<std::pair<std::string, BuildId>> build_ids; @@ -637,6 +639,18 @@ bool ReportCommand::ReadFeaturesFromRecordFile() { } Dso::SetBuildIds(build_ids); + if (record_file_reader_->HasFeature(PerfFileFormat::FEAT_FILE)) { + std::string file_path; + uint32_t file_type; + uint64_t min_vaddr; + std::vector<Symbol> symbols; + size_t read_pos = 0; + while (record_file_reader_->ReadFileFeature( + read_pos, &file_path, &file_type, &min_vaddr, &symbols)) { + thread_tree_.AddDsoInfo(file_path, file_type, min_vaddr, &symbols); + } + } + std::string arch = record_file_reader_->ReadFeatureString(PerfFileFormat::FEAT_ARCH); if (!arch.empty()) { |