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>
This commit is contained in:
Ulf Hermann
2019-05-02 16:13:37 +02:00
parent 08e7bb77d8
commit d969aea68f
4 changed files with 14 additions and 5 deletions

View File

@@ -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:

View File

@@ -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;

View File

@@ -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())

View File

@@ -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) {