diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-06-07 23:28:42 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-06-07 23:28:42 +0000 |
commit | d57169e64c4cadb5c16b296ed3506c70837b8514 (patch) | |
tree | f3f3abd005afd96c07379261e18a98cf40f3ee60 | |
parent | a7b66eeb66b306dd9f8f04d38c335c0f5d0ef16c (diff) | |
parent | df142880e86418dad6b40fddb001ebd897919595 (diff) | |
download | extras-android-security-13.0.0_r6.tar.gz |
Snap for 8693000 from df142880e86418dad6b40fddb001ebd897919595 to tm-releaseandroid-vts-13.0_r1android-security-13.0.0_r9android-security-13.0.0_r8android-security-13.0.0_r7android-security-13.0.0_r6android-security-13.0.0_r5android-security-13.0.0_r4android-security-13.0.0_r3android-security-13.0.0_r2android-security-13.0.0_r17android-security-13.0.0_r16android-security-13.0.0_r15android-security-13.0.0_r14android-security-13.0.0_r13android-security-13.0.0_r12android-security-13.0.0_r11android-security-13.0.0_r10android-security-13.0.0_r1android-platform-13.0.0_r2android-platform-13.0.0_r1android-cts-13.0_r1android-13.0.0_r8android-13.0.0_r7android-13.0.0_r6android-13.0.0_r5android-13.0.0_r4android-13.0.0_r31android-13.0.0_r3android-13.0.0_r2android-13.0.0_r12android-13.0.0_r1android13-security-releaseandroid13-s3-releaseandroid13-s2-releaseandroid13-s1-releaseandroid13-release
Change-Id: I7dece6ecc1a28287625744c57deb27ccf4253f75
-rw-r--r-- | simpleperf/cmd_record.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/simpleperf/cmd_record.cpp b/simpleperf/cmd_record.cpp index 4b79eedc..e69355d4 100644 --- a/simpleperf/cmd_record.cpp +++ b/simpleperf/cmd_record.cpp @@ -352,7 +352,8 @@ RECORD_FILTER_OPTION_HELP_MSG_FOR_RECORDING bool TraceOffCpu(); bool SetEventSelectionFlags(); bool CreateAndInitRecordFile(); - std::unique_ptr<RecordFileWriter> CreateRecordFile(const std::string& filename); + std::unique_ptr<RecordFileWriter> CreateRecordFile( + const std::string& filename, const std::vector<EventAttrWithId>& override_attrs); bool DumpKernelSymbol(); bool DumpTracingData(); bool DumpMaps(); @@ -1280,7 +1281,8 @@ bool RecordCommand::SetEventSelectionFlags() { } bool RecordCommand::CreateAndInitRecordFile() { - record_file_writer_ = CreateRecordFile(record_filename_); + record_file_writer_ = + CreateRecordFile(record_filename_, event_selection_set_.GetEventAttrWithId()); if (record_file_writer_ == nullptr) { return false; } @@ -1294,13 +1296,14 @@ bool RecordCommand::CreateAndInitRecordFile() { return DumpKernelSymbol() && DumpTracingData() && DumpMaps() && DumpAuxTraceInfo(); } -std::unique_ptr<RecordFileWriter> RecordCommand::CreateRecordFile(const std::string& filename) { +std::unique_ptr<RecordFileWriter> RecordCommand::CreateRecordFile( + const std::string& filename, const std::vector<EventAttrWithId>& attrs) { std::unique_ptr<RecordFileWriter> writer = RecordFileWriter::CreateInstance(filename); if (writer == nullptr) { return nullptr; } - if (!writer->WriteAttrSection(event_selection_set_.GetEventAttrWithId())) { + if (!writer->WriteAttrSection(attrs)) { return nullptr; } return writer; @@ -1697,11 +1700,17 @@ std::unique_ptr<RecordFileReader> RecordCommand::MoveRecordFile(const std::strin return nullptr; } } - record_file_writer_ = CreateRecordFile(record_filename_); + + auto reader = RecordFileReader::CreateInstance(old_filename); + if (!reader) { + return nullptr; + } + + record_file_writer_ = CreateRecordFile(record_filename_, reader->AttrSection()); if (!record_file_writer_) { return nullptr; } - return RecordFileReader::CreateInstance(old_filename); + return reader; } bool RecordCommand::MergeMapRecords() { |