From d969aea68f6c5e93b3a5c58371a25c64376261e2 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 2 May 2019 16:13:37 +0200 Subject: [PATCH] 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 --- src/plugins/perfprofiler/perfevent.h | 1 + src/plugins/perfprofiler/perfeventtype.h | 6 ++++-- src/plugins/perfprofiler/perfprofilertracefile.cpp | 10 ++++++++-- 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 7fc7942645d..40d94b862fb 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 2d8533edde8..107b8bdb32b 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 7359e8f5d49..8b5bac6bf4a 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 79bd1a05ad0..5ebf1926788 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) {