diff options
author | Milian Wolff <milian.wolff@kdab.com> | 2017-11-27 17:10:44 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-05-02 14:42:44 +0000 |
commit | 05ab1508cc7b263b5dca511c8fa22f04f88fbdd2 (patch) | |
tree | b71769573631de973f6c40250820fbadc573b44f | |
parent | 2f6fa8a5ed177b5b342c5c2ad6abd517e1d6495a (diff) |
Forward all costs for grouped sample
This is required for files recorded with e.g.
perf record -e '{cycles,instructions}:uPS'
Otherwise, we only get garbadge values for the cycles.
Change-Id: I65de37e81392b714c0dd65ddbefad64f4d2c353d
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
-rw-r--r-- | app/perfdata.h | 5 | ||||
-rw-r--r-- | app/perfunwind.cpp | 12 | ||||
-rw-r--r-- | app/perfunwind.h | 6 |
3 files changed, 18 insertions, 5 deletions
diff --git a/app/perfdata.h b/app/perfdata.h index 9928c94..faecf00 100644 --- a/app/perfdata.h +++ b/app/perfdata.h @@ -399,12 +399,15 @@ public: quint64 weight() const { return m_weight; } const QByteArray &rawData() const { return m_rawData; } -private: struct ReadFormat { quint64 value; quint64 id; }; + QList<ReadFormat> readFormats() const { return m_readFormats; } + +private: + struct BranchEntry { quint64 from; quint64 to; diff --git a/app/perfunwind.cpp b/app/perfunwind.cpp index b6339c7..393e515 100644 --- a/app/perfunwind.cpp +++ b/app/perfunwind.cpp @@ -628,12 +628,20 @@ void PerfUnwind::analyze(const PerfRecordSample &sample) sendBuffer(it.value()); } + QVector<QPair<qint32, quint64>> values; + if (sample.readFormats().isEmpty()) { + values.push_back({ attributesId, sample.period() }); + } else { + for (const auto& f : sample.readFormats()) { + values.push_back({ m_attributeIds.value(f.id, -1), f.value }); + } + } + QByteArray buffer; QDataStream stream(&buffer, QIODevice::WriteOnly); stream << static_cast<quint8>(type) << sample.pid() << sample.tid() << sample.time() << m_currentUnwind.frames - << numGuessedFrames << attributesId - << sample.period() << sample.weight(); + << numGuessedFrames << values; if (type == TracePointSample) { QHash<qint32, QVariant> traceData; diff --git a/app/perfunwind.h b/app/perfunwind.h index 27e992a..45d1567 100644 --- a/app/perfunwind.h +++ b/app/perfunwind.h @@ -55,12 +55,14 @@ public: LostDefinition, FeaturesDefinition, Error, - Sample, + Sample49, // now obsolete Progress, TracePointFormat, - TracePointSample, + TracePointSample49, AttributesDefinition, ContextSwitchDefinition, + Sample, + TracePointSample, InvalidType }; |