qmlprofiler: Use QQmlProfilerDefinitions for accessing definitions
Change-Id: I6def7dd8a0ce0db22ad4829029d8510f5869c813 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
This commit is contained in:
parent
1e2e356f0f
commit
30ead66c62
|
@ -97,26 +97,26 @@ QmlProfilerApplication::QmlProfilerApplication(int &argc, char **argv) :
|
||||||
connect(&m_connection, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(connectionError(QAbstractSocket::SocketError)));
|
connect(&m_connection, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(connectionError(QAbstractSocket::SocketError)));
|
||||||
|
|
||||||
connect(&m_qmlProfilerClient, SIGNAL(enabledChanged()), this, SLOT(traceClientEnabled()));
|
connect(&m_qmlProfilerClient, SIGNAL(enabledChanged()), this, SLOT(traceClientEnabled()));
|
||||||
connect(&m_qmlProfilerClient, SIGNAL(range(QQmlProfilerService::RangeType,QQmlProfilerService::BindingType,qint64,qint64,QStringList,QmlEventLocation)),
|
connect(&m_qmlProfilerClient, SIGNAL(range(QQmlProfilerDefinitions::RangeType,QQmlProfilerDefinitions::BindingType,qint64,qint64,QStringList,QmlEventLocation)),
|
||||||
&m_profilerData, SLOT(addQmlEvent(QQmlProfilerService::RangeType,QQmlProfilerService::BindingType,qint64,qint64,QStringList,QmlEventLocation)));
|
&m_profilerData, SLOT(addQmlEvent(QQmlProfilerDefinitions::RangeType,QQmlProfilerDefinitions::BindingType,qint64,qint64,QStringList,QmlEventLocation)));
|
||||||
connect(&m_qmlProfilerClient, SIGNAL(traceFinished(qint64)), &m_profilerData, SLOT(setTraceEndTime(qint64)));
|
connect(&m_qmlProfilerClient, SIGNAL(traceFinished(qint64)), &m_profilerData, SLOT(setTraceEndTime(qint64)));
|
||||||
connect(&m_qmlProfilerClient, SIGNAL(traceStarted(qint64)), &m_profilerData, SLOT(setTraceStartTime(qint64)));
|
connect(&m_qmlProfilerClient, SIGNAL(traceStarted(qint64)), &m_profilerData, SLOT(setTraceStartTime(qint64)));
|
||||||
connect(&m_qmlProfilerClient, SIGNAL(traceStarted(qint64)), this, SLOT(notifyTraceStarted()));
|
connect(&m_qmlProfilerClient, SIGNAL(traceStarted(qint64)), this, SLOT(notifyTraceStarted()));
|
||||||
connect(&m_qmlProfilerClient, SIGNAL(frame(qint64,int,int,int)), &m_profilerData, SLOT(addFrameEvent(qint64,int,int,int)));
|
connect(&m_qmlProfilerClient, SIGNAL(frame(qint64,int,int,int)), &m_profilerData, SLOT(addFrameEvent(qint64,int,int,int)));
|
||||||
connect(&m_qmlProfilerClient, SIGNAL(sceneGraphFrame(QQmlProfilerService::SceneGraphFrameType,
|
connect(&m_qmlProfilerClient, SIGNAL(sceneGraphFrame(QQmlProfilerDefinitions::SceneGraphFrameType,
|
||||||
qint64,qint64,qint64,qint64,qint64,qint64)),
|
qint64,qint64,qint64,qint64,qint64,qint64)),
|
||||||
&m_profilerData, SLOT(addSceneGraphFrameEvent(QQmlProfilerService::SceneGraphFrameType,
|
&m_profilerData, SLOT(addSceneGraphFrameEvent(QQmlProfilerDefinitions::SceneGraphFrameType,
|
||||||
qint64,qint64,qint64,qint64,qint64,qint64)));
|
qint64,qint64,qint64,qint64,qint64,qint64)));
|
||||||
connect(&m_qmlProfilerClient, SIGNAL(pixmapCache(QQmlProfilerService::PixmapEventType,qint64,
|
connect(&m_qmlProfilerClient, SIGNAL(pixmapCache(QQmlProfilerDefinitions::PixmapEventType,qint64,
|
||||||
QmlEventLocation,int,int,int)),
|
QmlEventLocation,int,int,int)),
|
||||||
&m_profilerData, SLOT(addPixmapCacheEvent(QQmlProfilerService::PixmapEventType,qint64,
|
&m_profilerData, SLOT(addPixmapCacheEvent(QQmlProfilerDefinitions::PixmapEventType,qint64,
|
||||||
QmlEventLocation,int,int,int)));
|
QmlEventLocation,int,int,int)));
|
||||||
connect(&m_qmlProfilerClient, SIGNAL(memoryAllocation(QQmlProfilerService::MemoryType,qint64,
|
connect(&m_qmlProfilerClient, SIGNAL(memoryAllocation(QQmlProfilerDefinitions::MemoryType,qint64,
|
||||||
qint64)),
|
qint64)),
|
||||||
&m_profilerData, SLOT(addMemoryEvent(QQmlProfilerService::MemoryType,qint64,
|
&m_profilerData, SLOT(addMemoryEvent(QQmlProfilerDefinitions::MemoryType,qint64,
|
||||||
qint64)));
|
qint64)));
|
||||||
connect(&m_qmlProfilerClient, SIGNAL(inputEvent(QQmlProfilerService::EventType,qint64)),
|
connect(&m_qmlProfilerClient, SIGNAL(inputEvent(QQmlProfilerDefinitions::EventType,qint64)),
|
||||||
&m_profilerData, SLOT(addInputEvent(QQmlProfilerService::EventType,qint64)));
|
&m_profilerData, SLOT(addInputEvent(QQmlProfilerDefinitions::EventType,qint64)));
|
||||||
|
|
||||||
connect(&m_qmlProfilerClient, SIGNAL(complete()), this, SLOT(qmlComplete()));
|
connect(&m_qmlProfilerClient, SIGNAL(complete()), this, SLOT(qmlComplete()));
|
||||||
|
|
||||||
|
@ -184,7 +184,7 @@ void QmlProfilerApplication::parseArguments()
|
||||||
parser.addOption(record);
|
parser.addOption(record);
|
||||||
|
|
||||||
QStringList featureList;
|
QStringList featureList;
|
||||||
for (int i = 0; i < QQmlProfilerService::MaximumProfileFeature; ++i)
|
for (int i = 0; i < QQmlProfilerDefinitions::MaximumProfileFeature; ++i)
|
||||||
featureList << QLatin1String(features[i]);
|
featureList << QLatin1String(features[i]);
|
||||||
|
|
||||||
QCommandLineOption include(QLatin1String("include"),
|
QCommandLineOption include(QLatin1String("include"),
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
|
|
||||||
#include <QtCore/QStack>
|
#include <QtCore/QStack>
|
||||||
#include <QtCore/QStringList>
|
#include <QtCore/QStringList>
|
||||||
|
#include <QtCore/QDataStream>
|
||||||
|
|
||||||
ProfilerClient::ProfilerClient(const QString &clientName,
|
ProfilerClient::ProfilerClient(const QString &clientName,
|
||||||
QQmlDebugConnection *client)
|
QQmlDebugConnection *client)
|
||||||
|
@ -73,16 +74,15 @@ public:
|
||||||
QmlProfilerClientPrivate()
|
QmlProfilerClientPrivate()
|
||||||
: inProgressRanges(0) , features(std::numeric_limits<quint64>::max())
|
: inProgressRanges(0) , features(std::numeric_limits<quint64>::max())
|
||||||
{
|
{
|
||||||
::memset(rangeCount, 0,
|
::memset(rangeCount, 0, QQmlProfilerDefinitions::MaximumRangeType * sizeof(int));
|
||||||
QQmlProfilerService::MaximumRangeType * sizeof(int));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 inProgressRanges;
|
qint64 inProgressRanges;
|
||||||
QStack<qint64> rangeStartTimes[QQmlProfilerService::MaximumRangeType];
|
QStack<qint64> rangeStartTimes[QQmlProfilerDefinitions::MaximumRangeType];
|
||||||
QStack<QStringList> rangeDatas[QQmlProfilerService::MaximumRangeType];
|
QStack<QStringList> rangeDatas[QQmlProfilerDefinitions::MaximumRangeType];
|
||||||
QStack<QmlEventLocation> rangeLocations[QQmlProfilerService::MaximumRangeType];
|
QStack<QmlEventLocation> rangeLocations[QQmlProfilerDefinitions::MaximumRangeType];
|
||||||
QStack<QQmlProfilerService::BindingType> bindingTypes;
|
QStack<QQmlProfilerDefinitions::BindingType> bindingTypes;
|
||||||
int rangeCount[QQmlProfilerService::MaximumRangeType];
|
int rangeCount[QQmlProfilerDefinitions::MaximumRangeType];
|
||||||
|
|
||||||
quint64 features;
|
quint64 features;
|
||||||
};
|
};
|
||||||
|
@ -106,8 +106,7 @@ void QmlProfilerClient::setFeatures(quint64 features)
|
||||||
|
|
||||||
void QmlProfilerClient::clearData()
|
void QmlProfilerClient::clearData()
|
||||||
{
|
{
|
||||||
::memset(d->rangeCount, 0,
|
::memset(d->rangeCount, 0, QQmlProfilerDefinitions::MaximumRangeType * sizeof(int));
|
||||||
QQmlProfilerService::MaximumRangeType * sizeof(int));
|
|
||||||
d->bindingTypes.clear();
|
d->bindingTypes.clear();
|
||||||
ProfilerClient::clearData();
|
ProfilerClient::clearData();
|
||||||
}
|
}
|
||||||
|
@ -120,24 +119,24 @@ void QmlProfilerClient::sendRecordingStatus(bool record)
|
||||||
sendMessage(ba);
|
sendMessage(ba);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline QQmlProfilerService::ProfileFeature featureFromRangeType(
|
inline QQmlProfilerDefinitions::ProfileFeature featureFromRangeType(
|
||||||
QQmlProfilerService::RangeType range)
|
QQmlProfilerDefinitions::RangeType range)
|
||||||
{
|
{
|
||||||
switch (range) {
|
switch (range) {
|
||||||
case QQmlProfilerService::Painting:
|
case QQmlProfilerDefinitions::Painting:
|
||||||
return QQmlProfilerService::ProfilePainting;
|
return QQmlProfilerDefinitions::ProfilePainting;
|
||||||
case QQmlProfilerService::Compiling:
|
case QQmlProfilerDefinitions::Compiling:
|
||||||
return QQmlProfilerService::ProfileCompiling;
|
return QQmlProfilerDefinitions::ProfileCompiling;
|
||||||
case QQmlProfilerService::Creating:
|
case QQmlProfilerDefinitions::Creating:
|
||||||
return QQmlProfilerService::ProfileCreating;
|
return QQmlProfilerDefinitions::ProfileCreating;
|
||||||
case QQmlProfilerService::Binding:
|
case QQmlProfilerDefinitions::Binding:
|
||||||
return QQmlProfilerService::ProfileBinding;
|
return QQmlProfilerDefinitions::ProfileBinding;
|
||||||
case QQmlProfilerService::HandlingSignal:
|
case QQmlProfilerDefinitions::HandlingSignal:
|
||||||
return QQmlProfilerService::ProfileHandlingSignal;
|
return QQmlProfilerDefinitions::ProfileHandlingSignal;
|
||||||
case QQmlProfilerService::Javascript:
|
case QQmlProfilerDefinitions::Javascript:
|
||||||
return QQmlProfilerService::ProfileJavaScript;
|
return QQmlProfilerDefinitions::ProfileJavaScript;
|
||||||
default:
|
default:
|
||||||
return QQmlProfilerService::MaximumProfileFeature;
|
return QQmlProfilerDefinitions::MaximumProfileFeature;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,17 +153,17 @@ void QmlProfilerClient::messageReceived(const QByteArray &data)
|
||||||
|
|
||||||
stream >> time >> messageType;
|
stream >> time >> messageType;
|
||||||
|
|
||||||
if (messageType >= QQmlProfilerService::MaximumMessage)
|
if (messageType >= QQmlProfilerDefinitions::MaximumMessage)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (messageType == QQmlProfilerService::Event) {
|
if (messageType == QQmlProfilerDefinitions::Event) {
|
||||||
int event;
|
int event;
|
||||||
stream >> event;
|
stream >> event;
|
||||||
|
|
||||||
if (event == QQmlProfilerService::EndTrace) {
|
if (event == QQmlProfilerDefinitions::EndTrace) {
|
||||||
emit this->traceFinished(time);
|
emit this->traceFinished(time);
|
||||||
} else if (event == QQmlProfilerService::AnimationFrame) {
|
} else if (event == QQmlProfilerDefinitions::AnimationFrame) {
|
||||||
if (!(d->features & one << QQmlProfilerService::ProfileAnimations))
|
if (!(d->features & one << QQmlProfilerDefinitions::ProfileAnimations))
|
||||||
return;
|
return;
|
||||||
int frameRate, animationCount;
|
int frameRate, animationCount;
|
||||||
int threadId = 0;
|
int threadId = 0;
|
||||||
|
@ -172,17 +171,18 @@ void QmlProfilerClient::messageReceived(const QByteArray &data)
|
||||||
if (!stream.atEnd())
|
if (!stream.atEnd())
|
||||||
stream >> threadId;
|
stream >> threadId;
|
||||||
emit this->frame(time, frameRate, animationCount, threadId);
|
emit this->frame(time, frameRate, animationCount, threadId);
|
||||||
} else if (event == QQmlProfilerService::StartTrace) {
|
} else if (event == QQmlProfilerDefinitions::StartTrace) {
|
||||||
emit this->traceStarted(time);
|
emit this->traceStarted(time);
|
||||||
} else if (event == QQmlProfilerService::Key || event == QQmlProfilerService::Mouse) {
|
} else if (event == QQmlProfilerDefinitions::Key ||
|
||||||
if (!(d->features & one << QQmlProfilerService::ProfileInputEvents))
|
event == QQmlProfilerDefinitions::Mouse) {
|
||||||
|
if (!(d->features & one << QQmlProfilerDefinitions::ProfileInputEvents))
|
||||||
return;
|
return;
|
||||||
emit this->inputEvent((QQmlProfilerService::EventType)event, time);
|
emit this->inputEvent((QQmlProfilerDefinitions::EventType)event, time);
|
||||||
}
|
}
|
||||||
} else if (messageType == QQmlProfilerService::Complete) {
|
} else if (messageType == QQmlProfilerDefinitions::Complete) {
|
||||||
emit complete();
|
emit complete();
|
||||||
} else if (messageType == QQmlProfilerService::SceneGraphFrame) {
|
} else if (messageType == QQmlProfilerDefinitions::SceneGraphFrame) {
|
||||||
if (!(d->features & one << QQmlProfilerService::ProfileSceneGraph))
|
if (!(d->features & one << QQmlProfilerDefinitions::ProfileSceneGraph))
|
||||||
return;
|
return;
|
||||||
int sgEventType;
|
int sgEventType;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
@ -194,54 +194,54 @@ void QmlProfilerClient::messageReceived(const QByteArray &data)
|
||||||
}
|
}
|
||||||
while (count<5)
|
while (count<5)
|
||||||
params[count++] = 0;
|
params[count++] = 0;
|
||||||
emit sceneGraphFrame((QQmlProfilerService::SceneGraphFrameType)sgEventType, time,
|
emit sceneGraphFrame((QQmlProfilerDefinitions::SceneGraphFrameType)sgEventType, time,
|
||||||
params[0], params[1], params[2], params[3], params[4]);
|
params[0], params[1], params[2], params[3], params[4]);
|
||||||
} else if (messageType == QQmlProfilerService::PixmapCacheEvent) {
|
} else if (messageType == QQmlProfilerDefinitions::PixmapCacheEvent) {
|
||||||
if (!(d->features & one << QQmlProfilerService::ProfilePixmapCache))
|
if (!(d->features & one << QQmlProfilerDefinitions::ProfilePixmapCache))
|
||||||
return;
|
return;
|
||||||
int pixEvTy, width = 0, height = 0, refcount = 0;
|
int pixEvTy, width = 0, height = 0, refcount = 0;
|
||||||
QString pixUrl;
|
QString pixUrl;
|
||||||
stream >> pixEvTy >> pixUrl;
|
stream >> pixEvTy >> pixUrl;
|
||||||
if (pixEvTy == (int)QQmlProfilerService::PixmapReferenceCountChanged ||
|
if (pixEvTy == (int)QQmlProfilerDefinitions::PixmapReferenceCountChanged ||
|
||||||
pixEvTy == (int)QQmlProfilerService::PixmapCacheCountChanged) {
|
pixEvTy == (int)QQmlProfilerDefinitions::PixmapCacheCountChanged) {
|
||||||
stream >> refcount;
|
stream >> refcount;
|
||||||
} else if (pixEvTy == (int)QQmlProfilerService::PixmapSizeKnown) {
|
} else if (pixEvTy == (int)QQmlProfilerDefinitions::PixmapSizeKnown) {
|
||||||
stream >> width >> height;
|
stream >> width >> height;
|
||||||
refcount = 1;
|
refcount = 1;
|
||||||
}
|
}
|
||||||
emit pixmapCache((QQmlProfilerService::PixmapEventType)pixEvTy, time,
|
emit pixmapCache((QQmlProfilerDefinitions::PixmapEventType)pixEvTy, time,
|
||||||
QmlEventLocation(pixUrl,0,0), width, height, refcount);
|
QmlEventLocation(pixUrl,0,0), width, height, refcount);
|
||||||
} else if (messageType == QQmlProfilerService::MemoryAllocation) {
|
} else if (messageType == QQmlProfilerDefinitions::MemoryAllocation) {
|
||||||
if (!(d->features & one << QQmlProfilerService::ProfileMemory))
|
if (!(d->features & one << QQmlProfilerDefinitions::ProfileMemory))
|
||||||
return;
|
return;
|
||||||
int type;
|
int type;
|
||||||
qint64 delta;
|
qint64 delta;
|
||||||
stream >> type >> delta;
|
stream >> type >> delta;
|
||||||
emit memoryAllocation((QQmlProfilerService::MemoryType)type, time, delta);
|
emit memoryAllocation((QQmlProfilerDefinitions::MemoryType)type, time, delta);
|
||||||
} else {
|
} else {
|
||||||
int range;
|
int range;
|
||||||
stream >> range;
|
stream >> range;
|
||||||
|
|
||||||
if (range >= QQmlProfilerService::MaximumRangeType)
|
if (range >= QQmlProfilerDefinitions::MaximumRangeType)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!(d->features & one << featureFromRangeType(
|
if (!(d->features & one << featureFromRangeType(
|
||||||
static_cast<QQmlProfilerService::RangeType>(range))))
|
static_cast<QQmlProfilerDefinitions::RangeType>(range))))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (messageType == QQmlProfilerService::RangeStart) {
|
if (messageType == QQmlProfilerDefinitions::RangeStart) {
|
||||||
d->rangeStartTimes[range].push(time);
|
d->rangeStartTimes[range].push(time);
|
||||||
d->inProgressRanges |= (static_cast<qint64>(1) << range);
|
d->inProgressRanges |= (static_cast<qint64>(1) << range);
|
||||||
++d->rangeCount[range];
|
++d->rangeCount[range];
|
||||||
|
|
||||||
// read binding type
|
// read binding type
|
||||||
if (range == (int)QQmlProfilerService::Binding) {
|
if (range == (int)QQmlProfilerDefinitions::Binding) {
|
||||||
int bindingType = (int)QQmlProfilerService::QmlBinding;
|
int bindingType = (int)QQmlProfilerDefinitions::QmlBinding;
|
||||||
if (!stream.atEnd())
|
if (!stream.atEnd())
|
||||||
stream >> bindingType;
|
stream >> bindingType;
|
||||||
d->bindingTypes.push((QQmlProfilerService::BindingType)bindingType);
|
d->bindingTypes.push((QQmlProfilerDefinitions::BindingType)bindingType);
|
||||||
}
|
}
|
||||||
} else if (messageType == QQmlProfilerService::RangeData) {
|
} else if (messageType == QQmlProfilerDefinitions::RangeData) {
|
||||||
QString data;
|
QString data;
|
||||||
stream >> data;
|
stream >> data;
|
||||||
|
|
||||||
|
@ -252,7 +252,7 @@ void QmlProfilerClient::messageReceived(const QByteArray &data)
|
||||||
d->rangeDatas[range][count-1] << data;
|
d->rangeDatas[range][count-1] << data;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (messageType == QQmlProfilerService::RangeLocation) {
|
} else if (messageType == QQmlProfilerDefinitions::RangeLocation) {
|
||||||
QString fileName;
|
QString fileName;
|
||||||
int line;
|
int line;
|
||||||
int column = -1;
|
int column = -1;
|
||||||
|
@ -277,10 +277,11 @@ void QmlProfilerClient::messageReceived(const QByteArray &data)
|
||||||
d->rangeLocations[range].pop() : QmlEventLocation();
|
d->rangeLocations[range].pop() : QmlEventLocation();
|
||||||
|
|
||||||
qint64 startTime = d->rangeStartTimes[range].pop();
|
qint64 startTime = d->rangeStartTimes[range].pop();
|
||||||
QQmlProfilerService::BindingType bindingType = QQmlProfilerService::QmlBinding;
|
QQmlProfilerDefinitions::BindingType bindingType =
|
||||||
if (range == (int)QQmlProfilerService::Binding)
|
QQmlProfilerDefinitions::QmlBinding;
|
||||||
|
if (range == (int)QQmlProfilerDefinitions::Binding)
|
||||||
bindingType = d->bindingTypes.pop();
|
bindingType = d->bindingTypes.pop();
|
||||||
emit this->range((QQmlProfilerService::RangeType)range,
|
emit this->range((QQmlProfilerDefinitions::RangeType)range,
|
||||||
bindingType, startTime, time - startTime, data, location);
|
bindingType, startTime, time - startTime, data, location);
|
||||||
if (d->rangeCount[range] == 0) {
|
if (d->rangeCount[range] == 0) {
|
||||||
int count = d->rangeDatas[range].count() +
|
int count = d->rangeDatas[range].count() +
|
||||||
|
|
|
@ -35,8 +35,8 @@
|
||||||
#define QMLPROFILERCLIENT_H
|
#define QMLPROFILERCLIENT_H
|
||||||
|
|
||||||
#include "qqmldebugclient.h"
|
#include "qqmldebugclient.h"
|
||||||
#include <QtQml/private/qqmlprofilerservice_p.h>
|
|
||||||
#include "qmlprofilereventlocation.h"
|
#include "qmlprofilereventlocation.h"
|
||||||
|
#include <QtQml/private/qqmlprofilerdefinitions_p.h>
|
||||||
|
|
||||||
class ProfilerClientPrivate;
|
class ProfilerClientPrivate;
|
||||||
class ProfilerClient : public QQmlDebugClient
|
class ProfilerClient : public QQmlDebugClient
|
||||||
|
@ -83,19 +83,19 @@ public slots:
|
||||||
signals:
|
signals:
|
||||||
void traceFinished( qint64 time );
|
void traceFinished( qint64 time );
|
||||||
void traceStarted( qint64 time );
|
void traceStarted( qint64 time );
|
||||||
void range(QQmlProfilerService::RangeType type,
|
void range(QQmlProfilerDefinitions::RangeType type,
|
||||||
QQmlProfilerService::BindingType bindingType,
|
QQmlProfilerDefinitions::BindingType bindingType,
|
||||||
qint64 startTime, qint64 length,
|
qint64 startTime, qint64 length,
|
||||||
const QStringList &data,
|
const QStringList &data,
|
||||||
const QmlEventLocation &location);
|
const QmlEventLocation &location);
|
||||||
void frame(qint64 time, int frameRate, int animationCount, int threadId);
|
void frame(qint64 time, int frameRate, int animationCount, int threadId);
|
||||||
void sceneGraphFrame(QQmlProfilerService::SceneGraphFrameType type, qint64 time,
|
void sceneGraphFrame(QQmlProfilerDefinitions::SceneGraphFrameType type, qint64 time,
|
||||||
qint64 numericData1, qint64 numericData2, qint64 numericData3,
|
qint64 numericData1, qint64 numericData2, qint64 numericData3,
|
||||||
qint64 numericData4, qint64 numericData5);
|
qint64 numericData4, qint64 numericData5);
|
||||||
void pixmapCache(QQmlProfilerService::PixmapEventType, qint64 time,
|
void pixmapCache(QQmlProfilerDefinitions::PixmapEventType, qint64 time,
|
||||||
const QmlEventLocation &location, int width, int height, int refCount);
|
const QmlEventLocation &location, int width, int height, int refCount);
|
||||||
void memoryAllocation(QQmlProfilerService::MemoryType type, qint64 time, qint64 amount);
|
void memoryAllocation(QQmlProfilerDefinitions::MemoryType type, qint64 time, qint64 amount);
|
||||||
void inputEvent(QQmlProfilerService::EventType, qint64 time);
|
void inputEvent(QQmlProfilerDefinitions::EventType, qint64 time);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void messageReceived(const QByteArray &);
|
virtual void messageReceived(const QByteArray &);
|
||||||
|
|
|
@ -72,16 +72,16 @@ struct QmlRangeEventData {
|
||||||
QmlRangeEventData() {} // never called
|
QmlRangeEventData() {} // never called
|
||||||
QmlRangeEventData(const QString &_displayName, int _detailType, const QString &_eventHashStr,
|
QmlRangeEventData(const QString &_displayName, int _detailType, const QString &_eventHashStr,
|
||||||
const QmlEventLocation &_location, const QString &_details,
|
const QmlEventLocation &_location, const QString &_details,
|
||||||
QQmlProfilerService::Message _message,
|
QQmlProfilerDefinitions::Message _message,
|
||||||
QQmlProfilerService::RangeType _rangeType)
|
QQmlProfilerDefinitions::RangeType _rangeType)
|
||||||
: displayName(_displayName), eventHashStr(_eventHashStr), location(_location),
|
: displayName(_displayName), eventHashStr(_eventHashStr), location(_location),
|
||||||
details(_details), message(_message), rangeType(_rangeType), detailType(_detailType) {}
|
details(_details), message(_message), rangeType(_rangeType), detailType(_detailType) {}
|
||||||
QString displayName;
|
QString displayName;
|
||||||
QString eventHashStr;
|
QString eventHashStr;
|
||||||
QmlEventLocation location;
|
QmlEventLocation location;
|
||||||
QString details;
|
QString details;
|
||||||
QQmlProfilerService::Message message;
|
QQmlProfilerDefinitions::Message message;
|
||||||
QQmlProfilerService::RangeType rangeType;
|
QQmlProfilerDefinitions::RangeType rangeType;
|
||||||
int detailType; // can be BindingType, PixmapCacheEventType or SceneGraphFrameType
|
int detailType; // can be BindingType, PixmapCacheEventType or SceneGraphFrameType
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -208,7 +208,7 @@ QString QmlProfilerData::getHashStringForV8Event(const QString &displayName, con
|
||||||
return QString(QStringLiteral("%1:%2")).arg(displayName, function);
|
return QString(QStringLiteral("%1:%2")).arg(displayName, function);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QmlProfilerData::qmlRangeTypeAsString(QQmlProfilerService::RangeType type)
|
QString QmlProfilerData::qmlRangeTypeAsString(QQmlProfilerDefinitions::RangeType type)
|
||||||
{
|
{
|
||||||
if (type * sizeof(QString) < sizeof(RANGE_TYPE_STRINGS))
|
if (type * sizeof(QString) < sizeof(RANGE_TYPE_STRINGS))
|
||||||
return QLatin1String(RANGE_TYPE_STRINGS[type]);
|
return QLatin1String(RANGE_TYPE_STRINGS[type]);
|
||||||
|
@ -216,7 +216,7 @@ QString QmlProfilerData::qmlRangeTypeAsString(QQmlProfilerService::RangeType typ
|
||||||
return QString::number(type);
|
return QString::number(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QmlProfilerData::qmlMessageAsString(QQmlProfilerService::Message type)
|
QString QmlProfilerData::qmlMessageAsString(QQmlProfilerDefinitions::Message type)
|
||||||
{
|
{
|
||||||
if (type * sizeof(QString) < sizeof(MESSAGE_STRINGS))
|
if (type * sizeof(QString) < sizeof(MESSAGE_STRINGS))
|
||||||
return QLatin1String(MESSAGE_STRINGS[type]);
|
return QLatin1String(MESSAGE_STRINGS[type]);
|
||||||
|
@ -246,8 +246,8 @@ qint64 QmlProfilerData::traceEndTime() const
|
||||||
return d->traceEndTime;
|
return d->traceEndTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlProfilerData::addQmlEvent(QQmlProfilerService::RangeType type,
|
void QmlProfilerData::addQmlEvent(QQmlProfilerDefinitions::RangeType type,
|
||||||
QQmlProfilerService::BindingType bindingType,
|
QQmlProfilerDefinitions::BindingType bindingType,
|
||||||
qint64 startTime,
|
qint64 startTime,
|
||||||
qint64 duration,
|
qint64 duration,
|
||||||
const QStringList &data,
|
const QStringList &data,
|
||||||
|
@ -290,7 +290,7 @@ void QmlProfilerData::addQmlEvent(QQmlProfilerService::RangeType type,
|
||||||
newEvent = d->eventDescriptions[eventHashStr];
|
newEvent = d->eventDescriptions[eventHashStr];
|
||||||
} else {
|
} else {
|
||||||
newEvent = new QmlRangeEventData(displayName, bindingType, eventHashStr, location, details,
|
newEvent = new QmlRangeEventData(displayName, bindingType, eventHashStr, location, details,
|
||||||
QQmlProfilerService::MaximumMessage, type);
|
QQmlProfilerDefinitions::MaximumMessage, type);
|
||||||
d->eventDescriptions.insert(eventHashStr, newEvent);
|
d->eventDescriptions.insert(eventHashStr, newEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -311,11 +311,11 @@ void QmlProfilerData::addFrameEvent(qint64 time, int framerate, int animationcou
|
||||||
if (d->eventDescriptions.contains(eventHashStr)) {
|
if (d->eventDescriptions.contains(eventHashStr)) {
|
||||||
newEvent = d->eventDescriptions[eventHashStr];
|
newEvent = d->eventDescriptions[eventHashStr];
|
||||||
} else {
|
} else {
|
||||||
newEvent = new QmlRangeEventData(displayName, QQmlProfilerService::AnimationFrame,
|
newEvent = new QmlRangeEventData(displayName, QQmlProfilerDefinitions::AnimationFrame,
|
||||||
eventHashStr,
|
eventHashStr,
|
||||||
QmlEventLocation(), details,
|
QmlEventLocation(), details,
|
||||||
QQmlProfilerService::Event,
|
QQmlProfilerDefinitions::Event,
|
||||||
QQmlProfilerService::MaximumRangeType);
|
QQmlProfilerDefinitions::MaximumRangeType);
|
||||||
d->eventDescriptions.insert(eventHashStr, newEvent);
|
d->eventDescriptions.insert(eventHashStr, newEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -325,7 +325,10 @@ void QmlProfilerData::addFrameEvent(qint64 time, int framerate, int animationcou
|
||||||
d->startInstanceList.append(rangeEventStartInstance);
|
d->startInstanceList.append(rangeEventStartInstance);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlProfilerData::addSceneGraphFrameEvent(QQmlProfilerDefinitions::SceneGraphFrameType type, qint64 time, qint64 numericData1, qint64 numericData2, qint64 numericData3, qint64 numericData4, qint64 numericData5)
|
void QmlProfilerData::addSceneGraphFrameEvent(QQmlProfilerDefinitions::SceneGraphFrameType type,
|
||||||
|
qint64 time, qint64 numericData1, qint64 numericData2,
|
||||||
|
qint64 numericData3, qint64 numericData4,
|
||||||
|
qint64 numericData5)
|
||||||
{
|
{
|
||||||
setState(AcquiringData);
|
setState(AcquiringData);
|
||||||
|
|
||||||
|
@ -336,8 +339,8 @@ void QmlProfilerData::addSceneGraphFrameEvent(QQmlProfilerDefinitions::SceneGrap
|
||||||
} else {
|
} else {
|
||||||
newEvent = new QmlRangeEventData(QStringLiteral("<SceneGraph>"), type, eventHashStr,
|
newEvent = new QmlRangeEventData(QStringLiteral("<SceneGraph>"), type, eventHashStr,
|
||||||
QmlEventLocation(), QString(),
|
QmlEventLocation(), QString(),
|
||||||
QQmlProfilerService::SceneGraphFrame,
|
QQmlProfilerDefinitions::SceneGraphFrame,
|
||||||
QQmlProfilerService::MaximumRangeType);
|
QQmlProfilerDefinitions::MaximumRangeType);
|
||||||
d->eventDescriptions.insert(eventHashStr, newEvent);
|
d->eventDescriptions.insert(eventHashStr, newEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -362,8 +365,8 @@ void QmlProfilerData::addPixmapCacheEvent(QQmlProfilerDefinitions::PixmapEventTy
|
||||||
newEvent = d->eventDescriptions[eventHashStr];
|
newEvent = d->eventDescriptions[eventHashStr];
|
||||||
} else {
|
} else {
|
||||||
newEvent = new QmlRangeEventData(eventHashStr, type, eventHashStr, location, QString(),
|
newEvent = new QmlRangeEventData(eventHashStr, type, eventHashStr, location, QString(),
|
||||||
QQmlProfilerService::PixmapCacheEvent,
|
QQmlProfilerDefinitions::PixmapCacheEvent,
|
||||||
QQmlProfilerService::MaximumRangeType);
|
QQmlProfilerDefinitions::MaximumRangeType);
|
||||||
d->eventDescriptions.insert(eventHashStr, newEvent);
|
d->eventDescriptions.insert(eventHashStr, newEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -372,7 +375,7 @@ void QmlProfilerData::addPixmapCacheEvent(QQmlProfilerDefinitions::PixmapEventTy
|
||||||
d->startInstanceList.append(rangeEventStartInstance);
|
d->startInstanceList.append(rangeEventStartInstance);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlProfilerData::addMemoryEvent(QQmlProfilerService::MemoryType type, qint64 time,
|
void QmlProfilerData::addMemoryEvent(QQmlProfilerDefinitions::MemoryType type, qint64 time,
|
||||||
qint64 size)
|
qint64 size)
|
||||||
{
|
{
|
||||||
setState(AcquiringData);
|
setState(AcquiringData);
|
||||||
|
@ -382,8 +385,8 @@ void QmlProfilerData::addMemoryEvent(QQmlProfilerService::MemoryType type, qint6
|
||||||
newEvent = d->eventDescriptions[eventHashStr];
|
newEvent = d->eventDescriptions[eventHashStr];
|
||||||
} else {
|
} else {
|
||||||
newEvent = new QmlRangeEventData(eventHashStr, type, eventHashStr, QmlEventLocation(),
|
newEvent = new QmlRangeEventData(eventHashStr, type, eventHashStr, QmlEventLocation(),
|
||||||
QString(), QQmlProfilerService::MemoryAllocation,
|
QString(), QQmlProfilerDefinitions::MemoryAllocation,
|
||||||
QQmlProfilerService::MaximumRangeType);
|
QQmlProfilerDefinitions::MaximumRangeType);
|
||||||
d->eventDescriptions.insert(eventHashStr, newEvent);
|
d->eventDescriptions.insert(eventHashStr, newEvent);
|
||||||
}
|
}
|
||||||
QmlRangeEventStartInstance rangeEventStartInstance(time, size, 0, 0, 0, 0, newEvent);
|
QmlRangeEventStartInstance rangeEventStartInstance(time, size, 0, 0, 0, 0, newEvent);
|
||||||
|
@ -401,8 +404,8 @@ void QmlProfilerData::addInputEvent(QQmlProfilerDefinitions::EventType type, qin
|
||||||
newEvent = d->eventDescriptions[eventHashStr];
|
newEvent = d->eventDescriptions[eventHashStr];
|
||||||
} else {
|
} else {
|
||||||
newEvent = new QmlRangeEventData(QString(), type, eventHashStr, QmlEventLocation(),
|
newEvent = new QmlRangeEventData(QString(), type, eventHashStr, QmlEventLocation(),
|
||||||
QString(), QQmlProfilerService::Event,
|
QString(), QQmlProfilerDefinitions::Event,
|
||||||
QQmlProfilerService::MaximumRangeType);
|
QQmlProfilerDefinitions::MaximumRangeType);
|
||||||
d->eventDescriptions.insert(eventHashStr, newEvent);
|
d->eventDescriptions.insert(eventHashStr, newEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -489,7 +492,7 @@ void QmlProfilerData::computeQmlTime()
|
||||||
for (int i = 0; i < d->startInstanceList.count(); i++) {
|
for (int i = 0; i < d->startInstanceList.count(); i++) {
|
||||||
qint64 st = d->startInstanceList[i].startTime;
|
qint64 st = d->startInstanceList[i].startTime;
|
||||||
|
|
||||||
if (d->startInstanceList[i].data->rangeType == QQmlProfilerService::Painting) {
|
if (d->startInstanceList[i].data->rangeType == QQmlProfilerDefinitions::Painting) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -601,9 +604,10 @@ bool QmlProfilerData::save(const QString &filename)
|
||||||
|
|
||||||
foreach (const QmlRangeEventData *eventData, d->eventDescriptions.values()) {
|
foreach (const QmlRangeEventData *eventData, d->eventDescriptions.values()) {
|
||||||
stream.writeStartElement(QStringLiteral("event"));
|
stream.writeStartElement(QStringLiteral("event"));
|
||||||
stream.writeAttribute(QStringLiteral("index"), QString::number(d->eventDescriptions.keys().indexOf(eventData->eventHashStr)));
|
stream.writeAttribute(QStringLiteral("index"), QString::number(
|
||||||
|
d->eventDescriptions.keys().indexOf(eventData->eventHashStr)));
|
||||||
stream.writeTextElement(QStringLiteral("displayname"), eventData->displayName);
|
stream.writeTextElement(QStringLiteral("displayname"), eventData->displayName);
|
||||||
if (eventData->rangeType != QQmlProfilerService::MaximumRangeType)
|
if (eventData->rangeType != QQmlProfilerDefinitions::MaximumRangeType)
|
||||||
stream.writeTextElement(QStringLiteral("type"),
|
stream.writeTextElement(QStringLiteral("type"),
|
||||||
qmlRangeTypeAsString(eventData->rangeType));
|
qmlRangeTypeAsString(eventData->rangeType));
|
||||||
else
|
else
|
||||||
|
@ -611,35 +615,37 @@ bool QmlProfilerData::save(const QString &filename)
|
||||||
qmlMessageAsString(eventData->message));
|
qmlMessageAsString(eventData->message));
|
||||||
if (!eventData->location.filename.isEmpty()) {
|
if (!eventData->location.filename.isEmpty()) {
|
||||||
stream.writeTextElement(QStringLiteral("filename"), eventData->location.filename);
|
stream.writeTextElement(QStringLiteral("filename"), eventData->location.filename);
|
||||||
stream.writeTextElement(QStringLiteral("line"), QString::number(eventData->location.line));
|
stream.writeTextElement(QStringLiteral("line"),
|
||||||
stream.writeTextElement(QStringLiteral("column"), QString::number(eventData->location.column));
|
QString::number(eventData->location.line));
|
||||||
|
stream.writeTextElement(QStringLiteral("column"),
|
||||||
|
QString::number(eventData->location.column));
|
||||||
}
|
}
|
||||||
stream.writeTextElement(QStringLiteral("details"), eventData->details);
|
stream.writeTextElement(QStringLiteral("details"), eventData->details);
|
||||||
if (eventData->rangeType == QQmlProfilerService::Binding)
|
if (eventData->rangeType == QQmlProfilerDefinitions::Binding)
|
||||||
stream.writeTextElement(QStringLiteral("bindingType"),
|
stream.writeTextElement(QStringLiteral("bindingType"),
|
||||||
QString::number((int)eventData->detailType));
|
QString::number((int)eventData->detailType));
|
||||||
else if (eventData->message == QQmlProfilerService::Event) {
|
else if (eventData->message == QQmlProfilerDefinitions::Event) {
|
||||||
switch (eventData->detailType) {
|
switch (eventData->detailType) {
|
||||||
case QQmlProfilerService::AnimationFrame:
|
case QQmlProfilerDefinitions::AnimationFrame:
|
||||||
stream.writeTextElement(QStringLiteral("animationFrame"),
|
stream.writeTextElement(QStringLiteral("animationFrame"),
|
||||||
QString::number((int)eventData->detailType));
|
QString::number((int)eventData->detailType));
|
||||||
break;
|
break;
|
||||||
case QQmlProfilerService::Key:
|
case QQmlProfilerDefinitions::Key:
|
||||||
stream.writeTextElement(QStringLiteral("keyEvent"),
|
stream.writeTextElement(QStringLiteral("keyEvent"),
|
||||||
QString::number((int)eventData->detailType));
|
QString::number((int)eventData->detailType));
|
||||||
break;
|
break;
|
||||||
case QQmlProfilerService::Mouse:
|
case QQmlProfilerDefinitions::Mouse:
|
||||||
stream.writeTextElement(QStringLiteral("mouseEvent"),
|
stream.writeTextElement(QStringLiteral("mouseEvent"),
|
||||||
QString::number((int)eventData->detailType));
|
QString::number((int)eventData->detailType));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (eventData->message == QQmlProfilerService::PixmapCacheEvent)
|
} else if (eventData->message == QQmlProfilerDefinitions::PixmapCacheEvent)
|
||||||
stream.writeTextElement(QStringLiteral("cacheEventType"),
|
stream.writeTextElement(QStringLiteral("cacheEventType"),
|
||||||
QString::number((int)eventData->detailType));
|
QString::number((int)eventData->detailType));
|
||||||
else if (eventData->message == QQmlProfilerService::SceneGraphFrame)
|
else if (eventData->message == QQmlProfilerDefinitions::SceneGraphFrame)
|
||||||
stream.writeTextElement(QStringLiteral("sgEventType"),
|
stream.writeTextElement(QStringLiteral("sgEventType"),
|
||||||
QString::number((int)eventData->detailType));
|
QString::number((int)eventData->detailType));
|
||||||
else if (eventData->message == QQmlProfilerService::MemoryAllocation)
|
else if (eventData->message == QQmlProfilerDefinitions::MemoryAllocation)
|
||||||
stream.writeTextElement(QStringLiteral("memoryEventType"),
|
stream.writeTextElement(QStringLiteral("memoryEventType"),
|
||||||
QString::number((int)eventData->detailType));
|
QString::number((int)eventData->detailType));
|
||||||
stream.writeEndElement();
|
stream.writeEndElement();
|
||||||
|
@ -653,26 +659,30 @@ bool QmlProfilerData::save(const QString &filename)
|
||||||
if (event.duration >= 0)
|
if (event.duration >= 0)
|
||||||
stream.writeAttribute(QStringLiteral("duration"),
|
stream.writeAttribute(QStringLiteral("duration"),
|
||||||
QString::number(event.duration));
|
QString::number(event.duration));
|
||||||
stream.writeAttribute(QStringLiteral("eventIndex"), QString::number(d->eventDescriptions.keys().indexOf(event.data->eventHashStr)));
|
stream.writeAttribute(QStringLiteral("eventIndex"), QString::number(
|
||||||
if (event.data->message == QQmlProfilerService::Event &&
|
d->eventDescriptions.keys().indexOf(event.data->eventHashStr)));
|
||||||
event.data->detailType == QQmlProfilerService::AnimationFrame) {
|
if (event.data->message == QQmlProfilerDefinitions::Event &&
|
||||||
|
event.data->detailType == QQmlProfilerDefinitions::AnimationFrame) {
|
||||||
// special: animation frame
|
// special: animation frame
|
||||||
stream.writeAttribute(QStringLiteral("framerate"), QString::number(event.frameRate));
|
stream.writeAttribute(QStringLiteral("framerate"), QString::number(event.frameRate));
|
||||||
stream.writeAttribute(QStringLiteral("animationcount"), QString::number(event.animationCount));
|
stream.writeAttribute(QStringLiteral("animationcount"),
|
||||||
|
QString::number(event.animationCount));
|
||||||
stream.writeAttribute(QStringLiteral("thread"), QString::number(event.threadId));
|
stream.writeAttribute(QStringLiteral("thread"), QString::number(event.threadId));
|
||||||
} else if (event.data->message == QQmlProfilerService::PixmapCacheEvent) {
|
} else if (event.data->message == QQmlProfilerDefinitions::PixmapCacheEvent) {
|
||||||
// special: pixmap cache event
|
// special: pixmap cache event
|
||||||
if (event.data->detailType == QQmlProfilerService::PixmapSizeKnown) {
|
if (event.data->detailType == QQmlProfilerDefinitions::PixmapSizeKnown) {
|
||||||
stream.writeAttribute(QStringLiteral("width"),
|
stream.writeAttribute(QStringLiteral("width"),
|
||||||
QString::number(event.numericData1));
|
QString::number(event.numericData1));
|
||||||
stream.writeAttribute(QStringLiteral("height"),
|
stream.writeAttribute(QStringLiteral("height"),
|
||||||
QString::number(event.numericData2));
|
QString::number(event.numericData2));
|
||||||
} else if (event.data->detailType == QQmlProfilerService::PixmapReferenceCountChanged ||
|
} else if (event.data->detailType ==
|
||||||
event.data->detailType == QQmlProfilerService::PixmapCacheCountChanged) {
|
QQmlProfilerDefinitions::PixmapReferenceCountChanged ||
|
||||||
|
event.data->detailType ==
|
||||||
|
QQmlProfilerDefinitions::PixmapCacheCountChanged) {
|
||||||
stream.writeAttribute(QStringLiteral("refCount"),
|
stream.writeAttribute(QStringLiteral("refCount"),
|
||||||
QString::number(event.numericData3));
|
QString::number(event.numericData3));
|
||||||
}
|
}
|
||||||
} else if (event.data->message == QQmlProfilerService::SceneGraphFrame) {
|
} else if (event.data->message == QQmlProfilerDefinitions::SceneGraphFrame) {
|
||||||
// special: scenegraph frame events
|
// special: scenegraph frame events
|
||||||
if (event.numericData1 > 0)
|
if (event.numericData1 > 0)
|
||||||
stream.writeAttribute(QStringLiteral("timing1"),
|
stream.writeAttribute(QStringLiteral("timing1"),
|
||||||
|
@ -689,7 +699,7 @@ bool QmlProfilerData::save(const QString &filename)
|
||||||
if (event.numericData5 > 0)
|
if (event.numericData5 > 0)
|
||||||
stream.writeAttribute(QStringLiteral("timing5"),
|
stream.writeAttribute(QStringLiteral("timing5"),
|
||||||
QString::number(event.numericData5));
|
QString::number(event.numericData5));
|
||||||
} else if (event.data->message == QQmlProfilerService::MemoryAllocation) {
|
} else if (event.data->message == QQmlProfilerDefinitions::MemoryAllocation) {
|
||||||
stream.writeAttribute(QStringLiteral("amount"), QString::number(event.numericData1));
|
stream.writeAttribute(QStringLiteral("amount"), QString::number(event.numericData1));
|
||||||
}
|
}
|
||||||
stream.writeEndElement();
|
stream.writeEndElement();
|
||||||
|
@ -700,7 +710,8 @@ bool QmlProfilerData::save(const QString &filename)
|
||||||
stream.writeAttribute(QStringLiteral("totalTime"), QString::number(d->v8MeasuredTime));
|
stream.writeAttribute(QStringLiteral("totalTime"), QString::number(d->v8MeasuredTime));
|
||||||
foreach (QV8EventInfo *v8event, d->v8EventHash.values()) {
|
foreach (QV8EventInfo *v8event, d->v8EventHash.values()) {
|
||||||
stream.writeStartElement(QStringLiteral("event"));
|
stream.writeStartElement(QStringLiteral("event"));
|
||||||
stream.writeAttribute(QStringLiteral("index"), QString::number(d->v8EventHash.keys().indexOf(v8event->eventHashStr)));
|
stream.writeAttribute(QStringLiteral("index"),QString::number(
|
||||||
|
d->v8EventHash.keys().indexOf(v8event->eventHashStr)));
|
||||||
stream.writeTextElement(QStringLiteral("displayname"), v8event->displayName);
|
stream.writeTextElement(QStringLiteral("displayname"), v8event->displayName);
|
||||||
stream.writeTextElement(QStringLiteral("functionname"), v8event->functionName);
|
stream.writeTextElement(QStringLiteral("functionname"), v8event->functionName);
|
||||||
if (!v8event->fileName.isEmpty()) {
|
if (!v8event->fileName.isEmpty()) {
|
||||||
|
@ -719,7 +730,8 @@ bool QmlProfilerData::save(const QString &filename)
|
||||||
}
|
}
|
||||||
|
|
||||||
stream.writeAttribute(QStringLiteral("list"), childrenIndexes.join(QString(", ")));
|
stream.writeAttribute(QStringLiteral("list"), childrenIndexes.join(QString(", ")));
|
||||||
stream.writeAttribute(QStringLiteral("childrenTimes"), childrenTimes.join(QString(", ")));
|
stream.writeAttribute(QStringLiteral("childrenTimes"),
|
||||||
|
childrenTimes.join(QString(", ")));
|
||||||
stream.writeEndElement();
|
stream.writeEndElement();
|
||||||
}
|
}
|
||||||
stream.writeEndElement();
|
stream.writeEndElement();
|
||||||
|
|
|
@ -34,9 +34,9 @@
|
||||||
#ifndef QMLPROFILERDATA_H
|
#ifndef QMLPROFILERDATA_H
|
||||||
#define QMLPROFILERDATA_H
|
#define QMLPROFILERDATA_H
|
||||||
|
|
||||||
#include <QtQml/private/qqmlprofilerservice_p.h>
|
|
||||||
#include "qmlprofilereventlocation.h"
|
#include "qmlprofilereventlocation.h"
|
||||||
|
|
||||||
|
#include <QtQml/private/qqmlprofilerdefinitions_p.h>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
class QmlProfilerDataPrivate;
|
class QmlProfilerDataPrivate;
|
||||||
|
@ -56,8 +56,8 @@ public:
|
||||||
|
|
||||||
static QString getHashStringForQmlEvent(const QmlEventLocation &location, int eventType);
|
static QString getHashStringForQmlEvent(const QmlEventLocation &location, int eventType);
|
||||||
static QString getHashStringForV8Event(const QString &displayName, const QString &function);
|
static QString getHashStringForV8Event(const QString &displayName, const QString &function);
|
||||||
static QString qmlRangeTypeAsString(QQmlProfilerService::RangeType type);
|
static QString qmlRangeTypeAsString(QQmlProfilerDefinitions::RangeType type);
|
||||||
static QString qmlMessageAsString(QQmlProfilerService::Message type);
|
static QString qmlMessageAsString(QQmlProfilerDefinitions::Message type);
|
||||||
static QString rootEventName();
|
static QString rootEventName();
|
||||||
static QString rootEventDescription();
|
static QString rootEventDescription();
|
||||||
|
|
||||||
|
@ -75,20 +75,20 @@ public slots:
|
||||||
void clear();
|
void clear();
|
||||||
void setTraceEndTime(qint64 time);
|
void setTraceEndTime(qint64 time);
|
||||||
void setTraceStartTime(qint64 time);
|
void setTraceStartTime(qint64 time);
|
||||||
void addQmlEvent(QQmlProfilerService::RangeType type,
|
void addQmlEvent(QQmlProfilerDefinitions::RangeType type,
|
||||||
QQmlProfilerService::BindingType bindingType,
|
QQmlProfilerDefinitions::BindingType bindingType,
|
||||||
qint64 startTime, qint64 duration, const QStringList &data,
|
qint64 startTime, qint64 duration, const QStringList &data,
|
||||||
const QmlEventLocation &location);
|
const QmlEventLocation &location);
|
||||||
void addV8Event(int depth, const QString &function, const QString &filename,
|
void addV8Event(int depth, const QString &function, const QString &filename,
|
||||||
int lineNumber, double totalTime, double selfTime);
|
int lineNumber, double totalTime, double selfTime);
|
||||||
void addFrameEvent(qint64 time, int framerate, int animationcount, int threadId);
|
void addFrameEvent(qint64 time, int framerate, int animationcount, int threadId);
|
||||||
void addSceneGraphFrameEvent(QQmlProfilerService::SceneGraphFrameType type, qint64 time,
|
void addSceneGraphFrameEvent(QQmlProfilerDefinitions::SceneGraphFrameType type, qint64 time,
|
||||||
qint64 numericData1, qint64 numericData2, qint64 numericData3,
|
qint64 numericData1, qint64 numericData2, qint64 numericData3,
|
||||||
qint64 numericData4, qint64 numericData5);
|
qint64 numericData4, qint64 numericData5);
|
||||||
void addPixmapCacheEvent(QQmlProfilerService::PixmapEventType type, qint64 time,
|
void addPixmapCacheEvent(QQmlProfilerDefinitions::PixmapEventType type, qint64 time,
|
||||||
const QmlEventLocation &location, int width, int height, int refcount);
|
const QmlEventLocation &location, int width, int height, int refcount);
|
||||||
void addMemoryEvent(QQmlProfilerService::MemoryType type, qint64 time, qint64 size);
|
void addMemoryEvent(QQmlProfilerDefinitions::MemoryType type, qint64 time, qint64 size);
|
||||||
void addInputEvent(QQmlProfilerService::EventType type, qint64 time);
|
void addInputEvent(QQmlProfilerDefinitions::EventType type, qint64 time);
|
||||||
|
|
||||||
void complete();
|
void complete();
|
||||||
bool save(const QString &filename);
|
bool save(const QString &filename);
|
||||||
|
|
Loading…
Reference in New Issue