diff options
author | Tamas Zsoldos <tamas.zsoldos@arm.com> | 2024-01-24 16:06:10 +0100 |
---|---|---|
committer | Tamas Zsoldos <tamas.zsoldos@arm.com> | 2024-01-30 09:53:44 +0100 |
commit | 79ba9747aab1c787d510b12b72c921c13516f1a8 (patch) | |
tree | 56699ce721ba3d483b92b802594902d9c5687d1e /simpleperf | |
parent | 5ce0102ccd44e70b6d10e6f23d9b2e924081b4f1 (diff) | |
download | extras-79ba9747aab1c787d510b12b72c921c13516f1a8.tar.gz |
simpleperf: Relax auxtrace offset requirements.
The offset of the AuxTraceRecord comes from the kernel unmodified, but
its size is aligned and padded by simpleperf. This padding can cause
the offset of a record to be smaller than the previous
record's (offset + size), despite everything being correct.
Relax the check so that it does not add the size to the offset, and
only checks that the records are sorted by offset.
Test: simpleperf_unit_test
Change-Id: I5813010cf7f1843e469b4a477d7a5e937a1828ca
Diffstat (limited to 'simpleperf')
-rw-r--r-- | simpleperf/record_file_reader.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/simpleperf/record_file_reader.cpp b/simpleperf/record_file_reader.cpp index 1b1bab7e..deeab564 100644 --- a/simpleperf/record_file_reader.cpp +++ b/simpleperf/record_file_reader.cpp @@ -830,9 +830,8 @@ bool RecordFileReader::BuildAuxDataLocation() { auto location_it = aux_data_location_.find(auxtrace.data->cpu); if (location_it != aux_data_location_.end()) { const AuxDataLocation& prev_location = location_it->second.back(); - uint64_t prev_aux_end = prev_location.aux_offset + prev_location.aux_size; // The AuxTraceRecords should be sorted by aux_offset for each cpu. - if (prev_aux_end > location.aux_offset) { + if (prev_location.aux_offset > location.aux_offset) { LOG(ERROR) << "invalid auxtrace feature section"; return false; } |