diff options
Diffstat (limited to 'tools/qmlprofiler')
-rw-r--r-- | tools/qmlprofiler/commandlistener.cpp | 2 | ||||
-rw-r--r-- | tools/qmlprofiler/commandlistener.h | 2 | ||||
-rw-r--r-- | tools/qmlprofiler/constants.h | 2 | ||||
-rw-r--r-- | tools/qmlprofiler/profileclient.cpp | 62 | ||||
-rw-r--r-- | tools/qmlprofiler/profileclient.h | 22 | ||||
-rw-r--r-- | tools/qmlprofiler/profiledata.cpp | 244 | ||||
-rw-r--r-- | tools/qmlprofiler/profiledata.h | 42 | ||||
-rw-r--r-- | tools/qmlprofiler/qmlprofiler.pro | 4 | ||||
-rw-r--r-- | tools/qmlprofiler/qmlprofilerapplication.cpp | 58 | ||||
-rw-r--r-- | tools/qmlprofiler/qmlprofilerapplication.h | 10 |
10 files changed, 224 insertions, 224 deletions
diff --git a/tools/qmlprofiler/commandlistener.cpp b/tools/qmlprofiler/commandlistener.cpp index cc969160d6..aa3659636d 100644 --- a/tools/qmlprofiler/commandlistener.cpp +++ b/tools/qmlprofiler/commandlistener.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/tools/qmlprofiler/commandlistener.h b/tools/qmlprofiler/commandlistener.h index 77fd79362d..abe302cb8a 100644 --- a/tools/qmlprofiler/commandlistener.h +++ b/tools/qmlprofiler/commandlistener.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/tools/qmlprofiler/constants.h b/tools/qmlprofiler/constants.h index 2e6acda275..e5a1f8025d 100644 --- a/tools/qmlprofiler/constants.h +++ b/tools/qmlprofiler/constants.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage diff --git a/tools/qmlprofiler/profileclient.cpp b/tools/qmlprofiler/profileclient.cpp index 3e84569f2f..85287464cf 100644 --- a/tools/qmlprofiler/profileclient.cpp +++ b/tools/qmlprofiler/profileclient.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -45,8 +45,8 @@ #include <QtCore/QStringList> ProfileClient::ProfileClient(const QString &clientName, - QDeclarativeDebugConnection *client) - : QDeclarativeDebugClient(clientName, client), + QQmlDebugConnection *client) + : QQmlDebugClient(clientName, client), m_recording(false), m_enabled(false) { @@ -103,45 +103,45 @@ void ProfileClient::stateChanged(State status) } -class DeclarativeProfileClientPrivate +class QmlProfileClientPrivate { public: - DeclarativeProfileClientPrivate() + QmlProfileClientPrivate() : inProgressRanges(0) , maximumTime(0) { ::memset(rangeCount, 0, - QDeclarativeProfilerService::MaximumRangeType * sizeof(int)); + QQmlProfilerService::MaximumRangeType * sizeof(int)); } qint64 inProgressRanges; - QStack<qint64> rangeStartTimes[QDeclarativeProfilerService::MaximumRangeType]; - QStack<QStringList> rangeDatas[QDeclarativeProfilerService::MaximumRangeType]; - QStack<EventLocation> rangeLocations[QDeclarativeProfilerService::MaximumRangeType]; - int rangeCount[QDeclarativeProfilerService::MaximumRangeType]; + QStack<qint64> rangeStartTimes[QQmlProfilerService::MaximumRangeType]; + QStack<QStringList> rangeDatas[QQmlProfilerService::MaximumRangeType]; + QStack<EventLocation> rangeLocations[QQmlProfilerService::MaximumRangeType]; + int rangeCount[QQmlProfilerService::MaximumRangeType]; qint64 maximumTime; }; -DeclarativeProfileClient::DeclarativeProfileClient( - QDeclarativeDebugConnection *client) +QmlProfileClient::QmlProfileClient( + QQmlDebugConnection *client) : ProfileClient(QLatin1String("CanvasFrameRate"), client), - d(new DeclarativeProfileClientPrivate) + d(new QmlProfileClientPrivate) { } -DeclarativeProfileClient::~DeclarativeProfileClient() +QmlProfileClient::~QmlProfileClient() { delete d; } -void DeclarativeProfileClient::clearData() +void QmlProfileClient::clearData() { ::memset(d->rangeCount, 0, - QDeclarativeProfilerService::MaximumRangeType * sizeof(int)); + QQmlProfilerService::MaximumRangeType * sizeof(int)); ProfileClient::clearData(); } -void DeclarativeProfileClient::sendRecordingStatus() +void QmlProfileClient::sendRecordingStatus() { QByteArray ba; QDataStream stream(&ba, QIODevice::WriteOnly); @@ -149,7 +149,7 @@ void DeclarativeProfileClient::sendRecordingStatus() sendMessage(ba); } -void DeclarativeProfileClient::messageReceived(const QByteArray &data) +void QmlProfileClient::messageReceived(const QByteArray &data) { QByteArray rwData = data; QDataStream stream(&rwData, QIODevice::ReadOnly); @@ -159,43 +159,43 @@ void DeclarativeProfileClient::messageReceived(const QByteArray &data) stream >> time >> messageType; - if (messageType >= QDeclarativeProfilerService::MaximumMessage) + if (messageType >= QQmlProfilerService::MaximumMessage) return; - if (messageType == QDeclarativeProfilerService::Event) { + if (messageType == QQmlProfilerService::Event) { int event; stream >> event; - if (event == QDeclarativeProfilerService::EndTrace) { + if (event == QQmlProfilerService::EndTrace) { emit this->traceFinished(time); d->maximumTime = time; d->maximumTime = qMax(time, d->maximumTime); - } else if (event == QDeclarativeProfilerService::AnimationFrame) { + } else if (event == QQmlProfilerService::AnimationFrame) { int frameRate, animationCount; stream >> frameRate >> animationCount; emit this->frame(time, frameRate, animationCount); d->maximumTime = qMax(time, d->maximumTime); - } else if (event == QDeclarativeProfilerService::StartTrace) { + } else if (event == QQmlProfilerService::StartTrace) { emit this->traceStarted(time); d->maximumTime = time; - } else if (event < QDeclarativeProfilerService::MaximumEventType) { + } else if (event < QQmlProfilerService::MaximumEventType) { d->maximumTime = qMax(time, d->maximumTime); } - } else if (messageType == QDeclarativeProfilerService::Complete) { + } else if (messageType == QQmlProfilerService::Complete) { emit complete(); } else { int range; stream >> range; - if (range >= QDeclarativeProfilerService::MaximumRangeType) + if (range >= QQmlProfilerService::MaximumRangeType) return; - if (messageType == QDeclarativeProfilerService::RangeStart) { + if (messageType == QQmlProfilerService::RangeStart) { d->rangeStartTimes[range].push(time); d->inProgressRanges |= (static_cast<qint64>(1) << range); ++d->rangeCount[range]; - } else if (messageType == QDeclarativeProfilerService::RangeData) { + } else if (messageType == QQmlProfilerService::RangeData) { QString data; stream >> data; @@ -206,7 +206,7 @@ void DeclarativeProfileClient::messageReceived(const QByteArray &data) d->rangeDatas[range][count-1] << data; } - } else if (messageType == QDeclarativeProfilerService::RangeLocation) { + } else if (messageType == QQmlProfilerService::RangeLocation) { QString fileName; int line; int column = -1; @@ -232,7 +232,7 @@ void DeclarativeProfileClient::messageReceived(const QByteArray &data) d->rangeLocations[range].pop() : EventLocation(); qint64 startTime = d->rangeStartTimes[range].pop(); - emit this->range((QDeclarativeProfilerService::RangeType)range, + emit this->range((QQmlProfilerService::RangeType)range, startTime, time - startTime, data, location); if (d->rangeCount[range] == 0) { int count = d->rangeDatas[range].count() + @@ -246,7 +246,7 @@ void DeclarativeProfileClient::messageReceived(const QByteArray &data) } } -V8ProfileClient::V8ProfileClient(QDeclarativeDebugConnection *client) +V8ProfileClient::V8ProfileClient(QQmlDebugConnection *client) : ProfileClient(QLatin1String("V8Profiler"), client) { } diff --git a/tools/qmlprofiler/profileclient.h b/tools/qmlprofiler/profileclient.h index 87e9dbc508..8aa4e67982 100644 --- a/tools/qmlprofiler/profileclient.h +++ b/tools/qmlprofiler/profileclient.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -44,11 +44,11 @@ #include "profiledata.h" -#include <QtDeclarative/private/qdeclarativedebugclient_p.h> -#include <QtDeclarative/private/qdeclarativeprofilerservice_p.h> +#include <QtQml/private/qqmldebugclient_p.h> +#include <QtQml/private/qqmlprofilerservice_p.h> class ProfileClientPrivate; -class ProfileClient : public QDeclarativeDebugClient +class ProfileClient : public QQmlDebugClient { Q_OBJECT @@ -58,7 +58,7 @@ class ProfileClient : public QDeclarativeDebugClient public: ProfileClient(const QString & clientName, - QDeclarativeDebugConnection *client); + QQmlDebugConnection *client); ~ProfileClient(); bool isEnabled() const; @@ -83,13 +83,13 @@ protected: bool m_enabled; }; -class DeclarativeProfileClient : public ProfileClient +class QmlProfileClient : public ProfileClient { Q_OBJECT public: - DeclarativeProfileClient(QDeclarativeDebugConnection *client); - ~DeclarativeProfileClient(); + QmlProfileClient(QQmlDebugConnection *client); + ~QmlProfileClient(); public slots: void clearData(); @@ -98,7 +98,7 @@ public slots: signals: void traceFinished( qint64 time ); void traceStarted( qint64 time ); - void range(QDeclarativeProfilerService::RangeType type, qint64 startTime, + void range(QQmlProfilerService::RangeType type, qint64 startTime, qint64 length, const QStringList &data, const EventLocation &location); void frame(qint64 time, int frameRate, int animationCount); @@ -107,7 +107,7 @@ protected: virtual void messageReceived(const QByteArray &); private: - class DeclarativeProfileClientPrivate *d; + class QmlProfileClientPrivate *d; }; class V8ProfileClient : public ProfileClient @@ -122,7 +122,7 @@ public: V8MaximumMessage }; - V8ProfileClient(QDeclarativeDebugConnection *client); + V8ProfileClient(QQmlDebugConnection *client); ~V8ProfileClient(); public slots: diff --git a/tools/qmlprofiler/profiledata.cpp b/tools/qmlprofiler/profiledata.cpp index 19c282b97c..6082f4aa94 100644 --- a/tools/qmlprofiler/profiledata.cpp +++ b/tools/qmlprofiler/profiledata.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -50,9 +50,9 @@ using namespace Constants; -DeclarativeEvent::DeclarativeEvent() +QmlEvent::QmlEvent() { - eventType = QDeclarativeProfilerService::MaximumRangeType; + eventType = QQmlProfilerService::MaximumRangeType; eventId = -1; duration = 0; calls = 0; @@ -64,7 +64,7 @@ DeclarativeEvent::DeclarativeEvent() isBindingLoop = false; } -DeclarativeEvent::~DeclarativeEvent() +QmlEvent::~QmlEvent() { qDeleteAll(parentHash.values()); parentHash.clear(); @@ -72,7 +72,7 @@ DeclarativeEvent::~DeclarativeEvent() childrenHash.clear(); } -DeclarativeEvent &DeclarativeEvent::operator=(const DeclarativeEvent &ref) +QmlEvent &QmlEvent::operator=(const QmlEvent &ref) { if (this == &ref) return *this; @@ -96,14 +96,14 @@ DeclarativeEvent &DeclarativeEvent::operator=(const DeclarativeEvent &ref) parentHash.clear(); foreach (const QString &key, ref.parentHash.keys()) { parentHash.insert(key, - new DeclarativeEventSub(ref.parentHash.value(key))); + new QmlEventSub(ref.parentHash.value(key))); } qDeleteAll(childrenHash.values()); childrenHash.clear(); foreach (const QString &key, ref.childrenHash.keys()) { childrenHash.insert(key, - new DeclarativeEventSub(ref.childrenHash.value(key))); + new QmlEventSub(ref.childrenHash.value(key))); } return *this; @@ -157,21 +157,21 @@ V8Event &V8Event::operator=(const V8Event &ref) } // endtimedata -struct DeclarativeEventEndTime { +struct QmlEventEndTime { qint64 endTime; int startTimeIndex; - DeclarativeEvent *description; + QmlEvent *description; }; // starttimedata -struct DeclarativeEventStartTime{ +struct QmlEventStartTime{ qint64 startTime; qint64 length; qint64 level; int endTimeIndex; qint64 nestingLevel; qint64 nestingDepth; - DeclarativeEvent *description; + QmlEvent *description; // animation-related data int frameRate; @@ -180,46 +180,46 @@ struct DeclarativeEventStartTime{ int bindingLoopHead; }; -struct DeclarativeEventTypeCount { +struct QmlEventTypeCount { QList <int> eventIds; int nestingCount; }; // used by quicksort -bool compareEndTimes(const DeclarativeEventEndTime &t1, - const DeclarativeEventEndTime &t2) +bool compareEndTimes(const QmlEventEndTime &t1, + const QmlEventEndTime &t2) { return t1.endTime < t2.endTime; } -bool compareStartTimes(const DeclarativeEventStartTime &t1, - const DeclarativeEventStartTime &t2) +bool compareStartTimes(const QmlEventStartTime &t1, + const QmlEventStartTime &t2) { return t1.startTime < t2.startTime; } -bool compareStartIndexes(const DeclarativeEventEndTime &t1, - const DeclarativeEventEndTime &t2) +bool compareStartIndexes(const QmlEventEndTime &t1, + const QmlEventEndTime &t2) { return t1.startTimeIndex < t2.startTimeIndex; } -QString declarativeEventType(QDeclarativeProfilerService::RangeType typeEnum) +QString qmlEventType(QQmlProfilerService::RangeType typeEnum) { switch (typeEnum) { - case QDeclarativeProfilerService::Painting: + case QQmlProfilerService::Painting: return QLatin1String(TYPE_PAINTING_STR); break; - case QDeclarativeProfilerService::Compiling: + case QQmlProfilerService::Compiling: return QLatin1String(TYPE_COMPILING_STR); break; - case QDeclarativeProfilerService::Creating: + case QQmlProfilerService::Creating: return QLatin1String(TYPE_CREATING_STR); break; - case QDeclarativeProfilerService::Binding: + case QQmlProfilerService::Binding: return QLatin1String(TYPE_BINDING_STR); break; - case QDeclarativeProfilerService::HandlingSignal: + case QQmlProfilerService::HandlingSignal: return QLatin1String(TYPE_HANDLINGSIGNAL_STR); break; default: @@ -227,32 +227,32 @@ QString declarativeEventType(QDeclarativeProfilerService::RangeType typeEnum) } } -QDeclarativeProfilerService::RangeType declarativeEventType(const QString &typeString) +QQmlProfilerService::RangeType qmlEventType(const QString &typeString) { if (typeString == QLatin1String(TYPE_PAINTING_STR)) { - return QDeclarativeProfilerService::Painting; + return QQmlProfilerService::Painting; } else if (typeString == QLatin1String(TYPE_COMPILING_STR)) { - return QDeclarativeProfilerService::Compiling; + return QQmlProfilerService::Compiling; } else if (typeString == QLatin1String(TYPE_CREATING_STR)) { - return QDeclarativeProfilerService::Creating; + return QQmlProfilerService::Creating; } else if (typeString == QLatin1String(TYPE_BINDING_STR)) { - return QDeclarativeProfilerService::Binding; + return QQmlProfilerService::Binding; } else if (typeString == QLatin1String(TYPE_HANDLINGSIGNAL_STR)) { - return QDeclarativeProfilerService::HandlingSignal; + return QQmlProfilerService::HandlingSignal; } else { bool isNumber = false; int type = typeString.toUInt(&isNumber); if (isNumber) { - return (QDeclarativeProfilerService::RangeType)type; + return (QQmlProfilerService::RangeType)type; } else { - return QDeclarativeProfilerService::MaximumRangeType; + return QQmlProfilerService::MaximumRangeType; } } } -QString getHashStringForDeclarativeEvent( +QString getHashStringForQmlEvent( EventLocation location, - QDeclarativeProfilerService::RangeType eventType) + QQmlProfilerService::RangeType eventType) { return QString("%1:%2:%3:%4").arg(location.filename, QString::number(location.line), @@ -265,31 +265,31 @@ class ProfileDataPrivate public: // convenience functions - void clearDeclarativeRootEvent(); + void clearQmlRootEvent(); void clearV8RootEvent(); // Stored data - DeclarativeEventHash m_eventDescriptions; - QList<DeclarativeEventEndTime> m_endTimeSortedList; - QList<DeclarativeEventStartTime> m_startTimeSortedList; + QmlEventHash m_eventDescriptions; + QList<QmlEventEndTime> m_endTimeSortedList; + QList<QmlEventStartTime> m_startTimeSortedList; void collectV8Statistics(); V8Events m_v8EventList; QHash<int, V8Event *> m_v8parents; - DeclarativeEvent m_qmlRootEvent; + QmlEvent m_qmlRootEvent; V8Event m_v8RootEvent; QString m_rootEventName; QString m_rootEventDesc; - QHash<int, DeclarativeEventTypeCount *> m_typeCounts; + QHash<int, QmlEventTypeCount *> m_typeCounts; qint64 m_traceEndTime; qint64 m_traceStartTime; qint64 m_qmlMeasuredTime; qint64 m_v8MeasuredTime; - DeclarativeEventStartTime *m_lastFrameEvent; + QmlEventStartTime *m_lastFrameEvent; qint64 m_maximumAnimationCount; qint64 m_minimumAnimationCount; @@ -309,7 +309,7 @@ ProfileData::ProfileData(QObject *parent) : d->m_v8MeasuredTime = 0; d->m_rootEventName = tr("<program>"); d->m_rootEventDesc = tr("Main Program"); - d->clearDeclarativeRootEvent(); + d->clearQmlRootEvent(); d->clearV8RootEvent(); d->m_lastFrameEvent = 0; d->m_maximumAnimationCount = 0; @@ -334,10 +334,10 @@ void ProfileData::clear() d->m_v8parents.clear(); - d->clearDeclarativeRootEvent(); + d->clearQmlRootEvent(); d->clearV8RootEvent(); - foreach (DeclarativeEventTypeCount *typeCount, d->m_typeCounts.values()) + foreach (QmlEventTypeCount *typeCount, d->m_typeCounts.values()) delete typeCount; d->m_typeCounts.clear(); @@ -354,14 +354,14 @@ void ProfileData::clear() emit dataClear(); } -DeclarativeEvents ProfileData::getDeclarativeEvents() const +QmlEvents ProfileData::getQmlEvents() const { return d->m_eventDescriptions.values(); } -DeclarativeEvent *ProfileData::declarativeEvent(int eventId) const +QmlEvent *ProfileData::qmlEvent(int eventId) const { - foreach (DeclarativeEvent *event, d->m_eventDescriptions.values()) { + foreach (QmlEvent *event, d->m_eventDescriptions.values()) { if (event->eventId == eventId) return event; } @@ -382,8 +382,8 @@ const V8Events& ProfileData::getV8Events() const return d->m_v8EventList; } -void ProfileData::addDeclarativeEvent( - QDeclarativeProfilerService::RangeType type, qint64 startTime, qint64 length, +void ProfileData::addQmlEvent( + QQmlProfilerService::RangeType type, qint64 startTime, qint64 length, const QStringList &data, const EventLocation &location) { const QChar colon = QLatin1Char(':'); @@ -408,7 +408,7 @@ void ProfileData::addDeclarativeEvent( // backwards compatibility: "compiling" events don't have a proper location in older // version of the protocol, but the filename is passed in the details string - if (type == QDeclarativeProfilerService::Compiling && eventLocation.filename.isEmpty()) { + if (type == QQmlProfilerService::Compiling && eventLocation.filename.isEmpty()) { eventLocation.filename = details; eventLocation.line = 1; eventLocation.column = 1; @@ -417,18 +417,18 @@ void ProfileData::addDeclarativeEvent( // generate hash if (eventLocation.filename.isEmpty()) { displayName = tr("<bytecode>"); - eventHashStr = getHashStringForDeclarativeEvent(eventLocation, type); + eventHashStr = getHashStringForQmlEvent(eventLocation, type); } else { const QString filePath = QUrl(eventLocation.filename).path(); displayName = filePath.mid(filePath.lastIndexOf(QChar('/')) + 1) + colon + QString::number(eventLocation.line); - eventHashStr = getHashStringForDeclarativeEvent(eventLocation, type); + eventHashStr = getHashStringForQmlEvent(eventLocation, type); } - DeclarativeEvent *newEvent; + QmlEvent *newEvent; if (d->m_eventDescriptions.contains(eventHashStr)) { newEvent = d->m_eventDescriptions[eventHashStr]; } else { - newEvent = new DeclarativeEvent; + newEvent = new QmlEvent; newEvent->displayname = displayName; newEvent->location = eventLocation; newEvent->eventHashStr = eventHashStr; @@ -437,12 +437,12 @@ void ProfileData::addDeclarativeEvent( d->m_eventDescriptions.insert(eventHashStr, newEvent); } - DeclarativeEventEndTime endTimeData; + QmlEventEndTime endTimeData; endTimeData.endTime = startTime + length; endTimeData.description = newEvent; endTimeData.startTimeIndex = d->m_startTimeSortedList.count(); - DeclarativeEventStartTime startTimeData; + QmlEventStartTime startTimeData; startTimeData.startTime = startTime; startTimeData.length = length; startTimeData.description = newEvent; @@ -537,14 +537,14 @@ void ProfileData::addFrameEvent(qint64 time, int framerate, int animationcount) displayName = tr("<Animation Update>"); eventHashStr = displayName; - DeclarativeEvent *newEvent; + QmlEvent *newEvent; if (d->m_eventDescriptions.contains(eventHashStr)) { newEvent = d->m_eventDescriptions[eventHashStr]; } else { - newEvent = new DeclarativeEvent; + newEvent = new QmlEvent; newEvent->displayname = displayName; newEvent->eventHashStr = eventHashStr; - newEvent->eventType = QDeclarativeProfilerService::Painting; + newEvent->eventType = QQmlProfilerService::Painting; newEvent->details = details; d->m_eventDescriptions.insert(eventHashStr, newEvent); } @@ -558,12 +558,12 @@ void ProfileData::addFrameEvent(qint64 time, int framerate, int animationcount) d->m_lastFrameEvent->startTime + d->m_lastFrameEvent->length; } - DeclarativeEventEndTime endTimeData; + QmlEventEndTime endTimeData; endTimeData.endTime = time + length; endTimeData.description = newEvent; endTimeData.startTimeIndex = d->m_startTimeSortedList.count(); - DeclarativeEventStartTime startTimeData; + QmlEventStartTime startTimeData; startTimeData.startTime = time; startTimeData.length = length; startTimeData.description = newEvent; @@ -645,13 +645,13 @@ void ProfileData::complete() postProcess(); } -void ProfileDataPrivate::clearDeclarativeRootEvent() +void ProfileDataPrivate::clearQmlRootEvent() { m_qmlRootEvent.displayname = m_rootEventName; m_qmlRootEvent.location = EventLocation(); m_qmlRootEvent.eventHashStr = m_rootEventName; m_qmlRootEvent.details = m_rootEventDesc; - m_qmlRootEvent.eventType = QDeclarativeProfilerService::Binding; + m_qmlRootEvent.eventType = QQmlProfilerService::Binding; m_qmlRootEvent.duration = 0; m_qmlRootEvent.calls = 0; m_qmlRootEvent.minTime = 0; @@ -692,7 +692,7 @@ void ProfileData::compileStatistics(qint64 startTime, qint64 endTime) double totalTime = 0; // clear existing statistics - foreach (DeclarativeEvent *eventDescription, + foreach (QmlEvent *eventDescription, d->m_eventDescriptions.values()) { eventDescription->calls = 0; // maximum possible value @@ -707,12 +707,12 @@ void ProfileData::compileStatistics(qint64 startTime, qint64 endTime) } // create root event for statistics - d->clearDeclarativeRootEvent(); + d->clearQmlRootEvent(); // compute parent-child relationship and call count - QHash<int, DeclarativeEvent*> lastParent; + QHash<int, QmlEvent*> lastParent; for (index = fromIndex; index <= toIndex; index++) { - DeclarativeEvent *eventDescription = + QmlEvent *eventDescription = d->m_startTimeSortedList[index].description; if (d->m_startTimeSortedList[index].startTime > endTime || @@ -721,7 +721,7 @@ void ProfileData::compileStatistics(qint64 startTime, qint64 endTime) continue; } - if (eventDescription->eventType == QDeclarativeProfilerService::Painting) { + if (eventDescription->eventType == QQmlProfilerService::Painting) { // skip animation/paint events continue; } @@ -736,36 +736,36 @@ void ProfileData::compileStatistics(qint64 startTime, qint64 endTime) int level = d->m_startTimeSortedList[index].level; - DeclarativeEvent *parentEvent = &d->m_qmlRootEvent; + QmlEvent *parentEvent = &d->m_qmlRootEvent; if (level > MIN_LEVEL && lastParent.contains(level-1)) { parentEvent = lastParent[level-1]; } if (!eventDescription->parentHash.contains(parentEvent->eventHashStr)) { - DeclarativeEventSub *newParentEvent = - new DeclarativeEventSub(parentEvent); + QmlEventSub *newParentEvent = + new QmlEventSub(parentEvent); newParentEvent->calls = 1; newParentEvent->duration = duration; eventDescription->parentHash.insert(parentEvent->eventHashStr, newParentEvent); } else { - DeclarativeEventSub *newParentEvent = + QmlEventSub *newParentEvent = eventDescription->parentHash.value(parentEvent->eventHashStr); newParentEvent->duration += duration; newParentEvent->calls++; } if (!parentEvent->childrenHash.contains(eventDescription->eventHashStr)) { - DeclarativeEventSub *newChildEvent = - new DeclarativeEventSub(eventDescription); + QmlEventSub *newChildEvent = + new QmlEventSub(eventDescription); newChildEvent->calls = 1; newChildEvent->duration = duration; parentEvent->childrenHash.insert(eventDescription->eventHashStr, newChildEvent); } else { - DeclarativeEventSub *newChildEvent = + QmlEventSub *newChildEvent = parentEvent->childrenHash.value(eventDescription->eventHashStr); newChildEvent->duration += duration; newChildEvent->calls++; @@ -788,29 +788,29 @@ void ProfileData::compileStatistics(qint64 startTime, qint64 endTime) d->m_qmlRootEvent.calls = 1; // insert into list - DeclarativeEvent *listedRootEvent = + QmlEvent *listedRootEvent = d->m_eventDescriptions.value(d->m_rootEventName); if (!listedRootEvent) { - listedRootEvent = new DeclarativeEvent; + listedRootEvent = new QmlEvent; d->m_eventDescriptions.insert(d->m_rootEventName, listedRootEvent); } *listedRootEvent = d->m_qmlRootEvent; // compute percentages - foreach (DeclarativeEvent *binding, d->m_eventDescriptions.values()) { + foreach (QmlEvent *binding, d->m_eventDescriptions.values()) { binding->percentOfTime = binding->duration * 100.0 / totalTime; binding->timePerCall = binding->calls > 0 ? double(binding->duration) / binding->calls : 0; } // compute median time - QHash < DeclarativeEvent* , QList<qint64> > durationLists; + QHash < QmlEvent* , QList<qint64> > durationLists; for (index = fromIndex; index <= toIndex; index++) { - DeclarativeEvent *desc = d->m_startTimeSortedList[index].description; + QmlEvent *desc = d->m_startTimeSortedList[index].description; qint64 len = d->m_startTimeSortedList[index].length; durationLists[desc].append(len); } - QMutableHashIterator < DeclarativeEvent* , QList<qint64> > iter(durationLists); + QMutableHashIterator < QmlEvent* , QList<qint64> > iter(durationLists); while (iter.hasNext()) { iter.next(); if (!iter.value().isEmpty()) { @@ -824,16 +824,16 @@ void ProfileData::prepareForDisplay() { // generate numeric ids int ndx = 0; - foreach (DeclarativeEvent *binding, d->m_eventDescriptions.values()) { + foreach (QmlEvent *binding, d->m_eventDescriptions.values()) { binding->eventId = ndx++; } // collect type counts - foreach (const DeclarativeEventStartTime &eventStartData, + foreach (const QmlEventStartTime &eventStartData, d->m_startTimeSortedList) { int typeNumber = eventStartData.description->eventType; if (!d->m_typeCounts.contains(typeNumber)) { - d->m_typeCounts[typeNumber] = new DeclarativeEventTypeCount; + d->m_typeCounts[typeNumber] = new QmlEventTypeCount; d->m_typeCounts[typeNumber]->nestingCount = 0; } if (eventStartData.nestingLevel > @@ -853,9 +853,9 @@ void ProfileData::sortStartTimes() // assuming startTimes is partially sorted // identify blocks of events and sort them with quicksort - QList<DeclarativeEventStartTime>::iterator itFrom = + QList<QmlEventStartTime>::iterator itFrom = d->m_startTimeSortedList.end() - 2; - QList<DeclarativeEventStartTime>::iterator itTo = + QList<QmlEventStartTime>::iterator itTo = d->m_startTimeSortedList.end() - 1; while (itFrom != d->m_startTimeSortedList.begin() && @@ -899,9 +899,9 @@ void ProfileData::sortEndTimes() if (d->m_endTimeSortedList.count() < 2) return; - QList<DeclarativeEventEndTime>::iterator itFrom = + QList<QmlEventEndTime>::iterator itFrom = d->m_endTimeSortedList.begin(); - QList<DeclarativeEventEndTime>::iterator itTo = + QList<QmlEventEndTime>::iterator itTo = d->m_endTimeSortedList.begin() + 1; while (itTo != d->m_endTimeSortedList.end() && @@ -948,7 +948,7 @@ void ProfileData::findAnimationLimits() for (int i = 0; i < d->m_startTimeSortedList.count(); i++) { if (d->m_startTimeSortedList[i].description->eventType == - QDeclarativeProfilerService::Painting && + QQmlProfilerService::Painting && d->m_startTimeSortedList[i].animationCount >= 0) { int animationcount = d->m_startTimeSortedList[i].animationCount; if (d->m_lastFrameEvent) { @@ -974,7 +974,7 @@ void ProfileData::computeNestingLevels() int level = MIN_LEVEL; endtimesPerLevel[MIN_LEVEL] = 0; - for (int i = 0; i < QDeclarativeProfilerService::MaximumRangeType; i++) { + for (int i = 0; i < QQmlProfilerService::MaximumRangeType; i++) { nestingLevels << MIN_LEVEL; QHash <int, qint64> dummyHash; dummyHash[MIN_LEVEL] = 0; @@ -985,7 +985,7 @@ void ProfileData::computeNestingLevels() qint64 st = d->m_startTimeSortedList[i].startTime; int type = d->m_startTimeSortedList[i].description->eventType; - if (type == QDeclarativeProfilerService::Painting) { + if (type == QQmlProfilerService::Painting) { // animation/paint events have level 1 by definition, // but are not considered parents of other events for // statistical purposes @@ -1074,9 +1074,9 @@ void ProfileData::computeLevels() void ProfileData::reloadDetails() { // request binding/signal details from the AST - foreach (DeclarativeEvent *event, d->m_eventDescriptions.values()) { - if (event->eventType != QDeclarativeProfilerService::Binding && - event->eventType != QDeclarativeProfilerService::HandlingSignal) + foreach (QmlEvent *event, d->m_eventDescriptions.values()) { + if (event->eventType != QQmlProfilerService::Binding && + event->eventType != QQmlProfilerService::HandlingSignal) continue; // This skips anonymous bindings in Qt4.8 (we don't have valid location data for them) @@ -1095,22 +1095,22 @@ void ProfileData::reloadDetails() void ProfileData::findBindingLoops(qint64 startTime, qint64 endTime) { // first clear existing data - foreach (DeclarativeEvent *event, d->m_eventDescriptions.values()) { + foreach (QmlEvent *event, d->m_eventDescriptions.values()) { event->isBindingLoop = false; - foreach (DeclarativeEventSub *parentEvent, event->parentHash.values()) + foreach (QmlEventSub *parentEvent, event->parentHash.values()) parentEvent->inLoopPath = false; - foreach (DeclarativeEventSub *childEvent, event->childrenHash.values()) + foreach (QmlEventSub *childEvent, event->childrenHash.values()) childEvent->inLoopPath = false; } - QList <DeclarativeEvent *> stackRefs; - QList <DeclarativeEventStartTime *> stack; + QList <QmlEvent *> stackRefs; + QList <QmlEventStartTime *> stack; int fromIndex = findFirstIndex(startTime); int toIndex = findLastIndex(endTime); for (int i = 0; i < d->m_startTimeSortedList.count(); i++) { - DeclarativeEvent *currentEvent = d->m_startTimeSortedList[i].description; - DeclarativeEventStartTime *inTimeEvent = &d->m_startTimeSortedList[i]; + QmlEvent *currentEvent = d->m_startTimeSortedList[i].description; + QmlEventStartTime *inTimeEvent = &d->m_startTimeSortedList[i]; inTimeEvent->bindingLoopHead = -1; // managing call stack @@ -1130,15 +1130,15 @@ void ProfileData::findBindingLoops(qint64 startTime, qint64 endTime) // for the statistics currentEvent->isBindingLoop = true; for (int j = stackRefs.indexOf(currentEvent); j < stackRefs.count()-1; j++) { - DeclarativeEventSub *nextEventSub = stackRefs[j]->childrenHash.value(stackRefs[j+1]->eventHashStr); + QmlEventSub *nextEventSub = stackRefs[j]->childrenHash.value(stackRefs[j+1]->eventHashStr); nextEventSub->inLoopPath = true; - DeclarativeEventSub *prevEventSub = stackRefs[j+1]->parentHash.value(stackRefs[j]->eventHashStr); + QmlEventSub *prevEventSub = stackRefs[j+1]->parentHash.value(stackRefs[j]->eventHashStr); prevEventSub->inLoopPath = true; } } // use crossed references to find index in starttimesortedlist - DeclarativeEventStartTime *head = stack[stackRefs.indexOf(currentEvent)]; + QmlEventStartTime *head = stack[stackRefs.indexOf(currentEvent)]; inTimeEvent->bindingLoopHead = d->m_endTimeSortedList[head->endTimeIndex].startTimeIndex; d->m_startTimeSortedList[inTimeEvent->bindingLoopHead].bindingLoopHead = i; } @@ -1146,10 +1146,10 @@ void ProfileData::findBindingLoops(qint64 startTime, qint64 endTime) } void ProfileData::rewriteDetailsString( - QDeclarativeProfilerService::RangeType eventType, + QQmlProfilerService::RangeType eventType, const EventLocation &location, const QString &newString) { - QString eventHashStr = getHashStringForDeclarativeEvent(location, + QString eventHashStr = getHashStringForQmlEvent(location, eventType); Q_ASSERT(d->m_eventDescriptions.contains(eventHashStr)); d->m_eventDescriptions.value(eventHashStr)->details = newString; @@ -1293,7 +1293,7 @@ qint64 ProfileData::traceDuration() const return traceEndTime() - traceStartTime(); } -qint64 ProfileData::declarativeMeasuredTime() const +qint64 ProfileData::qmlMeasuredTime() const { return d->m_qmlMeasuredTime; } @@ -1336,14 +1336,14 @@ bool ProfileData::save(const QString &filename) stream.writeStartElement("eventData"); stream.writeAttribute("totalTime", QString::number(d->m_qmlMeasuredTime)); - foreach (const DeclarativeEvent *eventData, d->m_eventDescriptions.values()) { + foreach (const QmlEvent *eventData, d->m_eventDescriptions.values()) { stream.writeStartElement("event"); stream.writeAttribute("index", QString::number( d->m_eventDescriptions.keys().indexOf( eventData->eventHashStr))); stream.writeTextElement("displayname", eventData->displayname); - stream.writeTextElement("type", declarativeEventType(eventData->eventType)); + stream.writeTextElement("type", qmlEventType(eventData->eventType)); if (!eventData->location.filename.isEmpty()) { stream.writeTextElement("filename", eventData->location.filename); stream.writeTextElement("line", @@ -1357,7 +1357,7 @@ bool ProfileData::save(const QString &filename) stream.writeEndElement(); // eventData stream.writeStartElement("eventList"); - foreach (const DeclarativeEventStartTime &rangedEvent, + foreach (const QmlEventStartTime &rangedEvent, d->m_startTimeSortedList) { stream.writeStartElement("range"); stream.writeAttribute("startTime", QString::number(rangedEvent.startTime)); @@ -1366,7 +1366,7 @@ bool ProfileData::save(const QString &filename) QString::number(d->m_eventDescriptions.keys().indexOf( rangedEvent.description->eventHashStr))); if (rangedEvent.description->eventType == - QDeclarativeProfilerService::Painting && rangedEvent.animationCount >= 0) { + QQmlProfilerService::Painting && rangedEvent.animationCount >= 0) { // animation frame stream.writeAttribute("framerate", QString::number(rangedEvent.frameRate)); @@ -1453,8 +1453,8 @@ void ProfileData::load() bool readingQmlEvents = false; bool readingV8Events = false; - QHash <int, DeclarativeEvent *> descriptionBuffer; - DeclarativeEvent *currentEvent = 0; + QHash <int, QmlEvent *> descriptionBuffer; + QmlEvent *currentEvent = 0; QHash <int, V8Event *> v8eventBuffer; QHash <int, QString> childrenIndexes; QHash <int, QString> childrenTimes; @@ -1519,7 +1519,7 @@ void ProfileData::load() } if (elementName == "range") { - DeclarativeEventStartTime rangedEvent; + QmlEventStartTime rangedEvent; QXmlStreamAttributes attributes = stream.attributes(); if (attributes.hasAttribute("startTime")) rangedEvent.startTime = attributes.value("startTime"). @@ -1538,7 +1538,7 @@ void ProfileData::load() if (attributes.hasAttribute("eventIndex")) { int ndx = attributes.value("eventIndex").toString().toInt(); if (!descriptionBuffer.value(ndx)) - descriptionBuffer[ndx] = new DeclarativeEvent; + descriptionBuffer[ndx] = new QmlEvent; rangedEvent.description = descriptionBuffer.value(ndx); } rangedEvent.endTimeIndex = d->m_endTimeSortedList.length(); @@ -1549,7 +1549,7 @@ void ProfileData::load() startTimesAreSorted = false; d->m_startTimeSortedList << rangedEvent; - DeclarativeEventEndTime endTimeEvent; + QmlEventEndTime endTimeEvent; endTimeEvent.endTime = rangedEvent.startTime + rangedEvent.length; endTimeEvent.startTimeIndex = d->m_startTimeSortedList.length()-1; endTimeEvent.description = rangedEvent.description; @@ -1563,7 +1563,7 @@ void ProfileData::load() if (attributes.hasAttribute("index")) { int ndx = attributes.value("index").toString().toInt(); if (!descriptionBuffer.value(ndx)) - descriptionBuffer[ndx] = new DeclarativeEvent; + descriptionBuffer[ndx] = new QmlEvent; currentEvent = descriptionBuffer[ndx]; } else { currentEvent = 0; @@ -1585,7 +1585,7 @@ void ProfileData::load() break; } if (elementName == "type") { - currentEvent->eventType = declarativeEventType(readData); + currentEvent->eventType = qmlEventType(readData); break; } if (elementName == "filename") { @@ -1720,8 +1720,8 @@ void ProfileData::load() d->m_v8MeasuredTime = cumulatedV8Time; // move the buffered data to the details cache - foreach (DeclarativeEvent *desc, descriptionBuffer.values()) { - desc->eventHashStr = getHashStringForDeclarativeEvent( + foreach (QmlEvent *desc, descriptionBuffer.values()) { + desc->eventHashStr = getHashStringForQmlEvent( desc->location, desc->eventType);; d->m_eventDescriptions[desc->eventHashStr] = desc; } @@ -1731,7 +1731,7 @@ void ProfileData::load() qSort(d->m_startTimeSortedList.begin(), d->m_startTimeSortedList.end(), compareStartTimes); for (int i = 0; i< d->m_startTimeSortedList.length(); i++) { - DeclarativeEventStartTime startTimeData = d->m_startTimeSortedList[i]; + QmlEventStartTime startTimeData = d->m_startTimeSortedList[i]; d->m_endTimeSortedList[startTimeData.endTimeIndex].startTimeIndex = i; } qSort(d->m_endTimeSortedList.begin(), @@ -1825,7 +1825,7 @@ QString ProfileData::getDetails(int index) const { // special: animations if (d->m_startTimeSortedList[index].description->eventType == - QDeclarativeProfilerService::Painting && + QQmlProfilerService::Painting && d->m_startTimeSortedList[index].animationCount >= 0) return tr("%1 animations at %2 FPS").arg( QString::number(d->m_startTimeSortedList[index].animationCount), diff --git a/tools/qmlprofiler/profiledata.h b/tools/qmlprofiler/profiledata.h index eaa2127f4a..f5d726916c 100644 --- a/tools/qmlprofiler/profiledata.h +++ b/tools/qmlprofiler/profiledata.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -42,16 +42,16 @@ #ifndef PROFILEDATA_H #define PROFILEDATA_H -#include <QtDeclarative/private/qdeclarativeprofilerservice_p.h> +#include <QtQml/private/qqmlprofilerservice_p.h> #include <QtCore/QObject> #include <QtCore/QHash> -struct DeclarativeEvent; +struct QmlEvent; struct V8Event; -typedef QHash<QString, DeclarativeEvent *> DeclarativeEventHash; -typedef QList<DeclarativeEvent *> DeclarativeEvents; +typedef QHash<QString, QmlEvent *> QmlEventHash; +typedef QList<QmlEvent *> QmlEvents; typedef QList<V8Event *> V8Events; struct EventLocation @@ -64,32 +64,32 @@ struct EventLocation int column; }; -struct DeclarativeEventSub { - DeclarativeEventSub(DeclarativeEvent *from) +struct QmlEventSub { + QmlEventSub(QmlEvent *from) : reference(from), duration(0), calls(0), inLoopPath(false) {} - DeclarativeEventSub(DeclarativeEventSub *from) + QmlEventSub(QmlEventSub *from) : reference(from->reference), duration(from->duration), calls(from->calls), inLoopPath(from->inLoopPath) {} - DeclarativeEvent *reference; + QmlEvent *reference; qint64 duration; qint64 calls; bool inLoopPath; }; -struct DeclarativeEvent +struct QmlEvent { - DeclarativeEvent(); - ~DeclarativeEvent(); + QmlEvent(); + ~QmlEvent(); QString displayname; QString eventHashStr; QString details; EventLocation location; - QDeclarativeProfilerService::RangeType eventType; - QHash <QString, DeclarativeEventSub *> parentHash; - QHash <QString, DeclarativeEventSub *> childrenHash; + QQmlProfilerService::RangeType eventType; + QHash <QString, QmlEventSub *> parentHash; + QHash <QString, QmlEventSub *> childrenHash; qint64 duration; qint64 calls; qint64 minTime; @@ -100,7 +100,7 @@ struct DeclarativeEvent int eventId; bool isBindingLoop; - DeclarativeEvent &operator=(const DeclarativeEvent &ref); + QmlEvent &operator=(const QmlEvent &ref); }; struct V8EventSub { @@ -143,8 +143,8 @@ public: explicit ProfileData(QObject *parent = 0); ~ProfileData(); - DeclarativeEvents getDeclarativeEvents() const; - DeclarativeEvent *declarativeEvent(int eventId) const; + QmlEvents getQmlEvents() const; + QmlEvent *qmlEvent(int eventId) const; const V8Events& getV8Events() const; V8Event *v8Event(int eventId) const; @@ -184,7 +184,7 @@ public: Q_INVOKABLE qint64 traceStartTime() const; Q_INVOKABLE qint64 traceEndTime() const; Q_INVOKABLE qint64 traceDuration() const; - Q_INVOKABLE qint64 declarativeMeasuredTime() const; + Q_INVOKABLE qint64 qmlMeasuredTime() const; Q_INVOKABLE qint64 v8MeasuredTime() const; void showErrorDialog(const QString &st ) const; @@ -205,7 +205,7 @@ signals: public slots: void clear(); - void addDeclarativeEvent(QDeclarativeProfilerService::RangeType type, + void addQmlEvent(QQmlProfilerService::RangeType type, qint64 startTime, qint64 length, const QStringList &data, const EventLocation &location); @@ -222,7 +222,7 @@ public slots: void setTraceEndTime( qint64 time ); void setTraceStartTime( qint64 time ); - void rewriteDetailsString(QDeclarativeProfilerService::RangeType eventType, + void rewriteDetailsString(QQmlProfilerService::RangeType eventType, const EventLocation &location, const QString &newString); void finishedRewritingDetails(); diff --git a/tools/qmlprofiler/qmlprofiler.pro b/tools/qmlprofiler/qmlprofiler.pro index 1d8f89a150..ec5f50e376 100644 --- a/tools/qmlprofiler/qmlprofiler.pro +++ b/tools/qmlprofiler/qmlprofiler.pro @@ -1,8 +1,8 @@ TEMPLATE = app TARGET = qmlprofiler -DESTDIR = $$QT.declarative.bins +DESTDIR = $$QT.qml.bins -QT += declarative declarative-private network +QT += qml qml-private network target.path = $$[QT_INSTALL_BINS] INSTALLS += target diff --git a/tools/qmlprofiler/qmlprofilerapplication.cpp b/tools/qmlprofiler/qmlprofilerapplication.cpp index af5f4298a8..0b10ec0b15 100644 --- a/tools/qmlprofiler/qmlprofilerapplication.cpp +++ b/tools/qmlprofiler/qmlprofilerapplication.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -89,10 +89,10 @@ QmlProfilerApplication::QmlProfilerApplication(int &argc, char **argv) : m_port(3768), m_verbose(false), m_quitAfterSave(false), - m_declarativeProfilerClient(&m_connection), + m_qmlProfilerClient(&m_connection), m_v8profilerClient(&m_connection), m_connectionAttempts(0), - m_declarativeDataReady(false), + m_qmlDataReady(false), m_v8DataReady(false) { m_connectTimer.setInterval(1000); @@ -102,14 +102,14 @@ QmlProfilerApplication::QmlProfilerApplication(int &argc, char **argv) : connect(&m_connection, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(connectionStateChanged(QAbstractSocket::SocketState))); connect(&m_connection, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(connectionError(QAbstractSocket::SocketError))); - connect(&m_declarativeProfilerClient, SIGNAL(enabledChanged()), this, SLOT(traceClientEnabled())); - connect(&m_declarativeProfilerClient, SIGNAL(recordingChanged(bool)), this, SLOT(recordingChanged())); - connect(&m_declarativeProfilerClient, SIGNAL(range(QDeclarativeProfilerService::RangeType,qint64,qint64,QStringList,EventLocation)), - &m_profileData, SLOT(addDeclarativeEvent(QDeclarativeProfilerService::RangeType,qint64,qint64,QStringList,EventLocation))); - connect(&m_declarativeProfilerClient, SIGNAL(traceFinished(qint64)), &m_profileData, SLOT(setTraceEndTime(qint64))); - connect(&m_declarativeProfilerClient, SIGNAL(traceStarted(qint64)), &m_profileData, SLOT(setTraceStartTime(qint64))); - connect(&m_declarativeProfilerClient, SIGNAL(frame(qint64,int,int)), &m_profileData, SLOT(addFrameEvent(qint64,int,int))); - connect(&m_declarativeProfilerClient, SIGNAL(complete()), this, SLOT(declarativeComplete())); + connect(&m_qmlProfilerClient, SIGNAL(enabledChanged()), this, SLOT(traceClientEnabled())); + connect(&m_qmlProfilerClient, SIGNAL(recordingChanged(bool)), this, SLOT(recordingChanged())); + connect(&m_qmlProfilerClient, SIGNAL(range(QQmlProfilerService::RangeType,qint64,qint64,QStringList,EventLocation)), + &m_profileData, SLOT(addQmlEvent(QQmlProfilerService::RangeType,qint64,qint64,QStringList,EventLocation))); + connect(&m_qmlProfilerClient, SIGNAL(traceFinished(qint64)), &m_profileData, SLOT(setTraceEndTime(qint64))); + connect(&m_qmlProfilerClient, SIGNAL(traceStarted(qint64)), &m_profileData, SLOT(setTraceStartTime(qint64))); + connect(&m_qmlProfilerClient, SIGNAL(frame(qint64,int,int)), &m_profileData, SLOT(addFrameEvent(qint64,int,int))); + connect(&m_qmlProfilerClient, SIGNAL(complete()), this, SLOT(qmlComplete())); connect(&m_v8profilerClient, SIGNAL(enabledChanged()), this, SLOT(profilerClientEnabled())); connect(&m_v8profilerClient, SIGNAL(range(int,QString,QString,int,double,double)), @@ -157,7 +157,7 @@ bool QmlProfilerApplication::parseArguments() return false; } } else if (arg == QLatin1String("-fromStart")) { - m_declarativeProfilerClient.setRecording(true); + m_qmlProfilerClient.setRecording(true); m_v8profilerClient.setRecording(true); } else if (arg == QLatin1String("-help") || arg == QLatin1String("-h") || arg == QLatin1String("/h") || arg == QLatin1String("/?")) { return false; @@ -232,19 +232,19 @@ void QmlProfilerApplication::userCommand(const QString &command) printCommands(); } else if (cmd == Constants::CMD_RECORD || cmd == Constants::CMD_RECORD2) { - m_declarativeProfilerClient.setRecording( - !m_declarativeProfilerClient.isRecording()); + m_qmlProfilerClient.setRecording( + !m_qmlProfilerClient.isRecording()); m_v8profilerClient.setRecording(!m_v8profilerClient.isRecording()); - m_declarativeDataReady = false; + m_qmlDataReady = false; m_v8DataReady = false; } else if (cmd == Constants::CMD_QUIT || cmd == Constants::CMD_QUIT2) { print(QLatin1String("Quit")); - if (m_declarativeProfilerClient.isRecording()) { + if (m_qmlProfilerClient.isRecording()) { m_quitAfterSave = true; - m_declarativeDataReady = false; + m_qmlDataReady = false; m_v8DataReady = false; - m_declarativeProfilerClient.setRecording(false); + m_qmlProfilerClient.setRecording(false); m_v8profilerClient.setRecording(false); } else { quit(); @@ -304,7 +304,7 @@ void QmlProfilerApplication::connected() "(type 'help'' to show list of commands).") ).arg(m_hostName).arg((m_port))); QString recordingStatus(QLatin1String("Recording Status: %1")); - if (!m_declarativeProfilerClient.isRecording() && + if (!m_qmlProfilerClient.isRecording() && !m_v8profilerClient.isRecording()) recordingStatus = recordingStatus.arg(QLatin1String("Off")); else @@ -340,7 +340,7 @@ void QmlProfilerApplication::processFinished() if (m_process->exitStatus() == QProcess::NormalExit) { logStatus(QString("Process exited (%1).").arg(m_process->exitCode())); - if (m_declarativeProfilerClient.isRecording()) { + if (m_qmlProfilerClient.isRecording()) { logError("Process exited while recording, last trace is lost!"); exit(2); } else { @@ -357,7 +357,7 @@ void QmlProfilerApplication::traceClientEnabled() logStatus("Trace client is attached."); // blocked server is waiting for recording message from both clients // once the last one is connected, both messages should be sent - m_declarativeProfilerClient.sendRecordingStatus(); + m_qmlProfilerClient.sendRecordingStatus(); m_v8profilerClient.sendRecordingStatus(); } @@ -367,7 +367,7 @@ void QmlProfilerApplication::profilerClientEnabled() // blocked server is waiting for recording message from both clients // once the last one is connected, both messages should be sent - m_declarativeProfilerClient.sendRecordingStatus(); + m_qmlProfilerClient.sendRecordingStatus(); m_v8profilerClient.sendRecordingStatus(); } @@ -384,7 +384,7 @@ void QmlProfilerApplication::traceFinished() void QmlProfilerApplication::recordingChanged() { - if (m_declarativeProfilerClient.isRecording()) { + if (m_qmlProfilerClient.isRecording()) { print(QLatin1String("Recording is on.")); } else { print(QLatin1String("Recording is off.")); @@ -411,22 +411,22 @@ void QmlProfilerApplication::logStatus(const QString &status) err << status << endl; } -void QmlProfilerApplication::declarativeComplete() +void QmlProfilerApplication::qmlComplete() { - m_declarativeDataReady = true; - if (m_v8profilerClient.state() != QDeclarativeDebugClient::Enabled || + m_qmlDataReady = true; + if (m_v8profilerClient.state() != QQmlDebugClient::Enabled || m_v8DataReady) { m_profileData.complete(); // once complete is sent, reset the flag - m_declarativeDataReady = false; + m_qmlDataReady = false; } } void QmlProfilerApplication::v8Complete() { m_v8DataReady = true; - if (m_declarativeProfilerClient.state() != QDeclarativeDebugClient::Enabled || - m_declarativeDataReady) { + if (m_qmlProfilerClient.state() != QQmlDebugClient::Enabled || + m_qmlDataReady) { m_profileData.complete(); // once complete is sent, reset the flag m_v8DataReady = false; diff --git a/tools/qmlprofiler/qmlprofilerapplication.h b/tools/qmlprofiler/qmlprofilerapplication.h index 49ddaf88cd..3937db7e5f 100644 --- a/tools/qmlprofiler/qmlprofilerapplication.h +++ b/tools/qmlprofiler/qmlprofilerapplication.h @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtDeclarative module of the Qt Toolkit. +** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -80,7 +80,7 @@ private slots: void logError(const QString &error); void logStatus(const QString &status); - void declarativeComplete(); + void qmlComplete(); void v8Complete(); private: @@ -103,14 +103,14 @@ private: bool m_verbose; bool m_quitAfterSave; - QDeclarativeDebugConnection m_connection; - DeclarativeProfileClient m_declarativeProfilerClient; + QQmlDebugConnection m_connection; + QmlProfileClient m_qmlProfilerClient; V8ProfileClient m_v8profilerClient; ProfileData m_profileData; QTimer m_connectTimer; uint m_connectionAttempts; - bool m_declarativeDataReady; + bool m_qmlDataReady; bool m_v8DataReady; }; |