summaryrefslogtreecommitdiff
path: root/simpleperf/cmd_report.cpp
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2016-08-04 10:22:17 -0700
committerYabin Cui <yabinc@google.com>2016-08-04 12:25:10 -0700
commit190a848fb2d4f502372b2528c55ca1f520e90609 (patch)
tree0f91a18d54c12e089e6454313577de959ff5095c /simpleperf/cmd_report.cpp
parent1f282c61fa7ba844688f370b64b3d547ca85d1ad (diff)
downloadextras-190a848fb2d4f502372b2528c55ca1f520e90609.tar.gz
simpleperf: keep binary in class Record.
It removes memory copy and heap allocation/deallocation in Record::BinaryFormat(), and is a preparation to remove memory copy and heap allocation in Record constructor. Bug: 30649868 Test: run simpleperf_unit_test. Change-Id: Ic8dd80e43f7b547a9beaf896d726b56aeb5d55a2
Diffstat (limited to 'simpleperf/cmd_report.cpp')
-rw-r--r--simpleperf/cmd_report.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/simpleperf/cmd_report.cpp b/simpleperf/cmd_report.cpp
index c2c0cf0f..51ab1eea 100644
--- a/simpleperf/cmd_report.cpp
+++ b/simpleperf/cmd_report.cpp
@@ -686,7 +686,7 @@ bool ReportCommand::ProcessRecord(std::unique_ptr<Record> record) {
*static_cast<const SampleRecord*>(record.get()));
} else if (record->type() == PERF_RECORD_TRACING_DATA) {
const auto& r = *static_cast<TracingDataRecord*>(record.get());
- if (!ProcessTracingData(r.data)) {
+ if (!ProcessTracingData(std::vector<char>(r.data, r.data + r.data_size))) {
return false;
}
}