diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2019-05-16 11:19:25 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-05-16 11:30:07 +0000 |
commit | 02b36dd2c5fe4d1cf2970bc396fa665b199463d4 (patch) | |
tree | aa0c798cb5f11c5e9594264ead516f6c52755a37 | |
parent | b93fb2d018804c208cb972c1cace7be4fe6f297a (diff) |
Don't try to "fix" partially read events on sequential devices4.10
We cannot read the position on those.
Change-Id: Ife92c3bc8537353b3c880c53b203d8007656e96f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r-- | app/perfdata.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/app/perfdata.cpp b/app/perfdata.cpp index eea52b6..54a9683 100644 --- a/app/perfdata.cpp +++ b/app/perfdata.cpp @@ -67,7 +67,7 @@ PerfData::ReadStatus PerfData::processEvents(QDataStream &stream) bool sampleIdAll = attrs.sampleIdAll(); quint64 sampleType = attrs.sampleType(); - const auto oldPos = stream.device()->pos(); + const auto oldPos = stream.device()->isSequential() ? 0 : stream.device()->pos(); switch (m_eventHeader.type) { case PERF_RECORD_MMAP: { @@ -190,10 +190,13 @@ PerfData::ReadStatus PerfData::processEvents(QDataStream &stream) break; } - const auto parsedContentSize = stream.device()->pos() - oldPos; - if (parsedContentSize != contentSize) { - qWarning() << "Event not fully parsed" << m_eventHeader.type << contentSize << parsedContentSize; - stream.skipRawData(contentSize - parsedContentSize); + if (!stream.device()->isSequential()) { + const auto parsedContentSize = stream.device()->pos() - oldPos; + if (parsedContentSize != contentSize) { + qWarning() << "Event not fully parsed" << m_eventHeader.type << contentSize + << parsedContentSize; + stream.skipRawData(contentSize - parsedContentSize); + } } m_eventHeader.size = 0; |