forked from qt-creator/qt-creator
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:
@@ -95,6 +95,7 @@ inline QDataStream &operator>>(QDataStream &stream, PerfEvent &event)
|
|||||||
case PerfEventType::Command:
|
case PerfEventType::Command:
|
||||||
case PerfEventType::LocationDefinition:
|
case PerfEventType::LocationDefinition:
|
||||||
case PerfEventType::SymbolDefinition:
|
case PerfEventType::SymbolDefinition:
|
||||||
|
case PerfEventType::AttributesDefinition49:
|
||||||
case PerfEventType::AttributesDefinition:
|
case PerfEventType::AttributesDefinition:
|
||||||
case PerfEventType::StringDefinition:
|
case PerfEventType::StringDefinition:
|
||||||
case PerfEventType::FeaturesDefinition:
|
case PerfEventType::FeaturesDefinition:
|
||||||
|
@@ -45,7 +45,7 @@ public:
|
|||||||
Command,
|
Command,
|
||||||
LocationDefinition,
|
LocationDefinition,
|
||||||
SymbolDefinition,
|
SymbolDefinition,
|
||||||
AttributesDefinition,
|
AttributesDefinition49,
|
||||||
StringDefinition,
|
StringDefinition,
|
||||||
LostDefinition,
|
LostDefinition,
|
||||||
FeaturesDefinition,
|
FeaturesDefinition,
|
||||||
@@ -54,13 +54,14 @@ public:
|
|||||||
Progress,
|
Progress,
|
||||||
TracePointFormat,
|
TracePointFormat,
|
||||||
TracePointSample,
|
TracePointSample,
|
||||||
|
AttributesDefinition,
|
||||||
InvalidFeature
|
InvalidFeature
|
||||||
};
|
};
|
||||||
|
|
||||||
static quint64 attributeFeatures()
|
static quint64 attributeFeatures()
|
||||||
{
|
{
|
||||||
return (1ull << Sample43) | (1ull << Sample) | (1ull << TracePointSample)
|
return (1ull << Sample43) | (1ull << Sample) | (1ull << TracePointSample)
|
||||||
| (1ull << AttributesDefinition);
|
| (1ull << AttributesDefinition49) | (1ull << AttributesDefinition);
|
||||||
}
|
}
|
||||||
|
|
||||||
static quint64 metaFeatures()
|
static quint64 metaFeatures()
|
||||||
@@ -128,6 +129,7 @@ public:
|
|||||||
switch (feature()) {
|
switch (feature()) {
|
||||||
case Sample43:
|
case Sample43:
|
||||||
case Sample:
|
case Sample:
|
||||||
|
case AttributesDefinition49:
|
||||||
case AttributesDefinition:
|
case AttributesDefinition:
|
||||||
case TracePointSample:
|
case TracePointSample:
|
||||||
return true;
|
return true;
|
||||||
|
@@ -188,9 +188,15 @@ void PerfProfilerTraceFile::readMessages(const QByteArray &buffer)
|
|||||||
traceManager->setSymbol(id, symbol);
|
traceManager->setSymbol(id, symbol);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case PerfEventType::AttributesDefinition49:
|
||||||
case PerfEventType::AttributesDefinition: {
|
case PerfEventType::AttributesDefinition: {
|
||||||
PerfEventType attributes(PerfEventType::AttributesDefinition);
|
PerfEventType attributes(PerfEventType::AttributesDefinition49);
|
||||||
dataStream >> id >> attributes;
|
dataStream >> id >> attributes;
|
||||||
|
if (event.feature() == PerfEventType::AttributesDefinition) {
|
||||||
|
bool usesFrequency;
|
||||||
|
quint64 frequencyOrPeriod;
|
||||||
|
dataStream >> usesFrequency >> frequencyOrPeriod;
|
||||||
|
}
|
||||||
traceManager->setEventType(PerfEvent::LastSpecialTypeId - id, std::move(attributes));
|
traceManager->setEventType(PerfEvent::LastSpecialTypeId - id, std::move(attributes));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -451,7 +457,7 @@ void PerfProfilerTraceFile::writeToDevice()
|
|||||||
|
|
||||||
{
|
{
|
||||||
CompressedDataStream bufferStream(m_device.data());
|
CompressedDataStream bufferStream(m_device.data());
|
||||||
const quint8 feature = PerfEventType::AttributesDefinition;
|
const quint8 feature = PerfEventType::AttributesDefinition49;
|
||||||
qint32 id = 0;
|
qint32 id = 0;
|
||||||
for (const PerfEventType &attribute : traceManager->attributes()) {
|
for (const PerfEventType &attribute : traceManager->attributes()) {
|
||||||
if (!attribute.isAttribute())
|
if (!attribute.isAttribute())
|
||||||
|
@@ -179,7 +179,7 @@ void PerfProfilerTraceManager::clearTypeStorage()
|
|||||||
|
|
||||||
const Timeline::TraceEventType &PerfProfilerEventTypeStorage::get(int typeId) const
|
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);
|
static const PerfEventType emptyLocation(PerfEventType::LocationDefinition);
|
||||||
|
|
||||||
if (typeId >= 0) {
|
if (typeId >= 0) {
|
||||||
|
Reference in New Issue
Block a user