diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2019-05-02 16:13:37 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-05-02 15:23:56 +0000 |
commit | d969aea68f6c5e93b3a5c58371a25c64376261e2 (patch) | |
tree | ebddf6e6586c9713a08502f0b31e2807d2fe86e1 /src/plugins/perfprofiler | |
parent | 08e7bb77d85ec1caf7b5aba07f6b1f0cc4d2cc91 (diff) |
Add basic support for new AttributesDefinition
We read the attributes, but don't use the new data, yet.
Change-Id: Idb983dee60b76ae8f22375e9070042660cf5e612
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Diffstat (limited to 'src/plugins/perfprofiler')
-rw-r--r-- | src/plugins/perfprofiler/perfevent.h | 1 | ||||
-rw-r--r-- | src/plugins/perfprofiler/perfeventtype.h | 6 | ||||
-rw-r--r-- | src/plugins/perfprofiler/perfprofilertracefile.cpp | 10 | ||||
-rw-r--r-- | src/plugins/perfprofiler/perfprofilertracemanager.cpp | 2 |
4 files changed, 14 insertions, 5 deletions
diff --git a/src/plugins/perfprofiler/perfevent.h b/src/plugins/perfprofiler/perfevent.h index 7fc7942645..40d94b862f 100644 --- a/src/plugins/perfprofiler/perfevent.h +++ b/src/plugins/perfprofiler/perfevent.h @@ -95,6 +95,7 @@ inline QDataStream &operator>>(QDataStream &stream, PerfEvent &event) case PerfEventType::Command: case PerfEventType::LocationDefinition: case PerfEventType::SymbolDefinition: + case PerfEventType::AttributesDefinition49: case PerfEventType::AttributesDefinition: case PerfEventType::StringDefinition: case PerfEventType::FeaturesDefinition: diff --git a/src/plugins/perfprofiler/perfeventtype.h b/src/plugins/perfprofiler/perfeventtype.h index 2d8533edde..107b8bdb32 100644 --- a/src/plugins/perfprofiler/perfeventtype.h +++ b/src/plugins/perfprofiler/perfeventtype.h @@ -45,7 +45,7 @@ public: Command, LocationDefinition, SymbolDefinition, - AttributesDefinition, + AttributesDefinition49, StringDefinition, LostDefinition, FeaturesDefinition, @@ -54,13 +54,14 @@ public: Progress, TracePointFormat, TracePointSample, + AttributesDefinition, InvalidFeature }; static quint64 attributeFeatures() { return (1ull << Sample43) | (1ull << Sample) | (1ull << TracePointSample) - | (1ull << AttributesDefinition); + | (1ull << AttributesDefinition49) | (1ull << AttributesDefinition); } static quint64 metaFeatures() @@ -128,6 +129,7 @@ public: switch (feature()) { case Sample43: case Sample: + case AttributesDefinition49: case AttributesDefinition: case TracePointSample: return true; diff --git a/src/plugins/perfprofiler/perfprofilertracefile.cpp b/src/plugins/perfprofiler/perfprofilertracefile.cpp index 7359e8f5d4..8b5bac6bf4 100644 --- a/src/plugins/perfprofiler/perfprofilertracefile.cpp +++ b/src/plugins/perfprofiler/perfprofilertracefile.cpp @@ -188,9 +188,15 @@ void PerfProfilerTraceFile::readMessages(const QByteArray &buffer) traceManager->setSymbol(id, symbol); break; } + case PerfEventType::AttributesDefinition49: case PerfEventType::AttributesDefinition: { - PerfEventType attributes(PerfEventType::AttributesDefinition); + PerfEventType attributes(PerfEventType::AttributesDefinition49); dataStream >> id >> attributes; + if (event.feature() == PerfEventType::AttributesDefinition) { + bool usesFrequency; + quint64 frequencyOrPeriod; + dataStream >> usesFrequency >> frequencyOrPeriod; + } traceManager->setEventType(PerfEvent::LastSpecialTypeId - id, std::move(attributes)); break; } @@ -451,7 +457,7 @@ void PerfProfilerTraceFile::writeToDevice() { CompressedDataStream bufferStream(m_device.data()); - const quint8 feature = PerfEventType::AttributesDefinition; + const quint8 feature = PerfEventType::AttributesDefinition49; qint32 id = 0; for (const PerfEventType &attribute : traceManager->attributes()) { if (!attribute.isAttribute()) diff --git a/src/plugins/perfprofiler/perfprofilertracemanager.cpp b/src/plugins/perfprofiler/perfprofilertracemanager.cpp index 79bd1a05ad..5ebf192678 100644 --- a/src/plugins/perfprofiler/perfprofilertracemanager.cpp +++ b/src/plugins/perfprofiler/perfprofilertracemanager.cpp @@ -179,7 +179,7 @@ void PerfProfilerTraceManager::clearTypeStorage() const Timeline::TraceEventType &PerfProfilerEventTypeStorage::get(int typeId) const { - static const PerfEventType emptyAttribute(PerfEventType::AttributesDefinition); + static const PerfEventType emptyAttribute(PerfEventType::AttributesDefinition49); static const PerfEventType emptyLocation(PerfEventType::LocationDefinition); if (typeId >= 0) { |