forked from qt-creator/qt-creator
QmlProfiler: Apply some code cosmetics
Change-Id: I772713aec3a6c25136174b39b853a9ef3ee42a0b Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
@@ -25,8 +25,8 @@
|
|||||||
|
|
||||||
#include "flamegraphmodel.h"
|
#include "flamegraphmodel.h"
|
||||||
|
|
||||||
#include <qmlprofiler/qmlprofilermodelmanager.h>
|
#include "qmlprofilermodelmanager.h"
|
||||||
#include <qmlprofiler/qmlprofilerdatamodel.h>
|
#include "qmlprofilerdatamodel.h"
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
@@ -25,9 +25,8 @@
|
|||||||
|
|
||||||
#include "flamegraphview.h"
|
#include "flamegraphview.h"
|
||||||
#include "flamegraph.h"
|
#include "flamegraph.h"
|
||||||
|
#include "qmlprofilerconstants.h"
|
||||||
#include <qmlprofiler/qmlprofilerconstants.h>
|
#include "qmlprofilertool.h"
|
||||||
#include <qmlprofiler/qmlprofilertool.h>
|
|
||||||
|
|
||||||
#include <QQmlContext>
|
#include <QQmlContext>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
@@ -37,9 +37,10 @@
|
|||||||
#include <QTcpServer>
|
#include <QTcpServer>
|
||||||
#include <QTemporaryFile>
|
#include <QTemporaryFile>
|
||||||
|
|
||||||
using namespace QmlProfiler;
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
|
||||||
|
namespace QmlProfiler {
|
||||||
|
|
||||||
QString LocalQmlProfilerRunner::findFreeSocket()
|
QString LocalQmlProfilerRunner::findFreeSocket()
|
||||||
{
|
{
|
||||||
QTemporaryFile file;
|
QTemporaryFile file;
|
||||||
@@ -140,3 +141,5 @@ void LocalQmlProfilerRunner::stop()
|
|||||||
if (m_launcher.isRunning())
|
if (m_launcher.isRunning())
|
||||||
m_launcher.stop();
|
m_launcher.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace QmlProfiler
|
||||||
|
@@ -35,16 +35,16 @@ struct QmlEventType {
|
|||||||
const QmlEventLocation &location = QmlEventLocation(),
|
const QmlEventLocation &location = QmlEventLocation(),
|
||||||
Message message = MaximumMessage, RangeType rangeType = MaximumRangeType,
|
Message message = MaximumMessage, RangeType rangeType = MaximumRangeType,
|
||||||
int detailType = -1, const QString &data = QString()) :
|
int detailType = -1, const QString &data = QString()) :
|
||||||
displayName(displayName), location(location), message(message), rangeType(rangeType),
|
displayName(displayName), data(data), location(location), message(message),
|
||||||
detailType(detailType), data(data)
|
rangeType(rangeType), detailType(detailType)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
QString displayName;
|
QString displayName;
|
||||||
|
QString data;
|
||||||
QmlEventLocation location;
|
QmlEventLocation location;
|
||||||
Message message;
|
Message message;
|
||||||
RangeType rangeType;
|
RangeType rangeType;
|
||||||
int detailType; // can be EventType, BindingType, PixmapEventType or SceneGraphFrameType
|
int detailType; // can be EventType, BindingType, PixmapEventType or SceneGraphFrameType
|
||||||
QString data;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace QmlProfiler
|
} // namespace QmlProfiler
|
||||||
|
@@ -26,16 +26,16 @@
|
|||||||
#include "qmlprofileranimationsmodel.h"
|
#include "qmlprofileranimationsmodel.h"
|
||||||
#include "qmlprofilermodelmanager.h"
|
#include "qmlprofilermodelmanager.h"
|
||||||
#include "qmlprofilerdatamodel.h"
|
#include "qmlprofilerdatamodel.h"
|
||||||
#include <utils/qtcassert.h>
|
|
||||||
#include <QCoreApplication>
|
|
||||||
|
|
||||||
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QStack>
|
#include <QStack>
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
namespace QmlProfiler {
|
namespace QmlProfiler {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -205,5 +205,5 @@ QVariantMap QmlProfilerAnimationsModel::details(int index) const
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} // namespace Internal
|
||||||
}
|
} // namespace QmlProfiler
|
||||||
|
@@ -77,5 +77,5 @@ private:
|
|||||||
int rowFromThreadId(int threadId) const;
|
int rowFromThreadId(int threadId) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
} // namespace Internal
|
||||||
}
|
} // namespace QmlProfiler
|
||||||
|
@@ -26,7 +26,6 @@
|
|||||||
#include "qmlprofilerattachdialog.h"
|
#include "qmlprofilerattachdialog.h"
|
||||||
|
|
||||||
#include <projectexplorer/kitchooser.h>
|
#include <projectexplorer/kitchooser.h>
|
||||||
|
|
||||||
#include <coreplugin/id.h>
|
#include <coreplugin/id.h>
|
||||||
|
|
||||||
#include <QSpinBox>
|
#include <QSpinBox>
|
||||||
|
@@ -380,5 +380,5 @@ void BindingLoopsRenderPassState::updateIndexes(int from, int to)
|
|||||||
m_indexTo = to;
|
m_indexTo = to;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} // namespace Internal
|
||||||
}
|
} // namespace QmlProfiler
|
||||||
|
@@ -25,10 +25,12 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "qmlprofilerrangemodel.h"
|
||||||
|
|
||||||
#include "timeline/timelineabstractrenderer.h"
|
#include "timeline/timelineabstractrenderer.h"
|
||||||
#include "timeline/timelinerenderpass.h"
|
#include "timeline/timelinerenderpass.h"
|
||||||
#include "timeline/timelinerenderstate.h"
|
#include "timeline/timelinerenderstate.h"
|
||||||
#include "qmlprofilerrangemodel.h"
|
|
||||||
#include <QSGMaterial>
|
#include <QSGMaterial>
|
||||||
|
|
||||||
namespace QmlProfiler {
|
namespace QmlProfiler {
|
||||||
@@ -46,5 +48,5 @@ protected:
|
|||||||
QmlProfilerBindingLoopsRenderPass();
|
QmlProfilerBindingLoopsRenderPass();
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
} // namespace Internal
|
||||||
}
|
} // namespace QmlProfiler
|
||||||
|
@@ -30,11 +30,11 @@
|
|||||||
#include "qmlprofilermodelmanager.h"
|
#include "qmlprofilermodelmanager.h"
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
using namespace QmlDebug;
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
|
|
||||||
namespace QmlProfiler {
|
namespace QmlProfiler {
|
||||||
@@ -45,7 +45,7 @@ class QmlProfilerClientManager::QmlProfilerClientManagerPrivate
|
|||||||
public:
|
public:
|
||||||
QmlProfilerStateManager *profilerState;
|
QmlProfilerStateManager *profilerState;
|
||||||
|
|
||||||
QmlDebugConnection *connection;
|
QmlDebug::QmlDebugConnection *connection;
|
||||||
QPointer<QmlProfilerTraceClient> qmlclientplugin;
|
QPointer<QmlProfilerTraceClient> qmlclientplugin;
|
||||||
|
|
||||||
QTimer connectionTimer;
|
QTimer connectionTimer;
|
||||||
@@ -169,7 +169,7 @@ void QmlProfilerClientManager::connectLocalClient(const QString &file)
|
|||||||
|
|
||||||
void QmlProfilerClientManager::createConnection()
|
void QmlProfilerClientManager::createConnection()
|
||||||
{
|
{
|
||||||
d->connection = new QmlDebugConnection;
|
d->connection = new QmlDebug::QmlDebugConnection;
|
||||||
QTC_ASSERT(d->profilerState, return);
|
QTC_ASSERT(d->profilerState, return);
|
||||||
|
|
||||||
disconnectClientSignals();
|
disconnectClientSignals();
|
||||||
@@ -180,13 +180,13 @@ void QmlProfilerClientManager::createConnection()
|
|||||||
d->profilerState->requestedFeatures());
|
d->profilerState->requestedFeatures());
|
||||||
d->qmlclientplugin->setFlushInterval(d->flushInterval);
|
d->qmlclientplugin->setFlushInterval(d->flushInterval);
|
||||||
connectClientSignals();
|
connectClientSignals();
|
||||||
connect(d->connection, &QmlDebugConnection::connected,
|
connect(d->connection, &QmlDebug::QmlDebugConnection::connected,
|
||||||
this, &QmlProfilerClientManager::qmlDebugConnectionOpened);
|
this, &QmlProfilerClientManager::qmlDebugConnectionOpened);
|
||||||
connect(d->connection, &QmlDebugConnection::disconnected,
|
connect(d->connection, &QmlDebug::QmlDebugConnection::disconnected,
|
||||||
this, &QmlProfilerClientManager::qmlDebugConnectionClosed);
|
this, &QmlProfilerClientManager::qmlDebugConnectionClosed);
|
||||||
connect(d->connection, &QmlDebugConnection::socketError,
|
connect(d->connection, &QmlDebug::QmlDebugConnection::socketError,
|
||||||
this, &QmlProfilerClientManager::qmlDebugConnectionError);
|
this, &QmlProfilerClientManager::qmlDebugConnectionError);
|
||||||
connect(d->connection, &QmlDebugConnection::socketStateChanged,
|
connect(d->connection, &QmlDebug::QmlDebugConnection::socketStateChanged,
|
||||||
this, &QmlProfilerClientManager::qmlDebugConnectionStateChanged);
|
this, &QmlProfilerClientManager::qmlDebugConnectionStateChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -313,7 +313,7 @@ void QmlProfilerClientManager::qmlDebugConnectionClosed()
|
|||||||
|
|
||||||
void QmlProfilerClientManager::qmlDebugConnectionError(QAbstractSocket::SocketError error)
|
void QmlProfilerClientManager::qmlDebugConnectionError(QAbstractSocket::SocketError error)
|
||||||
{
|
{
|
||||||
logState(QmlDebugConnection::socketErrorToString(error));
|
logState(QmlDebug::QmlDebugConnection::socketErrorToString(error));
|
||||||
if (d->connection->isConnected()) {
|
if (d->connection->isConnected()) {
|
||||||
disconnectClient();
|
disconnectClient();
|
||||||
emit connectionClosed();
|
emit connectionClosed();
|
||||||
@@ -324,7 +324,7 @@ void QmlProfilerClientManager::qmlDebugConnectionError(QAbstractSocket::SocketEr
|
|||||||
|
|
||||||
void QmlProfilerClientManager::qmlDebugConnectionStateChanged(QAbstractSocket::SocketState state)
|
void QmlProfilerClientManager::qmlDebugConnectionStateChanged(QAbstractSocket::SocketState state)
|
||||||
{
|
{
|
||||||
logState(QmlDebugConnection::socketStateToString(state));
|
logState(QmlDebug::QmlDebugConnection::socketStateToString(state));
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlProfilerClientManager::logState(const QString &msg)
|
void QmlProfilerClientManager::logState(const QString &msg)
|
||||||
|
@@ -95,5 +95,5 @@ private:
|
|||||||
void stopClientsRecording();
|
void stopClientsRecording();
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
} // namespace Internal
|
||||||
}
|
} // namespace QmlProfiler
|
||||||
|
@@ -38,6 +38,8 @@ const char AGGREGATE_TRACES[] = "Analyzer.QmlProfiler.AggregateTraces";
|
|||||||
const char SETTINGS[] = "Analyzer.QmlProfiler.Settings";
|
const char SETTINGS[] = "Analyzer.QmlProfiler.Settings";
|
||||||
const char ANALYZER[] = "Analyzer";
|
const char ANALYZER[] = "Analyzer";
|
||||||
|
|
||||||
|
const int QML_MIN_LEVEL = 1; // Set to 0 to remove the empty line between models in the timeline
|
||||||
|
|
||||||
const char TraceFileExtension[] = ".qtd";
|
const char TraceFileExtension[] = ".qtd";
|
||||||
|
|
||||||
const char QmlProfilerPerspectiveId[] = "QmlProfiler.Perspective";
|
const char QmlProfilerPerspectiveId[] = "QmlProfiler.Perspective";
|
||||||
|
@@ -291,4 +291,4 @@ void QmlProfilerDataModel::detailsDone()
|
|||||||
d->modelManager->processingDone();
|
d->modelManager->processingDone();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} // namespace QmlProfiler
|
||||||
|
@@ -42,4 +42,4 @@ struct QMLPROFILER_EXPORT QmlEventLocation
|
|||||||
int column;
|
int column;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
} // namespace QmlProfiler
|
||||||
|
@@ -53,4 +53,4 @@ public slots:
|
|||||||
virtual void onVisibleFeaturesChanged(quint64 features) = 0;
|
virtual void onVisibleFeaturesChanged(quint64 features) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
} // namespace QmlProfiler
|
||||||
|
@@ -169,7 +169,6 @@ inline ProfileFeature featureFromRangeType(RangeType range)
|
|||||||
}
|
}
|
||||||
|
|
||||||
namespace Constants {
|
namespace Constants {
|
||||||
const int QML_MIN_LEVEL = 1; // Set to 0 to remove the empty line between models in the timeline
|
|
||||||
|
|
||||||
// Shorthand for all QML and JS range features.
|
// Shorthand for all QML and JS range features.
|
||||||
const quint64 QML_JS_RANGE_FEATURES = (1 << ProfileCompiling) |
|
const quint64 QML_JS_RANGE_FEATURES = (1 << ProfileCompiling) |
|
||||||
@@ -177,6 +176,6 @@ const quint64 QML_JS_RANGE_FEATURES = (1 << ProfileCompiling) |
|
|||||||
(1 << ProfileBinding) |
|
(1 << ProfileBinding) |
|
||||||
(1 << ProfileHandlingSignal) |
|
(1 << ProfileHandlingSignal) |
|
||||||
(1 << ProfileJavaScript);
|
(1 << ProfileJavaScript);
|
||||||
}
|
} // namespace Constants
|
||||||
|
|
||||||
} // namespace QmlProfiler
|
} // namespace QmlProfiler
|
||||||
|
@@ -129,10 +129,6 @@ void QmlProfilerTraceTime::increaseEndTime(qint64 time)
|
|||||||
class QmlProfilerModelManager::QmlProfilerModelManagerPrivate
|
class QmlProfilerModelManager::QmlProfilerModelManagerPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QmlProfilerModelManagerPrivate(QmlProfilerModelManager *qq) : q(qq) {}
|
|
||||||
~QmlProfilerModelManagerPrivate() {}
|
|
||||||
QmlProfilerModelManager *q;
|
|
||||||
|
|
||||||
QmlProfilerDataModel *model;
|
QmlProfilerDataModel *model;
|
||||||
QmlProfilerNotesModel *notesModel;
|
QmlProfilerNotesModel *notesModel;
|
||||||
|
|
||||||
@@ -152,7 +148,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
QmlProfilerModelManager::QmlProfilerModelManager(Utils::FileInProjectFinder *finder, QObject *parent) :
|
QmlProfilerModelManager::QmlProfilerModelManager(Utils::FileInProjectFinder *finder, QObject *parent) :
|
||||||
QObject(parent), d(new QmlProfilerModelManagerPrivate(this))
|
QObject(parent), d(new QmlProfilerModelManagerPrivate)
|
||||||
{
|
{
|
||||||
d->totalWeight = 0;
|
d->totalWeight = 0;
|
||||||
d->previousProgress = 0;
|
d->previousProgress = 0;
|
||||||
@@ -293,12 +289,12 @@ void QmlProfilerModelManager::addQmlEvent(Message message, RangeType rangeType,
|
|||||||
ndata2, ndata3, ndata4, ndata5);
|
ndata2, ndata3, ndata4, ndata5);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlProfilerModelManager::addDebugMessage(QtMsgType type, qint64 timestamp, const QString &text,
|
void QmlProfilerModelManager::addDebugMessage(qint64 timestamp, QtMsgType messageType,
|
||||||
const QmlEventLocation &location)
|
const QString &text, const QmlEventLocation &location)
|
||||||
{
|
{
|
||||||
if (state() == AcquiringData)
|
if (state() == AcquiringData)
|
||||||
d->model->addEvent(DebugMessage, MaximumRangeType, type, timestamp, 0, text, location, 0, 0,
|
d->model->addEvent(DebugMessage, MaximumRangeType, messageType, timestamp, 0, text,
|
||||||
0, 0, 0);
|
location, 0, 0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlProfilerModelManager::acquiringDone()
|
void QmlProfilerModelManager::acquiringDone()
|
||||||
@@ -443,7 +439,7 @@ void QmlProfilerModelManager::clear()
|
|||||||
setState(Empty);
|
setState(Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlProfilerModelManager::prepareForWriting()
|
void QmlProfilerModelManager::startAcquiring()
|
||||||
{
|
{
|
||||||
setState(AcquiringData);
|
setState(AcquiringData);
|
||||||
}
|
}
|
||||||
|
@@ -116,7 +116,6 @@ signals:
|
|||||||
void loadFinished();
|
void loadFinished();
|
||||||
void saveFinished();
|
void saveFinished();
|
||||||
|
|
||||||
void requestDetailsForLocation(int eventType, const QmlEventLocation &location);
|
|
||||||
void availableFeaturesChanged(quint64 features);
|
void availableFeaturesChanged(quint64 features);
|
||||||
void visibleFeaturesChanged(quint64 features);
|
void visibleFeaturesChanged(quint64 features);
|
||||||
void recordedFeaturesChanged(quint64 features);
|
void recordedFeaturesChanged(quint64 features);
|
||||||
@@ -124,11 +123,11 @@ signals:
|
|||||||
public slots:
|
public slots:
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
void prepareForWriting();
|
void startAcquiring();
|
||||||
void addQmlEvent(Message message, RangeType rangeType, int bindingType, qint64 startTime,
|
void addQmlEvent(Message message, RangeType rangeType, int bindingType, qint64 startTime,
|
||||||
qint64 length, const QString &data, const QmlEventLocation &location,
|
qint64 length, const QString &data, const QmlEventLocation &location,
|
||||||
qint64 ndata1, qint64 ndata2, qint64 ndata3, qint64 ndata4, qint64 ndata5);
|
qint64 ndata1, qint64 ndata2, qint64 ndata3, qint64 ndata4, qint64 ndata5);
|
||||||
void addDebugMessage(QtMsgType type, qint64 timestamp, const QString &text,
|
void addDebugMessage(qint64 timestamp, QtMsgType type, const QString &text,
|
||||||
const QmlEventLocation &location);
|
const QmlEventLocation &location);
|
||||||
|
|
||||||
void save(const QString &filename);
|
void save(const QString &filename);
|
||||||
@@ -142,4 +141,4 @@ private:
|
|||||||
QmlProfilerModelManagerPrivate *d;
|
QmlProfilerModelManagerPrivate *d;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
} // namespace QmlProfiler
|
||||||
|
@@ -27,6 +27,7 @@
|
|||||||
#include "qmlprofilermodelmanager.h"
|
#include "qmlprofilermodelmanager.h"
|
||||||
#include "qmlprofilerdatamodel.h"
|
#include "qmlprofilerdatamodel.h"
|
||||||
#include "qmlprofilerbindingloopsrenderpass.h"
|
#include "qmlprofilerbindingloopsrenderpass.h"
|
||||||
|
|
||||||
#include "timeline/timelinenotesrenderpass.h"
|
#include "timeline/timelinenotesrenderpass.h"
|
||||||
#include "timeline/timelineitemsrenderpass.h"
|
#include "timeline/timelineitemsrenderpass.h"
|
||||||
#include "timeline/timelineselectionrenderpass.h"
|
#include "timeline/timelineselectionrenderpass.h"
|
||||||
@@ -38,12 +39,9 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QStack>
|
#include <QStack>
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
namespace QmlProfiler {
|
namespace QmlProfiler {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
|
|
||||||
QmlProfilerRangeModel::QmlProfilerRangeModel(QmlProfilerModelManager *manager, RangeType range,
|
QmlProfilerRangeModel::QmlProfilerRangeModel(QmlProfilerModelManager *manager, RangeType range,
|
||||||
QObject *parent) :
|
QObject *parent) :
|
||||||
QmlProfilerTimelineModel(manager, MaximumMessage, range, featureFromRangeType(range), parent)
|
QmlProfilerTimelineModel(manager, MaximumMessage, range, featureFromRangeType(range), parent)
|
||||||
@@ -272,5 +270,5 @@ QList<const Timeline::TimelineRenderPass *> QmlProfilerRangeModel::supportedRend
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} // namespace Internal
|
||||||
}
|
} // namespaec QmlProfiler
|
||||||
|
@@ -29,6 +29,7 @@
|
|||||||
#include "qmlprofilerdatamodel.h"
|
#include "qmlprofilerdatamodel.h"
|
||||||
#include "qmlprofilereventtypes.h"
|
#include "qmlprofilereventtypes.h"
|
||||||
#include "qmlprofilereventlocation.h"
|
#include "qmlprofilereventlocation.h"
|
||||||
|
#include "qmlprofilerconstants.h"
|
||||||
|
|
||||||
#include <QVariantList>
|
#include <QVariantList>
|
||||||
#include <QColor>
|
#include <QColor>
|
||||||
@@ -86,5 +87,5 @@ private:
|
|||||||
QVector<int> m_expandedRowTypes;
|
QVector<int> m_expandedRowTypes;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
} // namespace Internal
|
||||||
}
|
} // namespace QmlProfiler
|
||||||
|
@@ -24,7 +24,6 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "qmlprofilerruncontrol.h"
|
#include "qmlprofilerruncontrol.h"
|
||||||
|
|
||||||
#include "localqmlprofilerrunner.h"
|
#include "localqmlprofilerrunner.h"
|
||||||
#include "qmlprofilertool.h"
|
#include "qmlprofilertool.h"
|
||||||
|
|
||||||
|
@@ -176,4 +176,4 @@ void QmlProfilerStateManager::setRecordedFeatures(quint64 features)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} // namespace QmlProfiler
|
||||||
|
@@ -70,4 +70,4 @@ private:
|
|||||||
QmlProfilerStateManagerPrivate *d;
|
QmlProfilerStateManagerPrivate *d;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
} // namespace QmlProfiler
|
||||||
|
@@ -227,5 +227,5 @@ void QmlProfilerStateWidget::updateDisplay()
|
|||||||
setVisible(false);
|
setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} // namespace Internal
|
||||||
}
|
} // namespace QmlProfiler
|
||||||
|
@@ -25,11 +25,11 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QWidget>
|
|
||||||
|
|
||||||
#include "qmlprofilerstatemanager.h"
|
#include "qmlprofilerstatemanager.h"
|
||||||
#include "qmlprofilermodelmanager.h"
|
#include "qmlprofilermodelmanager.h"
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
namespace QmlProfiler {
|
namespace QmlProfiler {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
@@ -54,5 +54,5 @@ private:
|
|||||||
QmlProfilerStateWidgetPrivate *d;
|
QmlProfilerStateWidgetPrivate *d;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
} // namespace Internal
|
||||||
}
|
} // namespace QmlProfiler
|
||||||
|
@@ -32,12 +32,9 @@
|
|||||||
|
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QUrl>
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QStack>
|
#include <QStack>
|
||||||
#include <QElapsedTimer>
|
#include <QSet>
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
namespace QmlProfiler {
|
namespace QmlProfiler {
|
||||||
|
|
||||||
|
@@ -29,6 +29,7 @@
|
|||||||
#include "qmlprofilernotesmodel.h"
|
#include "qmlprofilernotesmodel.h"
|
||||||
#include "qmlprofilereventtypes.h"
|
#include "qmlprofilereventtypes.h"
|
||||||
#include "qmlprofilereventlocation.h"
|
#include "qmlprofilereventlocation.h"
|
||||||
|
#include "qmlprofilerconstants.h"
|
||||||
|
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
|
@@ -24,28 +24,23 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "qmlprofilerstatisticsview.h"
|
#include "qmlprofilerstatisticsview.h"
|
||||||
|
#include "qmlprofilerviewmanager.h"
|
||||||
|
#include "qmlprofilertool.h"
|
||||||
|
|
||||||
|
#include <coreplugin/minisplitter.h>
|
||||||
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
|
|
||||||
#include <QStandardItem>
|
#include <QStandardItem>
|
||||||
#include <QHeaderView>
|
#include <QHeaderView>
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
|
|
||||||
#include <QContextMenuEvent>
|
#include <QContextMenuEvent>
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
#include <coreplugin/minisplitter.h>
|
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
|
|
||||||
#include "qmlprofilerviewmanager.h"
|
|
||||||
#include "qmlprofilertool.h"
|
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
namespace QmlProfiler {
|
namespace QmlProfiler {
|
||||||
|
@@ -123,7 +123,6 @@ public:
|
|||||||
void setShowExtendedStatistics(bool);
|
void setShowExtendedStatistics(bool);
|
||||||
bool showExtendedStatistics() const;
|
bool showExtendedStatistics() const;
|
||||||
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void gotoSourceLocation(const QString &fileName, int lineNumber, int columnNumber);
|
void gotoSourceLocation(const QString &fileName, int lineNumber, int columnNumber);
|
||||||
void typeSelected(int typeIndex);
|
void typeSelected(int typeIndex);
|
||||||
|
@@ -875,7 +875,7 @@ void QmlProfilerTool::serverRecordingChanged()
|
|||||||
if (!d->m_profilerConnections->aggregateTraces() ||
|
if (!d->m_profilerConnections->aggregateTraces() ||
|
||||||
d->m_profilerModelManager->state() == QmlProfilerModelManager::Done)
|
d->m_profilerModelManager->state() == QmlProfilerModelManager::Done)
|
||||||
clearData();
|
clearData();
|
||||||
d->m_profilerModelManager->prepareForWriting();
|
d->m_profilerModelManager->startAcquiring();
|
||||||
} else {
|
} else {
|
||||||
setRecording(false);
|
setRecording(false);
|
||||||
|
|
||||||
@@ -908,5 +908,5 @@ void QmlProfilerTool::toggleVisibleFeature(QAction *action)
|
|||||||
d->m_profilerModelManager->visibleFeatures() & (~(1ULL << feature)));
|
d->m_profilerModelManager->visibleFeatures() & (~(1ULL << feature)));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} // namespace Internal
|
||||||
}
|
} // namespace QmlProfiler
|
||||||
|
@@ -64,10 +64,6 @@ public:
|
|||||||
quint32 flushInterval;
|
quint32 flushInterval;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace QmlProfiler
|
|
||||||
|
|
||||||
using namespace QmlProfiler;
|
|
||||||
|
|
||||||
void QmlProfilerTraceClientPrivate::sendRecordingStatus(int engineId)
|
void QmlProfilerTraceClientPrivate::sendRecordingStatus(int engineId)
|
||||||
{
|
{
|
||||||
QmlDebug::QPacket stream(q->connection()->currentDataStreamVersion());
|
QmlDebug::QPacket stream(q->connection()->currentDataStreamVersion());
|
||||||
@@ -150,7 +146,7 @@ void QmlProfilerTraceClient::setRequestedFeatures(quint64 features)
|
|||||||
const QmlDebug::QDebugContextInfo &context)
|
const QmlDebug::QDebugContextInfo &context)
|
||||||
{
|
{
|
||||||
d->updateFeatures(ProfileDebugMessages);
|
d->updateFeatures(ProfileDebugMessages);
|
||||||
emit debugMessage(type, context.timestamp, text,
|
emit debugMessage(context.timestamp, type, text,
|
||||||
QmlEventLocation(context.file, context.line, 1));
|
QmlEventLocation(context.file, context.line, 1));
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -399,3 +395,5 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace QmlProfiler
|
||||||
|
@@ -41,9 +41,6 @@ class QmlProfilerTraceClient : public QmlDebug::QmlDebugClient
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(bool recording READ isRecording WRITE setRecording NOTIFY recordingChanged)
|
Q_PROPERTY(bool recording READ isRecording WRITE setRecording NOTIFY recordingChanged)
|
||||||
|
|
||||||
// don't hide by signal
|
|
||||||
using QObject::event;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QmlProfilerTraceClient(QmlDebug::QmlDebugConnection *client, quint64 features);
|
QmlProfilerTraceClient(QmlDebug::QmlDebugConnection *client, quint64 features);
|
||||||
~QmlProfilerTraceClient();
|
~QmlProfilerTraceClient();
|
||||||
@@ -60,13 +57,16 @@ public slots:
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void complete(qint64 maximumTime);
|
void complete(qint64 maximumTime);
|
||||||
void traceFinished(qint64 time, const QList<int> &engineIds);
|
void traceFinished(qint64 timestamp, const QList<int> &engineIds);
|
||||||
void traceStarted(qint64 time, const QList<int> &engineIds);
|
void traceStarted(qint64 timestamp, const QList<int> &engineIds);
|
||||||
|
|
||||||
void rangedEvent(Message, RangeType, int detailType, qint64 startTime, qint64 length,
|
void rangedEvent(Message, RangeType, int detailType, qint64 startTime, qint64 length,
|
||||||
const QString &data, const QmlEventLocation &location, qint64 param1,
|
const QString &data, const QmlEventLocation &location, qint64 param1,
|
||||||
qint64 param2, qint64 param3, qint64 param4, qint64 param5);
|
qint64 param2, qint64 param3, qint64 param4, qint64 param5);
|
||||||
void debugMessage(QtMsgType type, qint64 timestamp, const QString &text,
|
|
||||||
|
void debugMessage(qint64 timestamp, QtMsgType type, const QString &text,
|
||||||
const QmlEventLocation &location);
|
const QmlEventLocation &location);
|
||||||
|
|
||||||
void recordingChanged(bool arg);
|
void recordingChanged(bool arg);
|
||||||
void recordedFeaturesChanged(quint64 features);
|
void recordedFeaturesChanged(quint64 features);
|
||||||
void newEngine(int engineId);
|
void newEngine(int engineId);
|
||||||
|
@@ -25,7 +25,6 @@
|
|||||||
|
|
||||||
#include "qmlprofilertracefile.h"
|
#include "qmlprofilertracefile.h"
|
||||||
|
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QIODevice>
|
#include <QIODevice>
|
||||||
@@ -657,12 +656,12 @@ void QmlProfilerFileWriter::save(QIODevice *device)
|
|||||||
if (isCanceled())
|
if (isCanceled())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const QmlNote ¬es = m_notes[noteIndex];
|
const QmlNote ¬e = m_notes[noteIndex];
|
||||||
stream.writeStartElement(_("note"));
|
stream.writeStartElement(_("note"));
|
||||||
stream.writeAttribute(_("startTime"), QString::number(notes.startTime));
|
stream.writeAttribute(_("startTime"), QString::number(note.startTime));
|
||||||
stream.writeAttribute(_("duration"), QString::number(notes.duration));
|
stream.writeAttribute(_("duration"), QString::number(note.duration));
|
||||||
stream.writeAttribute(_("eventIndex"), QString::number(notes.typeIndex));
|
stream.writeAttribute(_("eventIndex"), QString::number(note.typeIndex));
|
||||||
stream.writeCharacters(notes.text);
|
stream.writeCharacters(note.text);
|
||||||
stream.writeEndElement(); // note
|
stream.writeEndElement(); // note
|
||||||
incrementProgress();
|
incrementProgress();
|
||||||
}
|
}
|
||||||
@@ -692,6 +691,5 @@ bool QmlProfilerFileWriter::isCanceled() const
|
|||||||
return m_future && m_future->isCanceled();
|
return m_future && m_future->isCanceled();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace QmlProfiler
|
} // namespace QmlProfiler
|
||||||
|
Reference in New Issue
Block a user