Commit 3e8a40c3 authored by Joerg Bornemann's avatar Joerg Bornemann
Browse files

QmlProfiler: remove V8 tab



V8 is gone long enough to stop supporting it.

Change-Id: If086925359097a69ffab2b2eba4de6f63bd5195e
Reviewed-by: default avatarUlf Hermann <ulf.hermann@theqtcompany.com>
Reviewed-by: default avatarAlessandro Portale <alessandro.portale@theqtcompany.com>
parent b46cf9aa
......@@ -29,9 +29,7 @@ SOURCES += \
qmlprofilertracefile.cpp \
qmlprofilertraceview.cpp \
qmlprofilertreeview.cpp \
qmlprofilerviewmanager.cpp \
qv8profilerdatamodel.cpp \
qv8profilereventview.cpp
qmlprofilerviewmanager.cpp
HEADERS += \
abstractqmlprofilerrunner.h \
......@@ -62,9 +60,7 @@ HEADERS += \
qmlprofilertracefile.h \
qmlprofilertraceview.h \
qmlprofilertreeview.h \
qmlprofilerviewmanager.h \
qv8profilerdatamodel.h \
qv8profilereventview.h
qmlprofilerviewmanager.h
RESOURCES += \
qml/qmlprofiler.qrc
......
......@@ -47,8 +47,6 @@ QtcPlugin {
"qmlprofilertraceview.cpp", "qmlprofilertraceview.h",
"qmlprofilertreeview.cpp", "qmlprofilertreeview.h",
"qmlprofilerviewmanager.cpp", "qmlprofilerviewmanager.h",
"qv8profilerdatamodel.cpp", "qv8profilerdatamodel.h",
"qv8profilereventview.h", "qv8profilereventview.cpp",
]
}
......
......@@ -34,7 +34,6 @@
#include <qmldebug/qmldebugclient.h>
#include <qmldebug/qmlprofilertraceclient.h>
#include <qmldebug/qv8profilerclient.h>
#include <utils/qtcassert.h>
#include <QPointer>
......@@ -56,7 +55,6 @@ public:
QmlDebugConnection *connection;
QPointer<QmlProfilerTraceClient> qmlclientplugin;
QPointer<QV8ProfilerClient> v8clientplugin;
QTimer connectionTimer;
int connectionAttempts;
......@@ -70,7 +68,6 @@ public:
QString ostDevice;
QString sysroot;
bool v8DataReady;
bool qmlDataReady;
QmlProfilerModelManager *modelManager;
......@@ -85,7 +82,6 @@ QmlProfilerClientManager::QmlProfilerClientManager(QObject *parent) :
d->connection = 0;
d->connectionAttempts = 0;
d->v8DataReady = false;
d->qmlDataReady = false;
d->modelManager = 0;
......@@ -98,8 +94,6 @@ QmlProfilerClientManager::~QmlProfilerClientManager()
{
delete d->connection;
delete d->qmlclientplugin.data();
delete d->v8clientplugin.data();
delete d;
}
......@@ -131,8 +125,6 @@ void QmlProfilerClientManager::clearBufferedData()
{
if (d->qmlclientplugin)
d->qmlclientplugin.data()->clearData();
if (d->v8clientplugin)
d->v8clientplugin.data()->clearData();
}
void QmlProfilerClientManager::discardPendingData()
......@@ -165,8 +157,6 @@ void QmlProfilerClientManager::enableServices()
delete d->qmlclientplugin.data();
d->qmlclientplugin = new QmlProfilerTraceClient(d->connection,
d->profilerState->recordingFeatures());
delete d->v8clientplugin.data();
d->v8clientplugin = new QV8ProfilerClient(d->connection);
connectClientSignals();
}
......@@ -196,15 +186,6 @@ void QmlProfilerClientManager::connectClientSignals()
connect(d->profilerState, SIGNAL(recordingFeaturesChanged(quint64)),
d->qmlclientplugin.data(), SLOT(setFeatures(quint64)));
}
if (d->v8clientplugin) {
connect(d->v8clientplugin.data(), SIGNAL(complete()), this, SLOT(v8Complete()));
connect(d->v8clientplugin.data(),
SIGNAL(v8range(int,QString,QString,int,double,double)),
d->modelManager,
SLOT(addV8Event(int,QString,QString,int,double,double)));
connect(d->v8clientplugin.data(), SIGNAL(enabledChanged()),
d->v8clientplugin.data(), SLOT(sendRecordingStatus()));
}
}
void QmlProfilerClientManager::disconnectClientSignals()
......@@ -230,15 +211,6 @@ void QmlProfilerClientManager::disconnectClientSignals()
disconnect(d->profilerState, SIGNAL(recordingFeaturesChanged(quint64)),
d->qmlclientplugin.data(), SLOT(setFeatures(quint64)));
}
if (d->v8clientplugin) {
disconnect(d->v8clientplugin.data(), SIGNAL(complete()), this, SLOT(v8Complete()));
disconnect(d->v8clientplugin.data(),
SIGNAL(v8range(int,QString,QString,int,double,double)),
d->modelManager,
SLOT(addV8Event(int,QString,QString,int,double,double)));
disconnect(d->v8clientplugin.data(), SIGNAL(enabledChanged()),
d->v8clientplugin.data(), SLOT(sendRecordingStatus()));
}
}
void QmlProfilerClientManager::connectToClient()
......@@ -341,35 +313,15 @@ void QmlProfilerClientManager::qmlComplete(qint64 maximumTime)
{
d->modelManager->traceTime()->increaseEndTime(maximumTime);
d->qmlDataReady = true;
if (!d->v8clientplugin ||
d->v8clientplugin.data()->state() != QmlDebugClient::Enabled ||
d->v8DataReady) {
emit dataReadyForProcessing();
// once complete is sent, reset the flags
d->qmlDataReady = false;
d->v8DataReady = false;
}
}
void QmlProfilerClientManager::v8Complete()
{
d->v8DataReady = true;
if (!d->qmlclientplugin ||
d->qmlclientplugin.data()->state() != QmlDebugClient::Enabled ||
d->qmlDataReady) {
emit dataReadyForProcessing();
// once complete is sent, reset the flags
d->v8DataReady = false;
d->qmlDataReady = false;
}
}
void QmlProfilerClientManager::stopClientsRecording()
{
if (d->qmlclientplugin)
d->qmlclientplugin.data()->setRecording(false);
if (d->v8clientplugin)
d->v8clientplugin.data()->setRecording(false);
}
////////////////////////////////////////////////////////////////
......@@ -419,17 +371,13 @@ void QmlProfilerClientManager::clientRecordingChanged()
if (d->profilerState->currentState() == QmlProfilerStateManager::AppRunning) {
if (d->qmlclientplugin)
d->qmlclientplugin.data()->setRecording(d->profilerState->clientRecording());
if (d->v8clientplugin)
d->v8clientplugin.data()->setRecording(d->profilerState->clientRecording());
}
}
void QmlProfilerClientManager::serverRecordingChanged()
{
if (d->profilerState->serverRecording()) {
d->v8DataReady = false;
if (d->profilerState->serverRecording())
d->qmlDataReady = false;
}
}
} // namespace Internal
......
......@@ -77,7 +77,6 @@ private slots:
void retryMessageBoxFinished(int result);
void qmlComplete(qint64 maximumTime);
void v8Complete();
void profilerStateChanged();
void clientRecordingChanged();
......
......@@ -31,7 +31,6 @@
#include "qmlprofilermodelmanager.h"
#include "qmlprofilerconstants.h"
#include "qmlprofilerdatamodel.h"
#include "qv8profilerdatamodel.h"
#include "qmlprofilertracefile.h"
#include "qmlprofilernotesmodel.h"
......@@ -173,7 +172,6 @@ public:
QmlProfilerModelManager *q;
QmlProfilerDataModel *model;
QV8ProfilerDataModel *v8Model;
QmlProfilerNotesModel *notesModel;
QmlProfilerDataState *dataState;
......@@ -198,7 +196,6 @@ QmlProfilerModelManager::QmlProfilerModelManager(Utils::FileInProjectFinder *fin
d->totalWeight = 0;
d->features = 0;
d->model = new QmlProfilerDataModel(finder, this);
d->v8Model = new QV8ProfilerDataModel(finder, this);
d->dataState = new QmlProfilerDataState(this, this);
d->traceTime = new QmlProfilerTraceTime(this);
d->notesModel = new QmlProfilerNotesModel(this);
......@@ -220,11 +217,6 @@ QmlProfilerDataModel *QmlProfilerModelManager::qmlModel() const
return d->model;
}
QV8ProfilerDataModel *QmlProfilerModelManager::v8Model() const
{
return d->v8Model;
}
QmlProfilerNotesModel *QmlProfilerModelManager::notesModel() const
{
return d->notesModel;
......@@ -232,7 +224,7 @@ QmlProfilerNotesModel *QmlProfilerModelManager::notesModel() const
bool QmlProfilerModelManager::isEmpty() const
{
return d->model->isEmpty() && d->v8Model->isEmpty();
return d->model->isEmpty();
}
int QmlProfilerModelManager::count() const
......@@ -324,12 +316,6 @@ void QmlProfilerModelManager::addQmlEvent(QmlDebug::Message message,
ndata1, ndata2, ndata3, ndata4, ndata5);
}
void QmlProfilerModelManager::addV8Event(int depth, const QString &function, const QString &filename,
int lineNumber, double totalTime, double selfTime)
{
d->v8Model->addV8Event(depth, function, filename, lineNumber,totalTime, selfTime);
}
void QmlProfilerModelManager::complete()
{
switch (state()) {
......@@ -343,7 +329,6 @@ void QmlProfilerModelManager::complete()
d->traceTime->increaseEndTime(d->model->lastTimeMark());
setState(QmlProfilerDataState::ProcessingData);
d->model->complete();
d->v8Model->complete();
break;
case QmlProfilerDataState::Empty:
setState(QmlProfilerDataState::Done);
......@@ -359,7 +344,7 @@ void QmlProfilerModelManager::complete()
void QmlProfilerModelManager::modelProcessingDone()
{
Q_ASSERT(state() == QmlProfilerDataState::ProcessingData);
if (d->model->processingDone() && d->v8Model->processingDone())
if (d->model->processingDone())
complete();
}
......@@ -379,7 +364,6 @@ void QmlProfilerModelManager::save(const QString &filename)
QmlProfilerFileWriter writer;
writer.setTraceTime(traceTime()->startTime(), traceTime()->endTime(),
traceTime()->duration());
writer.setV8DataModel(d->v8Model);
writer.setQmlEvents(d->model->getEventTypes(), d->model->getEvents());
writer.setNotes(d->model->getEventNotes());
writer.setFuture(&future);
......@@ -420,7 +404,6 @@ void QmlProfilerModelManager::load()
QmlProfilerFileReader reader;
reader.setFuture(&future);
connect(&reader, &QmlProfilerFileReader::error, this, &QmlProfilerModelManager::error);
reader.setV8DataModel(d->v8Model);
reader.setQmlDataModel(d->model);
reader.load(file);
file->close();
......@@ -453,7 +436,6 @@ void QmlProfilerModelManager::clear()
d->progress = 0;
d->previousProgress = 0;
d->model->clear();
d->v8Model->clear();
d->traceTime->clear();
d->notesModel->clear();
......
......@@ -42,7 +42,6 @@
namespace QmlProfiler {
class QmlProfilerModelManager;
class QmlProfilerDataModel;
class QV8ProfilerDataModel;
class QmlProfilerNotesModel;
namespace Internal {
......@@ -118,7 +117,6 @@ public:
QmlProfilerDataState::State state() const;
QmlProfilerTraceTime *traceTime() const;
QmlProfilerDataModel *qmlModel() const;
QV8ProfilerDataModel *v8Model() const;
QmlProfilerNotesModel *notesModel() const;
bool isEmpty() const;
......@@ -150,8 +148,6 @@ public slots:
qint64 startTime, qint64 length, const QString &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);
void complete();
void modelProcessingDone();
......
......@@ -122,16 +122,10 @@ static QString qmlTypeAsString(Message message, RangeType rangeType)
QmlProfilerFileReader::QmlProfilerFileReader(QObject *parent) :
QObject(parent),
m_v8Model(0),
m_future(0)
{
}
void QmlProfilerFileReader::setV8DataModel(QV8ProfilerDataModel *dataModel)
{
m_v8Model = dataModel;
}
void QmlProfilerFileReader::setQmlDataModel(QmlProfilerDataModel *dataModel)
{
m_qmlModel = dataModel;
......@@ -190,12 +184,6 @@ bool QmlProfilerFileReader::load(QIODevice *device)
break;
}
if (elementName == _("v8profile")) {
if (m_v8Model)
m_v8Model->load(stream, m_future);
break;
}
break;
}
default: break;
......@@ -465,7 +453,6 @@ QmlProfilerFileWriter::QmlProfilerFileWriter(QObject *parent) :
m_startTime(0),
m_endTime(0),
m_measuredTime(0),
m_v8Model(0),
m_future(0)
{
}
......@@ -477,11 +464,6 @@ void QmlProfilerFileWriter::setTraceTime(qint64 startTime, qint64 endTime, qint6
m_measuredTime = measuredTime;
}
void QmlProfilerFileWriter::setV8DataModel(QV8ProfilerDataModel *dataModel)
{
m_v8Model = dataModel;
}
void QmlProfilerFileWriter::setQmlEvents(const QVector<QmlProfilerDataModel::QmlEventTypeData> &types,
const QVector<QmlProfilerDataModel::QmlEventData> &events)
{
......@@ -503,8 +485,7 @@ void QmlProfilerFileWriter::save(QIODevice *device)
{
if (m_future) {
m_future->setProgressRange(0,
qMax(m_qmlEvents.size() + m_ranges.size() + m_notes.size()
+ m_v8Model->numberOfV8Events(), 1));
qMax(m_qmlEvents.size() + m_ranges.size() + m_notes.size(), 1));
m_future->setProgressValue(0);
m_newProgressValue = 0;
}
......@@ -646,7 +627,6 @@ void QmlProfilerFileWriter::save(QIODevice *device)
if (isCanceled())
return;
m_v8Model->save(stream, m_future);
stream.writeEndElement(); // trace
stream.writeEndDocument();
......
......@@ -40,7 +40,6 @@
#include <qmldebug/qmlprofilereventtypes.h>
#include "qmlprofilerdatamodel.h"
#include "qv8profilerdatamodel.h"
QT_FORWARD_DECLARE_CLASS(QIODevice)
QT_FORWARD_DECLARE_CLASS(QXmlStreamReader)
......@@ -56,7 +55,6 @@ class QmlProfilerFileReader : public QObject
public:
explicit QmlProfilerFileReader(QObject *parent = 0);
void setV8DataModel(QV8ProfilerDataModel *dataModel);
void setQmlDataModel(QmlProfilerDataModel *dataModel);
void setFuture(QFutureInterface<void> *future);
......@@ -72,7 +70,6 @@ private:
void progress(QIODevice *device);
bool isCanceled() const;
QV8ProfilerDataModel *m_v8Model;
QmlProfilerDataModel *m_qmlModel;
QFutureInterface<void> *m_future;
QVector<QmlProfilerDataModel::QmlEventTypeData> m_qmlEvents;
......@@ -89,7 +86,6 @@ public:
explicit QmlProfilerFileWriter(QObject *parent = 0);
void setTraceTime(qint64 startTime, qint64 endTime, qint64 measturedTime);
void setV8DataModel(QV8ProfilerDataModel *dataModel);
void setQmlEvents(const QVector<QmlProfilerDataModel::QmlEventTypeData> &types,
const QVector<QmlProfilerDataModel::QmlEventData> &events);
void setNotes(const QVector<QmlProfilerDataModel::QmlEventNoteData> &notes);
......@@ -103,7 +99,6 @@ private:
bool isCanceled() const;
qint64 m_startTime, m_endTime, m_measuredTime;
QV8ProfilerDataModel *m_v8Model;
QFutureInterface<void> *m_future;
QVector<QmlProfilerDataModel::QmlEventTypeData> m_qmlEvents;
QVector<QmlProfilerDataModel::QmlEventData> m_ranges;
......
......@@ -36,7 +36,6 @@
#include "qmlprofilerstatemanager.h"
#include "qmlprofilermodelmanager.h"
#include "qmlprofilerstatewidget.h"
#include "qv8profilereventview.h"
#include <utils/qtcassert.h>
#include <utils/fancymainwindow.h>
......@@ -56,7 +55,6 @@ public:
QDockWidget *timelineDock;
QmlProfilerTraceView *traceView;
QmlProfilerEventsWidget *eventsView;
QV8ProfilerEventsWidget *v8profilerView;
QmlProfilerStateManager *profilerState;
QmlProfilerModelManager *profilerModelManager;
QmlProfilerTool *profilerTool;
......@@ -71,7 +69,6 @@ QmlProfilerViewManager::QmlProfilerViewManager(QObject *parent,
setObjectName(QLatin1String("QML Profiler View Manager"));
d->traceView = 0;
d->eventsView = 0;
d->v8profilerView = 0;
d->profilerState = profilerState;
d->profilerModelManager = modelManager;
d->profilerTool = profilerTool;
......@@ -109,39 +106,20 @@ void QmlProfilerViewManager::createViews()
connect(d->eventsView, SIGNAL(typeSelected(int)), d->traceView, SLOT(selectByTypeId(int)));
connect(d->traceView, SIGNAL(typeSelected(int)), d->eventsView, SLOT(selectByTypeId(int)));
d->v8profilerView = new QV8ProfilerEventsWidget(mw, d->profilerTool, this,
d->profilerModelManager);
d->v8profilerView->setWindowTitle(tr("V8"));
connect(d->v8profilerView, SIGNAL(gotoSourceLocation(QString,int,int)), this,
SIGNAL(gotoSourceLocation(QString,int,int)));
connect(d->traceView, SIGNAL(gotoSourceLocation(QString,int,int)),
d->v8profilerView, SLOT(selectBySourceLocation(QString,int,int)));
connect(d->v8profilerView, SIGNAL(gotoSourceLocation(QString,int,int)),
d->traceView, SLOT(selectBySourceLocation(QString,int,int)));
connect(d->v8profilerView, SIGNAL(gotoSourceLocation(QString,int,int)),
d->eventsView, SLOT(selectBySourceLocation(QString,int,int)));
connect(d->eventsView, SIGNAL(gotoSourceLocation(QString,int,int)),
d->v8profilerView, SLOT(selectBySourceLocation(QString,int,int)));
QDockWidget *eventsDock = AnalyzerManager::createDockWidget
(QmlProfilerToolId, d->eventsView);
d->timelineDock = AnalyzerManager::createDockWidget
(QmlProfilerToolId, d->traceView);
QDockWidget *v8profilerDock = AnalyzerManager::createDockWidget
(QmlProfilerToolId, d->v8profilerView);
eventsDock->show();
d->timelineDock->show();
v8profilerDock->show();
mw->splitDockWidget(mw->toolBarDockWidget(), d->timelineDock, Qt::Vertical);
mw->tabifyDockWidget(d->timelineDock, eventsDock);
mw->tabifyDockWidget(eventsDock, v8profilerDock);
d->timelineDock->raise();
new QmlProfilerStateWidget(d->profilerState, d->profilerModelManager, d->eventsView);
new QmlProfilerStateWidget(d->profilerState, d->profilerModelManager, d->traceView);
new QmlProfilerStateWidget(d->profilerState, d->profilerModelManager, d->v8profilerView);
}
bool QmlProfilerViewManager::hasValidSelection() const
......@@ -179,7 +157,6 @@ void QmlProfilerViewManager::clear()
{
d->traceView->clear();
d->eventsView->clear();
d->v8profilerView->clear();
}
} // namespace Internal
......
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms and
** conditions see http://www.qt.io/terms-conditions. For further information
** use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#include "qv8profilerdatamodel.h"
#include "qmlprofilermodelmanager.h"
#include "qmlprofilerdetailsrewriter.h"
#include "qmlprofilerbasemodel_p.h"
#include <utils/qtcassert.h>
#include <QStringList>
QT_BEGIN_NAMESPACE
Q_DECLARE_TYPEINFO(QmlProfiler::QV8ProfilerDataModel::QV8EventData, Q_MOVABLE_TYPE);
Q_DECLARE_TYPEINFO(QmlProfiler::QV8ProfilerDataModel::QV8EventSub, Q_MOVABLE_TYPE);
QT_END_NAMESPACE
namespace QmlProfiler {
typedef QHash <QString, QV8ProfilerDataModel::QV8EventSub *> EventHash;
static EventHash cloneEventHash(const EventHash &src)
{
EventHash result;
const EventHash::ConstIterator cend = src.constEnd();
for (EventHash::ConstIterator it = src.constBegin(); it != cend; ++it)
result.insert(it.key(), new QV8ProfilerDataModel::QV8EventSub(it.value()));
return result;
}
QV8ProfilerDataModel::QV8EventData &QV8ProfilerDataModel::QV8EventData::operator=(const QV8EventData &ref)
{
if (this == &ref)
return *this;
displayName = ref.displayName;
eventHashStr = ref.eventHashStr;
filename = ref.filename;
functionName = ref.functionName;
line = ref.line;
totalTime = ref.totalTime;
totalPercent = ref.totalPercent;
selfTime = ref.selfTime;
SelfTimeInPercent = ref.SelfTimeInPercent;
typeId = ref.typeId;
qDeleteAll(parentHash);
parentHash = cloneEventHash(ref.parentHash);
qDeleteAll(childrenHash);
childrenHash = cloneEventHash(ref.childrenHash);
return *this;
}
QV8ProfilerDataModel::QV8EventData::QV8EventData()
{
line = -1;
typeId = -1;
totalTime = 0;
selfTime = 0;
totalPercent = 0;
SelfTimeInPercent = 0;
}
QV8ProfilerDataModel::QV8EventData::~QV8EventData()
{
qDeleteAll(parentHash.values());
parentHash.clear();
qDeleteAll(childrenHash.values());
childrenHash.clear();
}
class QV8ProfilerDataModel::QV8ProfilerDataModelPrivate :
public QmlProfilerBaseModel::QmlProfilerBaseModelPrivate
{
public:
QV8ProfilerDataModelPrivate(QV8ProfilerDataModel *qq) :
QmlProfilerBaseModel::QmlProfilerBaseModelPrivate(qq) {}
QHash<QString, QV8EventData *> v8EventHash;
QList<QV8EventData *> pendingRewrites;
QHash<int, QV8EventData *> v8parents;
QV8EventData v8RootEvent;
qint64 v8MeasuredTime;
private:
Q_DECLARE_PUBLIC(QV8ProfilerDataModel)
};
QV8ProfilerDataModel::QV8ProfilerDataModel(Utils::FileInProjectFinder *fileFinder,
QmlProfilerModelManager *parent)
: QmlProfilerBaseModel(fileFinder, parent, new QV8ProfilerDataModelPrivate(this))
{
Q_D(QV8ProfilerDataModel);
d->v8MeasuredTime = 0;
clearV8RootEvent();
}