diff options
-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 }; |