Commit 94722ec5 authored by Ulf Hermann's avatar Ulf Hermann

QmlProfiler: Unify event type definitions

Generally save both the Message and RangeType attributes so that we
avoid clashes between those types. Also keep all the types in one
place and make their names follow qtdeclarative's conventions.

Change-Id: I811bfcc4b72aaa2a0142babc92d96968ed2d4007
Reviewed-by: default avatarKai Koehne <kai.koehne@digia.com>
parent 83df6206
......@@ -30,19 +30,43 @@
#ifndef QMLPROFILEREVENTTYPES_H
#define QMLPROFILEREVENTTYPES_H
#include <QtGlobal>
namespace QmlDebug {
enum QmlEventType {
Painting,
enum Message {
Event,
RangeStart,
RangeData,
RangeLocation,
RangeEnd,
Complete,
PixmapCacheEvent,
SceneGraphFrame,
MaximumMessage
};
enum EventType {
FramePaint, // unused
Mouse,
Key,
AnimationFrame, // new Qt5 paint events
EndTrace,
StartTrace,
MaximumEventType
};
enum RangeType {
Painting, // old Qt4 paint events
Compiling,
Creating,
Binding,
HandlingSignal,
Javascript,
PixmapCacheEvent,
SceneGraphFrameEvent,
MaximumQmlEventType
MaximumRangeType
};
enum BindingType {
......@@ -50,11 +74,36 @@ enum BindingType {
V8Binding,
OptimizedBinding,
QPainterEvent,
AnimationFrame,
MaximumBindingType
};
enum PixmapEventType {
PixmapSizeKnown,
PixmapReferenceCountChanged,
PixmapCacheCountChanged,
PixmapLoadingStarted,
PixmapLoadingFinished,
PixmapLoadingError,
MaximumPixmapEventType
};
enum SceneGraphFrameType {
SceneGraphRendererFrame,
SceneGraphAdaptationLayerFrame,
SceneGraphContextFrame,
SceneGraphRenderLoopFrame,
SceneGraphTexturePrepare,
SceneGraphTextureDeletion,
SceneGraphPolishAndSync,
SceneGraphWindowsRenderShow,
SceneGraphWindowsAnimations,
SceneGraphWindowsPolishFrame,
MaximumSceneGraphFrameType
};
enum AnimationThread {
GuiThread,
RenderThread,
......
......@@ -39,18 +39,18 @@ public:
, maximumTime(0)
, recording(false)
{
::memset(rangeCount, 0, MaximumQmlEventType * sizeof(int));
::memset(rangeCount, 0, MaximumRangeType * sizeof(int));
}
void sendRecordingStatus();
QmlProfilerTraceClient *q;
qint64 inProgressRanges;
QStack<qint64> rangeStartTimes[MaximumQmlEventType];
QStack<QStringList> rangeDatas[MaximumQmlEventType];
QStack<QmlEventLocation> rangeLocations[MaximumQmlEventType];
QStack<qint64> rangeStartTimes[MaximumRangeType];
QStack<QStringList> rangeDatas[MaximumRangeType];
QStack<QmlEventLocation> rangeLocations[MaximumRangeType];
QStack<BindingType> bindingTypes;
int rangeCount[MaximumQmlEventType];
int rangeCount[MaximumRangeType];
qint64 maximumTime;
bool recording;
};
......@@ -86,8 +86,8 @@ QmlProfilerTraceClient::~QmlProfilerTraceClient()
void QmlProfilerTraceClient::clearData()
{
::memset(d->rangeCount, 0, MaximumQmlEventType * sizeof(int));
for (int eventType = 0; eventType < MaximumQmlEventType; eventType++) {
::memset(d->rangeCount, 0, MaximumRangeType * sizeof(int));
for (int eventType = 0; eventType < MaximumRangeType; eventType++) {
d->rangeDatas[eventType].clear();
d->rangeLocations[eventType].clear();
d->rangeStartTimes[eventType].clear();
......@@ -175,8 +175,8 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data)
stream >> threadId;
else
threadId = 0;
emit rangedEvent(QmlDebug::Painting, QmlDebug::AnimationFrame, time, 0,
QStringList(), QmlDebug::QmlEventLocation(), frameRate, animationCount, threadId,0,0);
emit rangedEvent(Event, MaximumRangeType, AnimationFrame, time, 0, QStringList(),
QmlDebug::QmlEventLocation(), frameRate, animationCount, threadId,0,0);
d->maximumTime = qMax(time, d->maximumTime);
} else if (event == StartTrace) {
emit this->traceStarted(time);
......@@ -198,8 +198,9 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data)
}
while (count<5)
params[count++] = 0;
emit rangedEvent(SceneGraphFrameEvent, sgEventType,time, 0, QStringList(),
QmlDebug::QmlEventLocation(), params[0], params[1], params[2], params[3], params[4]);
emit rangedEvent(SceneGraphFrame, QmlDebug::MaximumRangeType, sgEventType,time, 0,
QStringList(), QmlDebug::QmlEventLocation(), params[0], params[1],
params[2], params[3], params[4]);
} else if (messageType == PixmapCacheEvent) {
int pixEvTy, width = 0, height = 0, refcount = 0;
QString pixUrl;
......@@ -210,14 +211,15 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data)
stream >> width >> height;
refcount = 1;
}
emit rangedEvent(QmlDebug::PixmapCacheEvent, pixEvTy, time, 0, QStringList(),
QmlDebug::QmlEventLocation(pixUrl,0,0), width, height, refcount, 0, 0);
emit rangedEvent(QmlDebug::PixmapCacheEvent, QmlDebug::MaximumRangeType, pixEvTy, time, 0,
QStringList(), QmlDebug::QmlEventLocation(pixUrl,0,0), width, height,
refcount, 0, 0);
d->maximumTime = qMax(time, d->maximumTime);
} else {
int range;
stream >> range;
if (range >= MaximumQmlEventType)
if (range >= MaximumRangeType)
return;
if (messageType == RangeStart) {
......@@ -226,7 +228,7 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data)
++d->rangeCount[range];
// read binding type
if ((QmlEventType)range == Binding) {
if ((RangeType)range == Binding) {
int bindingType = (int)QmlBinding;
if (!stream.atEnd())
stream >> bindingType;
......@@ -270,12 +272,12 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data)
qint64 startTime = d->rangeStartTimes[range].pop();
BindingType bindingType = QmlBinding;
if ((QmlEventType)range == Binding)
if ((RangeType)range == Binding)
bindingType = d->bindingTypes.pop();
if ((QmlEventType)range == Painting)
if ((RangeType)range == Painting)
bindingType = QPainterEvent;
emit rangedEvent((QmlEventType)range, bindingType, startTime, time - startTime, data,
location, 0, 0, 0, 0, 0);
emit rangedEvent(MaximumMessage, (RangeType)range, bindingType, startTime,
time - startTime, data, location, 0, 0, 0, 0, 0);
if (d->rangeCount[range] == 0) {
int count = d->rangeDatas[range].count() +
d->rangeStartTimes[range].count() +
......
......@@ -53,41 +53,6 @@ public:
QmlProfilerTraceClient(QmlDebugConnection *client);
~QmlProfilerTraceClient();
enum EventType {
FramePaint,
Mouse,
Key,
AnimationFrame,
EndTrace,
StartTrace,
MaximumEventType
};
enum Message {
Event,
RangeStart,
RangeData,
RangeLocation,
RangeEnd,
Complete,
PixmapCacheEvent,
SceneGraphFrame,
MaximumMessage
};
enum PixmapEventType {
PixmapSizeKnown,
PixmapReferenceCountChanged,
PixmapCacheCountChanged,
PixmapLoadingStarted,
PixmapLoadingFinished,
PixmapLoadingError,
MaximumPixmapEventType
};
bool isEnabled() const;
bool isRecording() const;
void setRecording(bool);
......@@ -102,9 +67,10 @@ signals:
void event(int event, qint64 time);
void traceFinished( qint64 time );
void traceStarted( qint64 time );
void rangedEvent(int type, int bindingType, qint64 startTime, qint64 length,
const QStringList &data, const QmlDebug::QmlEventLocation &location,
qint64 param1, qint64 param2, qint64 param3, qint64 param4, qint64 param5);
void rangedEvent(QmlDebug::Message, QmlDebug::RangeType, int detailType, qint64 startTime,
qint64 length, const QStringList &data,
const QmlDebug::QmlEventLocation &location, qint64 param1, qint64 param2,
qint64 param3, qint64 param4, qint64 param5);
void recordingChanged(bool arg);
void enabledChanged();
......
......@@ -175,11 +175,13 @@ void QmlProfilerClientManager::connectClientSignals()
connect(d->qmlclientplugin.data(), SIGNAL(complete(qint64)),
this, SLOT(qmlComplete(qint64)));
connect(d->qmlclientplugin.data(),
SIGNAL(rangedEvent(int,int,qint64,qint64,QStringList,QmlDebug::QmlEventLocation,
qint64,qint64,qint64,qint64,qint64)),
SIGNAL(rangedEvent(QmlDebug::Message,QmlDebug::RangeType,int,qint64,qint64,
QStringList,QmlDebug::QmlEventLocation,qint64,qint64,qint64,
qint64,qint64)),
d->modelManager,
SLOT(addQmlEvent(int,int,qint64,qint64,QStringList,QmlDebug::QmlEventLocation,
qint64,qint64,qint64,qint64,qint64)));
SLOT(addQmlEvent(QmlDebug::Message,QmlDebug::RangeType,int,qint64,qint64,
QStringList,QmlDebug::QmlEventLocation,qint64,qint64,qint64,qint64,
qint64)));
connect(d->qmlclientplugin.data(), SIGNAL(traceFinished(qint64)),
d->modelManager->traceTime(), SLOT(setEndTime(qint64)));
connect(d->qmlclientplugin.data(), SIGNAL(traceStarted(qint64)),
......
......@@ -55,7 +55,7 @@ QString getInitialDetails(const QmlProfilerDataModel::QmlEventData &event);
QmlDebug::QmlEventLocation getLocation(const QmlProfilerDataModel::QmlEventData &event)
{
QmlDebug::QmlEventLocation eventLocation = event.location;
if ((event.eventType == QmlDebug::Creating || event.eventType == QmlDebug::Compiling)
if ((event.rangeType == QmlDebug::Creating || event.rangeType == QmlDebug::Compiling)
&& eventLocation.filename.isEmpty()) {
eventLocation.filename = getInitialDetails(event);
eventLocation.line = 1;
......@@ -169,7 +169,7 @@ void QmlProfilerDataModel::complete()
// request further details from files
//
if (event->eventType != QmlDebug::Binding && event->eventType != QmlDebug::HandlingSignal)
if (event->rangeType != QmlDebug::Binding && event->rangeType != QmlDebug::HandlingSignal)
continue;
// This skips anonymous bindings in Qt4.8 (we don't have valid location data for them)
......@@ -189,7 +189,8 @@ void QmlProfilerDataModel::complete()
QmlProfilerBaseModel::complete();
}
void QmlProfilerDataModel::addQmlEvent(int type, int bindingType, qint64 startTime,
void QmlProfilerDataModel::addQmlEvent(QmlDebug::Message message, QmlDebug::RangeType rangeType,
int detailType, qint64 startTime,
qint64 duration, const QStringList &data,
const QmlDebug::QmlEventLocation &location,
qint64 ndata1, qint64 ndata2, qint64 ndata3,
......@@ -197,7 +198,7 @@ void QmlProfilerDataModel::addQmlEvent(int type, int bindingType, qint64 startTi
{
Q_D(QmlProfilerDataModel);
QString displayName;
if (type == QmlDebug::Painting && bindingType == QmlDebug::AnimationFrame) {
if (message == QmlDebug::Event && detailType == QmlDebug::AnimationFrame) {
displayName = tr("Animations");
} else {
displayName = QString::fromLatin1("%1:%2").arg(
......@@ -205,8 +206,8 @@ void QmlProfilerDataModel::addQmlEvent(int type, int bindingType, qint64 startTi
QString::number(location.line));
}
QmlEventData eventData = {displayName, type, bindingType, startTime, duration, data, location,
ndata1, ndata2, ndata3, ndata4, ndata5};
QmlEventData eventData = {displayName, message, rangeType, detailType, startTime, duration,
data, location, ndata1, ndata2, ndata3, ndata4, ndata5};
d->eventList.append(eventData);
d->modelManager->modelProxyCountUpdated(d->modelId, startTime,
......@@ -219,8 +220,8 @@ QString QmlProfilerDataModel::getHashString(const QmlProfilerDataModel::QmlEvent
event.location.filename,
QString::number(event.location.line),
QString::number(event.location.column),
QString::number(event.eventType),
QString::number(event.bindingType));
QString::number((event.message << 8) | event.rangeType),
QString::number(event.detailType));
}
qint64 QmlProfilerDataModel::lastTimeMark() const
......
......@@ -30,6 +30,7 @@
#ifndef QMLPROFILERDATAMODEL_H
#define QMLPROFILERDATAMODEL_H
#include <qmldebug/qmlprofilereventtypes.h>
#include "qmlprofilerbasemodel.h"
namespace QmlProfiler {
......@@ -40,8 +41,9 @@ class QMLPROFILER_EXPORT QmlProfilerDataModel : public QmlProfilerBaseModel
public:
struct QmlEventData {
QString displayName;
int eventType;
int bindingType;
QmlDebug::Message message;
QmlDebug::RangeType rangeType;
int detailType; // can be EventType, BindingType, PixmapEventType or SceneGraphFrameType
qint64 startTime;
qint64 duration;
QStringList data;
......@@ -60,9 +62,10 @@ public:
virtual void clear();
virtual bool isEmpty() const;
virtual void complete();
void addQmlEvent(int type, int bindingType, qint64 startTime, qint64 duration,
const QStringList &data, const QmlDebug::QmlEventLocation &location,
qint64 ndata1, qint64 ndata2, qint64 ndata3, qint64 ndata4, qint64 ndata5);
void addQmlEvent(QmlDebug::Message message, QmlDebug::RangeType rangeType, int bindingType,
qint64 startTime, qint64 duration, const QStringList &data,
const QmlDebug::QmlEventLocation &location, qint64 ndata1, qint64 ndata2,
qint64 ndata3, qint64 ndata4, qint64 ndata5);
static QString getHashString(const QmlProfilerDataModel::QmlEventData &event);
qint64 lastTimeMark() const;
......
......@@ -58,7 +58,7 @@ public:
int modelId;
QList<QmlDebug::QmlEventType> acceptedTypes;
QList<QmlDebug::RangeType> acceptedTypes;
QSet<QString> eventsInBindingLoop;
};
......@@ -80,7 +80,7 @@ QmlProfilerEventsModelProxy::~QmlProfilerEventsModelProxy()
delete d;
}
void QmlProfilerEventsModelProxy::setEventTypeAccepted(QmlDebug::QmlEventType type, bool accepted)
void QmlProfilerEventsModelProxy::setEventTypeAccepted(QmlDebug::RangeType type, bool accepted)
{
if (accepted && !d->acceptedTypes.contains(type))
d->acceptedTypes << type;
......@@ -88,7 +88,7 @@ void QmlProfilerEventsModelProxy::setEventTypeAccepted(QmlDebug::QmlEventType ty
d->acceptedTypes.removeOne(type);
}
bool QmlProfilerEventsModelProxy::eventTypeAccepted(QmlDebug::QmlEventType type) const
bool QmlProfilerEventsModelProxy::eventTypeAccepted(QmlDebug::RangeType type) const
{
return d->acceptedTypes.contains(type);
}
......@@ -144,7 +144,7 @@ void QmlProfilerEventsModelProxy::loadData(qint64 rangeStart, qint64 rangeEnd)
for (int i = 0; i < eventList.size(); ++i) {
const QmlProfilerDataModel::QmlEventData *event = &eventList[i];
if (!d->acceptedTypes.contains((QmlDebug::QmlEventType)event->eventType))
if (!d->acceptedTypes.contains(event->rangeType))
continue;
if (checkRanges) {
......@@ -161,8 +161,9 @@ void QmlProfilerEventsModelProxy::loadData(qint64 rangeStart, qint64 rangeEnd)
hash,
event->data.join(QLatin1String(" ")),
event->location,
event->eventType,
event->bindingType,
event->message,
event->rangeType,
event->detailType,
event->duration,
1, //calls
event->duration, //minTime
......@@ -257,7 +258,8 @@ void QmlProfilerEventsModelProxy::loadData(qint64 rangeStart, qint64 rangeEnd)
rootEventName, // hash
tr("Main Program"), //event.details,
rootEventLocation, // location
(int)QmlDebug::Binding, // event type
QmlDebug::MaximumMessage,
QmlDebug::Binding, // event type
0, // binding type
qmlTime + 1,
1, //calls
......@@ -347,6 +349,7 @@ void QmlProfilerEventParentsModelProxy::loadData()
QString rootEventName = tr("<program>");
QmlProfilerDataModel::QmlEventData rootEvent = {
rootEventName,
QmlDebug::MaximumMessage,
QmlDebug::Binding,
0,
0,
......@@ -370,7 +373,7 @@ void QmlProfilerEventParentsModelProxy::loadData()
const QVector<QmlProfilerDataModel::QmlEventData> eventList = simpleModel->getEvents();
foreach (const QmlProfilerDataModel::QmlEventData &event, eventList) {
// whitelist
if (!m_eventsModel->eventTypeAccepted((QmlDebug::QmlEventType)event.eventType))
if (!m_eventsModel->eventTypeAccepted(event.rangeType))
continue;
// level computation
......@@ -407,7 +410,7 @@ void QmlProfilerEventParentsModelProxy::loadData()
m_data[eventHash].insert(parentHash, QmlEventRelativesData());
QmlEventRelativesData *parent = &(m_data[eventHash][parentHash]);
parent->displayName = parentEvent->displayName;
parent->eventType = parentEvent->eventType;
parent->rangeType = parentEvent->rangeType;
parent->duration = event.duration;
parent->calls = 1;
parent->details = parentEvent->data.join(QLatin1String(""));
......@@ -450,7 +453,7 @@ void QmlProfilerEventChildrenModelProxy::loadData()
const QVector<QmlProfilerDataModel::QmlEventData> eventList = simpleModel->getEvents();
foreach (const QmlProfilerDataModel::QmlEventData &event, eventList) {
// whitelist
if (!m_eventsModel->eventTypeAccepted((QmlDebug::QmlEventType)event.eventType))
if (!m_eventsModel->eventTypeAccepted(event.rangeType))
continue;
// level computation
......@@ -480,7 +483,7 @@ void QmlProfilerEventChildrenModelProxy::loadData()
m_data[parentHash].insert(eventHash, QmlEventRelativesData());
QmlEventRelativesData *child = &(m_data[parentHash][eventHash]);
child->displayName = event.displayName;
child->eventType = event.eventType;
child->rangeType = event.rangeType;
child->duration = event.duration;
child->calls = 1;
child->details = event.data.join(QLatin1String(""));
......
......@@ -53,7 +53,8 @@ public:
QString eventHashStr;
QString details;
QmlDebug::QmlEventLocation location;
int eventType;
QmlDebug::Message message;
QmlDebug::RangeType rangeType;
int bindingType;
qint64 duration;
......@@ -70,8 +71,8 @@ public:
QmlProfilerEventsModelProxy(QmlProfilerModelManager *modelManager, QObject *parent = 0);
~QmlProfilerEventsModelProxy();
void setEventTypeAccepted(QmlDebug::QmlEventType type, bool accepted);
bool eventTypeAccepted(QmlDebug::QmlEventType) const;
void setEventTypeAccepted(QmlDebug::RangeType type, bool accepted);
bool eventTypeAccepted(QmlDebug::RangeType) const;
const QList<QmlEventStats> getData() const;
int count() const;
......@@ -104,7 +105,7 @@ class QmlProfilerEventRelativesModelProxy : public QObject
public:
struct QmlEventRelativesData {
QString displayName;
int eventType;
QmlDebug::RangeType rangeType;
qint64 duration;
qint64 calls;
QString details;
......
......@@ -561,9 +561,9 @@ void QmlProfilerEventsMainView::parseModelProxy()
newRow << new EventsViewItem(event.displayName);
if (d->m_fieldShown[Type]) {
QString typeString = QmlProfilerEventsMainView::nameForType(event.eventType);
QString typeString = QmlProfilerEventsMainView::nameForType(event.rangeType);
QString toolTipText;
if (event.eventType == Binding) {
if (event.rangeType == Binding) {
if (event.bindingType == (int)OptimizedBinding) {
typeString = typeString + QLatin1Char(' ') + tr("(Opt)");
toolTipText = tr("Binding is evaluated by the optimized engine.");
......@@ -645,17 +645,17 @@ void QmlProfilerEventsMainView::parseModelProxy()
}
}
QString QmlProfilerEventsMainView::nameForType(int typeNumber)
QString QmlProfilerEventsMainView::nameForType(QmlDebug::RangeType typeNumber)
{
switch (typeNumber) {
case 0: return QmlProfilerEventsMainView::tr("Paint");
case 1: return QmlProfilerEventsMainView::tr("Compile");
case 2: return QmlProfilerEventsMainView::tr("Create");
case 3: return QmlProfilerEventsMainView::tr("Binding");
case 4: return QmlProfilerEventsMainView::tr("Signal");
case 5: return QmlProfilerEventsMainView::tr("JavaScript");
case QmlDebug::Painting: return QmlProfilerEventsMainView::tr("Paint");
case QmlDebug::Compiling: return QmlProfilerEventsMainView::tr("Compile");
case QmlDebug::Creating: return QmlProfilerEventsMainView::tr("Create");
case QmlDebug::Binding: return QmlProfilerEventsMainView::tr("Binding");
case QmlDebug::HandlingSignal: return QmlProfilerEventsMainView::tr("Signal");
case QmlDebug::Javascript: return QmlProfilerEventsMainView::tr("JavaScript");
default: return QString();
}
return QString();
}
void QmlProfilerEventsMainView::getStatisticsInRange(qint64 rangeStart, qint64 rangeEnd)
......@@ -867,7 +867,7 @@ void QmlProfilerEventRelativesView::rebuildTree(QmlProfilerEventRelativesModelPr
// maybe we should store the data in this proxy and get it here
// no indirections at this level of abstraction!
newRow << new EventsViewItem(event.displayName);
newRow << new EventsViewItem(QmlProfilerEventsMainView::nameForType(event.eventType));
newRow << new EventsViewItem(QmlProfilerEventsMainView::nameForType(event.rangeType));
newRow << new EventsViewItem(QmlProfilerBaseModel::formatTime(event.duration));
newRow << new EventsViewItem(QString::number(event.calls));
newRow << new EventsViewItem(event.details);
......
......@@ -119,7 +119,7 @@ public:
void copyTableToClipboard() const;
void copyRowToClipboard() const;
static QString nameForType(int typeNumber);
static QString nameForType(QmlDebug::RangeType typeNumber);
void getStatisticsInRange(qint64 rangeStart, qint64 rangeEnd);
QString selectedEventHash() const;
......
......@@ -249,8 +249,9 @@ void QmlProfilerModelManager::newTimeEstimation(qint64 estimation)
d->estimatedTime = estimation;
}
void QmlProfilerModelManager::addQmlEvent(int type,
int bindingType,
void QmlProfilerModelManager::addQmlEvent(QmlDebug::Message message,
QmlDebug::RangeType rangeType,
int detailType,
qint64 startTime,
qint64 length,
const QStringList &data,
......@@ -266,7 +267,8 @@ void QmlProfilerModelManager::addQmlEvent(int type,
d->traceTime->setStartTime(startTime);
QTC_ASSERT(state() == QmlProfilerDataState::AcquiringData, /**/);
d->model->addQmlEvent(type, bindingType, startTime, length, data, location, ndata1, ndata2, ndata3, ndata4, ndata5);
d->model->addQmlEvent(message, rangeType, detailType, startTime, length, data, location,
ndata1, ndata2, ndata3, ndata4, ndata5);
}
void QmlProfilerModelManager::addV8Event(int depth, const QString &function, const QString &filename,
......@@ -353,10 +355,12 @@ void QmlProfilerModelManager::load()
QmlProfilerFileReader reader;
connect(&reader, SIGNAL(error(QString)), this, SIGNAL(error(QString)));
connect(&reader, SIGNAL(rangedEvent(int,int,qint64,qint64,QStringList,QmlDebug::QmlEventLocation,
connect(&reader, SIGNAL(rangedEvent(QmlDebug::Message,QmlDebug::RangeType,int,qint64,qint64,
QStringList,QmlDebug::QmlEventLocation,
qint64, qint64, qint64, qint64, qint64)),
this, SLOT(addQmlEvent(int,int,qint64,qint64,QStringList,QmlDebug::QmlEventLocation,
qint64, qint64, qint64, qint64, qint64)));
this, SLOT(addQmlEvent(QmlDebug::Message,QmlDebug::RangeType,int,qint64,qint64,
QStringList,QmlDebug::QmlEventLocation,
qint64, qint64, qint64, qint64, qint64)));
connect(&reader, SIGNAL(traceStartTime(qint64)), traceTime(), SLOT(setStartTime(qint64)));
connect(&reader, SIGNAL(traceEndTime(qint64)), traceTime(), SLOT(setEndTime(qint64)));
reader.setV8DataModel(d->v8Model);
......
......@@ -33,6 +33,7 @@
#include "qmlprofiler_global.h"
#include <qmldebug/qmlprofilereventlocation.h>
#include <qmldebug/qmlprofilereventtypes.h>
#include <utils/fileinprojectfinder.h>
#include <QObject>
......@@ -138,8 +139,9 @@ public slots:
void clear();
void prepareForWriting();
void addQmlEvent(int type, int bindingType, qint64 startTime, qint64 length,
const QStringList &data, const QmlDebug::QmlEventLocation &location,
void addQmlEvent(QmlDebug::Message message, QmlDebug::RangeType rangeType, int bindingType,
qint64 startTime, qint64 length, const QStringList &data,
const QmlDebug::QmlEventLocation &location,
qint64 ndata1, qint64 ndata2, qint64 ndata3, qint64 ndata4, qint64 ndata5);
void addV8Event(int depth, const QString &function,const QString &filename, int lineNumber,
double totalTime, double selfTime);
......
......@@ -63,7 +63,7 @@ private:
PaintEventsModelProxy::PaintEventsModelProxy(QObject *parent)
: SingleCategoryTimelineModel(new PaintEventsModelProxyPrivate,
QLatin1String("PaintEventsModelProxy"), tr("Painting"),
QmlDebug::Painting, parent)
QmlDebug::Event, QmlDebug::MaximumRangeType, parent)
{
Q_D(PaintEventsModelProxy);
d->seenForeignPaintEvent = false;
......@@ -84,7 +84,7 @@ void PaintEventsModelProxy::clear()
bool PaintEventsModelProxy::eventAccepted(const QmlProfilerDataModel::QmlEventData &event) const
{
return SingleCategoryTimelineModel::eventAccepted(event) &&
event.bindingType == QmlDebug::AnimationFrame;
event.detailType== QmlDebug::AnimationFrame;
}
void PaintEventsModelProxy::loadData()
......@@ -103,7 +103,7 @@ void PaintEventsModelProxy::loadData()
foreach (const QmlProfilerDataModel::QmlEventData &event, referenceList) {
if (!eventAccepted(event)) {
if (event.eventType == QmlDebug::Painting)
if (event.rangeType == QmlDebug::Painting)
d->seenForeignPaintEvent = true;
continue;
}
......
......@@ -92,7 +92,7 @@ void BasicTimelineModel::clear()
void BasicTimelineModel::BasicTimelineModelPrivate::prepare()
{
categorySpan.clear();
for (int i = 0; i < QmlDebug::MaximumQmlEventType; i++) {
for (int i = 0; i < QmlDebug::MaximumRangeType; i++) {
CategorySpan newCategory = {false, 1, 1, i};
categorySpan << newCategory;
}
......@@ -100,11 +100,8 @@ void BasicTimelineModel::BasicTimelineModelPrivate::prepare()
bool BasicTimelineModel::eventAccepted(const QmlProfilerDataModel::QmlEventData &event) const
{
// only accept Qt4.x Painting events
if (event.eventType == QmlDebug::Painting)
return (event.bindingType == QmlDebug::QPainterEvent);
return (event.eventType <= QmlDebug::Javascript);
// Accept all range types. Qt5 paint events aren't ranges
return (event.rangeType != QmlDebug::MaximumRangeType);
}