summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilian Wolff <milian.wolff@kdab.com>2020-05-15 18:54:08 +0200
committerMilian Wolff <milian.wolff@kdab.com>2020-06-12 17:11:21 +0000
commit02922fc1485d5039847ec99b499797543866f572 (patch)
tree31d7de580fd2c1401a59d96ea4c1c20df8a8901d
parentba3ed7078acca457740139b30604649656842d91 (diff)
Don't try to unbreak non-broken feature data
Apparently android's simpleperf doesn't contain the HOSTNAME feature. Yet the data is still valid - trying to unbreak it would actually break it for real. Fixes: https://github.com/KDAB/hotspot/issues/224 Change-Id: I0ed694a79fc731728edee8f6e2e3ba52717e2ea4 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
-rw-r--r--app/perfheader.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/perfheader.cpp b/app/perfheader.cpp
index 9987e3b..441764b 100644
--- a/app/perfheader.cpp
+++ b/app/perfheader.cpp
@@ -81,13 +81,13 @@ void PerfHeader::read()
for (uint i = 0; i < featureParts; ++i)
stream >> m_features[i];
- if (m_magic == s_magicSwitched && !hasFeature(HOSTNAME)) {
+ if (m_magic == s_magicSwitched && !hasFeature(HOSTNAME) && !hasFeature(CMDLINE)) {
quint32 *features32 = reinterpret_cast<quint32 *>(&m_features[0]);
for (uint i = 0; i < featureParts; ++i)
qSwap(features32[i * 2], features32[i * 2 + 1]);
- if (!hasFeature(HOSTNAME)) {
+ if (!hasFeature(HOSTNAME) && !hasFeature(CMDLINE)) {
// It borked: blank it all
qWarning() << "bad feature data:" << m_features;
for (uint i = 0; i < featureParts; ++i)