2013-08-08 13:28:08 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2013-08-08 13:28:08 +02:00
|
|
|
**
|
|
|
|
|
** 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
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2013-08-08 13:28:08 +02:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2013-08-08 13:28:08 +02:00
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
2015-12-04 15:41:20 +01:00
|
|
|
#include "qmlprofilerstatisticsmodel.h"
|
2013-08-08 13:28:08 +02:00
|
|
|
#include "qmlprofilermodelmanager.h"
|
|
|
|
|
|
2014-06-16 18:25:52 +04:00
|
|
|
#include <utils/algorithm.h>
|
2013-08-08 13:28:08 +02:00
|
|
|
#include <utils/qtcassert.h>
|
|
|
|
|
|
|
|
|
|
#include <QHash>
|
2016-04-28 16:02:54 +02:00
|
|
|
#include <QSet>
|
2016-09-08 18:26:55 +02:00
|
|
|
#include <QString>
|
2013-08-08 13:28:08 +02:00
|
|
|
|
2016-04-28 16:13:16 +02:00
|
|
|
#include <functional>
|
|
|
|
|
|
2013-08-08 13:28:08 +02:00
|
|
|
namespace QmlProfiler {
|
|
|
|
|
|
2016-12-28 18:12:49 +01:00
|
|
|
double QmlProfilerStatisticsModel::durationPercent(int typeId) const
|
|
|
|
|
{
|
2018-03-23 09:28:57 +01:00
|
|
|
const QmlEventStats &global = m_data[-1];
|
|
|
|
|
const QmlEventStats &stats = m_data[typeId];
|
2016-12-28 18:12:49 +01:00
|
|
|
return double(stats.duration - stats.durationRecursive) / double(global.duration) * 100l;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
double QmlProfilerStatisticsModel::durationSelfPercent(int typeId) const
|
|
|
|
|
{
|
2018-03-23 09:28:57 +01:00
|
|
|
const QmlEventStats &global = m_data[-1];
|
|
|
|
|
const QmlEventStats &stats = m_data[typeId];
|
2016-12-28 18:12:49 +01:00
|
|
|
return double(stats.durationSelf) / double(global.duration) * 100l;
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-23 09:28:57 +01:00
|
|
|
QmlProfilerStatisticsModel::QmlProfilerStatisticsModel(QmlProfilerModelManager *modelManager)
|
|
|
|
|
: m_modelManager(modelManager)
|
2013-08-08 13:28:08 +02:00
|
|
|
{
|
2016-04-26 16:38:56 +02:00
|
|
|
connect(modelManager, &QmlProfilerModelManager::stateChanged,
|
2015-12-04 15:41:20 +01:00
|
|
|
this, &QmlProfilerStatisticsModel::dataChanged);
|
2015-10-30 12:35:17 +01:00
|
|
|
connect(modelManager->notesModel(), &Timeline::TimelineNotesModel::changed,
|
2015-12-04 15:41:20 +01:00
|
|
|
this, &QmlProfilerStatisticsModel::notesChanged);
|
2018-03-23 09:28:57 +01:00
|
|
|
modelManager->registerModelProxy();
|
2013-08-08 13:28:08 +02:00
|
|
|
|
2018-03-23 09:28:57 +01:00
|
|
|
m_acceptedTypes << Compiling << Creating << Binding << HandlingSignal << Javascript;
|
2014-09-09 18:22:58 +02:00
|
|
|
|
2016-04-28 16:19:17 +02:00
|
|
|
modelManager->announceFeatures(Constants::QML_JS_RANGE_FEATURES,
|
|
|
|
|
[this](const QmlEvent &event, const QmlEventType &type) {
|
|
|
|
|
loadEvent(event, type);
|
|
|
|
|
}, [this]() {
|
|
|
|
|
finalize();
|
|
|
|
|
});
|
2013-08-08 13:28:08 +02:00
|
|
|
}
|
|
|
|
|
|
2018-03-23 09:51:44 +01:00
|
|
|
void QmlProfilerStatisticsModel::restrictToFeatures(quint64 features)
|
2014-03-06 16:12:02 +01:00
|
|
|
{
|
2016-04-28 16:13:16 +02:00
|
|
|
bool didChange = false;
|
|
|
|
|
for (int i = 0; i < MaximumRangeType; ++i) {
|
|
|
|
|
RangeType type = static_cast<RangeType>(i);
|
|
|
|
|
quint64 featureFlag = 1ULL << featureFromRangeType(type);
|
|
|
|
|
if (Constants::QML_JS_RANGE_FEATURES & featureFlag) {
|
|
|
|
|
bool accepted = features & featureFlag;
|
2018-03-23 09:28:57 +01:00
|
|
|
if (accepted && !m_acceptedTypes.contains(type)) {
|
|
|
|
|
m_acceptedTypes << type;
|
2016-04-28 16:13:16 +02:00
|
|
|
didChange = true;
|
2018-03-23 09:28:57 +01:00
|
|
|
} else if (!accepted && m_acceptedTypes.contains(type)) {
|
|
|
|
|
m_acceptedTypes.removeOne(type);
|
2016-04-28 16:13:16 +02:00
|
|
|
didChange = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-03-23 09:28:57 +01:00
|
|
|
if (!didChange || m_modelManager->state() != QmlProfilerModelManager::Done)
|
2016-04-28 16:13:16 +02:00
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
clear();
|
2018-03-23 09:28:57 +01:00
|
|
|
if (!m_modelManager->replayEvents(m_modelManager->traceTime()->startTime(),
|
|
|
|
|
m_modelManager->traceTime()->endTime(),
|
2016-12-29 14:26:29 +01:00
|
|
|
std::bind(&QmlProfilerStatisticsModel::loadEvent,
|
|
|
|
|
this, std::placeholders::_1,
|
|
|
|
|
std::placeholders::_2))) {
|
2018-03-23 09:28:57 +01:00
|
|
|
emit m_modelManager->error(tr("Could not re-read events from temporary trace file."));
|
2017-02-20 19:19:50 +01:00
|
|
|
clear();
|
|
|
|
|
} else {
|
|
|
|
|
finalize();
|
|
|
|
|
notesChanged(-1); // Reload notes
|
|
|
|
|
}
|
2014-03-06 16:12:02 +01:00
|
|
|
}
|
|
|
|
|
|
2018-03-23 09:28:57 +01:00
|
|
|
bool QmlProfilerStatisticsModel::isRestrictedToRange() const
|
|
|
|
|
{
|
|
|
|
|
return m_modelManager->isRestrictedToRange();
|
|
|
|
|
}
|
|
|
|
|
|
2015-12-04 15:41:20 +01:00
|
|
|
const QHash<int, QmlProfilerStatisticsModel::QmlEventStats> &QmlProfilerStatisticsModel::getData() const
|
2013-08-08 13:28:08 +02:00
|
|
|
{
|
2018-03-23 09:28:57 +01:00
|
|
|
return m_data;
|
2014-06-13 16:34:30 +02:00
|
|
|
}
|
|
|
|
|
|
2016-04-26 11:50:59 +02:00
|
|
|
const QVector<QmlEventType> &QmlProfilerStatisticsModel::getTypes() const
|
2014-06-13 16:34:30 +02:00
|
|
|
{
|
2018-03-23 09:28:57 +01:00
|
|
|
return m_modelManager->eventTypes();
|
2013-08-08 13:28:08 +02:00
|
|
|
}
|
|
|
|
|
|
2015-12-04 15:41:20 +01:00
|
|
|
const QHash<int, QString> &QmlProfilerStatisticsModel::getNotes() const
|
2014-09-26 18:25:39 +02:00
|
|
|
{
|
2018-03-23 09:28:57 +01:00
|
|
|
return m_notes;
|
2014-09-26 18:25:39 +02:00
|
|
|
}
|
|
|
|
|
|
2015-12-04 15:41:20 +01:00
|
|
|
void QmlProfilerStatisticsModel::clear()
|
2013-08-08 13:28:08 +02:00
|
|
|
{
|
2018-03-23 09:28:57 +01:00
|
|
|
m_data.clear();
|
|
|
|
|
m_notes.clear();
|
|
|
|
|
m_callStack.clear();
|
|
|
|
|
m_compileStack.clear();
|
|
|
|
|
m_durations.clear();
|
|
|
|
|
if (!m_calleesModel.isNull())
|
|
|
|
|
m_calleesModel->clear();
|
|
|
|
|
if (!m_callersModel.isNull())
|
|
|
|
|
m_callersModel->clear();
|
2013-08-08 13:28:08 +02:00
|
|
|
}
|
|
|
|
|
|
2016-04-26 16:38:56 +02:00
|
|
|
void QmlProfilerStatisticsModel::setRelativesModel(QmlProfilerStatisticsRelativesModel *relative,
|
|
|
|
|
QmlProfilerStatisticsRelation relation)
|
|
|
|
|
{
|
2018-03-23 10:14:48 +01:00
|
|
|
if (relation == QmlProfilerStatisticsCallers)
|
2018-03-23 09:28:57 +01:00
|
|
|
m_callersModel = relative;
|
2016-04-26 16:38:56 +02:00
|
|
|
else
|
2018-03-23 09:28:57 +01:00
|
|
|
m_calleesModel = relative;
|
2016-04-26 16:38:56 +02:00
|
|
|
}
|
|
|
|
|
|
2016-04-28 16:13:16 +02:00
|
|
|
QmlProfilerModelManager *QmlProfilerStatisticsModel::modelManager() const
|
|
|
|
|
{
|
2018-03-23 09:28:57 +01:00
|
|
|
return m_modelManager;
|
2016-04-28 16:13:16 +02:00
|
|
|
}
|
|
|
|
|
|
2015-12-04 15:41:20 +01:00
|
|
|
void QmlProfilerStatisticsModel::dataChanged()
|
2013-08-08 13:28:08 +02:00
|
|
|
{
|
2018-03-23 09:28:57 +01:00
|
|
|
if (m_modelManager->state() == QmlProfilerModelManager::ClearingData)
|
2013-12-16 10:46:43 +01:00
|
|
|
clear();
|
2013-08-08 13:28:08 +02:00
|
|
|
}
|
|
|
|
|
|
2015-12-04 15:41:20 +01:00
|
|
|
void QmlProfilerStatisticsModel::notesChanged(int typeIndex)
|
2014-09-26 18:25:39 +02:00
|
|
|
{
|
2018-03-23 09:28:57 +01:00
|
|
|
const QmlProfilerNotesModel *notesModel = m_modelManager->notesModel();
|
2014-09-26 18:25:39 +02:00
|
|
|
if (typeIndex == -1) {
|
2018-03-23 09:28:57 +01:00
|
|
|
m_notes.clear();
|
2014-09-26 18:25:39 +02:00
|
|
|
for (int noteId = 0; noteId < notesModel->count(); ++noteId) {
|
|
|
|
|
int noteType = notesModel->typeId(noteId);
|
|
|
|
|
if (noteType != -1) {
|
2018-03-23 09:28:57 +01:00
|
|
|
QString ¬e = m_notes[noteType];
|
2014-09-26 18:25:39 +02:00
|
|
|
if (note.isEmpty()) {
|
|
|
|
|
note = notesModel->text(noteId);
|
|
|
|
|
} else {
|
|
|
|
|
note.append(QStringLiteral("\n")).append(notesModel->text(noteId));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
2018-03-23 09:28:57 +01:00
|
|
|
m_notes.remove(typeIndex);
|
2015-04-01 11:19:32 +02:00
|
|
|
const QVariantList changedNotes = notesModel->byTypeId(typeIndex);
|
2014-09-26 18:25:39 +02:00
|
|
|
if (!changedNotes.isEmpty()) {
|
|
|
|
|
QStringList newNotes;
|
|
|
|
|
for (QVariantList::ConstIterator it = changedNotes.begin(); it != changedNotes.end();
|
|
|
|
|
++it) {
|
|
|
|
|
newNotes << notesModel->text(it->toInt());
|
|
|
|
|
}
|
2018-03-23 09:28:57 +01:00
|
|
|
m_notes[typeIndex] = newNotes.join(QStringLiteral("\n"));
|
2014-09-26 18:25:39 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
emit notesAvailable(typeIndex);
|
|
|
|
|
}
|
|
|
|
|
|
2016-04-26 16:38:56 +02:00
|
|
|
void QmlProfilerStatisticsModel::loadEvent(const QmlEvent &event, const QmlEventType &type)
|
|
|
|
|
{
|
2018-03-23 09:28:57 +01:00
|
|
|
if (!m_acceptedTypes.contains(type.rangeType()))
|
2016-04-26 16:38:56 +02:00
|
|
|
return;
|
2013-08-08 13:28:08 +02:00
|
|
|
|
2016-12-28 18:12:49 +01:00
|
|
|
bool isRecursive = false;
|
2018-03-23 09:28:57 +01:00
|
|
|
QStack<QmlEvent> &stack = type.rangeType() == Compiling ? m_compileStack : m_callStack;
|
2016-04-28 16:13:16 +02:00
|
|
|
switch (event.rangeStage()) {
|
|
|
|
|
case RangeStart:
|
2016-09-08 18:26:55 +02:00
|
|
|
stack.push(event);
|
2016-04-28 16:13:16 +02:00
|
|
|
break;
|
|
|
|
|
case RangeEnd: {
|
|
|
|
|
// update stats
|
2017-03-20 16:19:48 +01:00
|
|
|
QTC_ASSERT(!stack.isEmpty(), return);
|
|
|
|
|
QTC_ASSERT(stack.top().typeIndex() == event.typeIndex(), return);
|
2018-03-23 09:28:57 +01:00
|
|
|
QmlEventStats *stats = &m_data[event.typeIndex()];
|
2016-09-08 18:26:55 +02:00
|
|
|
qint64 duration = event.timestamp() - stack.top().timestamp();
|
2016-04-28 16:13:16 +02:00
|
|
|
stats->duration += duration;
|
|
|
|
|
stats->durationSelf += duration;
|
|
|
|
|
if (duration < stats->minTime)
|
|
|
|
|
stats->minTime = duration;
|
|
|
|
|
if (duration > stats->maxTime)
|
|
|
|
|
stats->maxTime = duration;
|
|
|
|
|
stats->calls++;
|
|
|
|
|
// for median computing
|
2018-03-23 09:28:57 +01:00
|
|
|
m_durations[event.typeIndex()].append(duration);
|
2016-09-08 18:26:55 +02:00
|
|
|
stack.pop();
|
2013-08-08 13:28:08 +02:00
|
|
|
|
2016-12-28 18:12:49 +01:00
|
|
|
// recursion detection: check whether event was already in stack
|
|
|
|
|
for (int ii = 0; ii < stack.size(); ++ii) {
|
|
|
|
|
if (stack.at(ii).typeIndex() == event.typeIndex()) {
|
|
|
|
|
isRecursive = true;
|
|
|
|
|
stats->durationRecursive += duration;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-12-28 18:40:01 +01:00
|
|
|
if (!stack.isEmpty())
|
2018-03-23 09:28:57 +01:00
|
|
|
m_data[stack.top().typeIndex()].durationSelf -= duration;
|
2016-12-28 18:12:49 +01:00
|
|
|
else
|
2018-03-23 09:28:57 +01:00
|
|
|
m_data[-1].duration += duration;
|
2016-04-28 16:13:16 +02:00
|
|
|
break;
|
2016-04-26 16:38:56 +02:00
|
|
|
}
|
2016-04-28 16:13:16 +02:00
|
|
|
default:
|
2016-09-08 18:26:55 +02:00
|
|
|
return;
|
2016-04-26 16:38:56 +02:00
|
|
|
}
|
|
|
|
|
|
2018-03-23 09:28:57 +01:00
|
|
|
if (!m_calleesModel.isNull())
|
|
|
|
|
m_calleesModel->loadEvent(type.rangeType(), event, isRecursive);
|
|
|
|
|
if (!m_callersModel.isNull())
|
|
|
|
|
m_callersModel->loadEvent(type.rangeType(), event, isRecursive);
|
2016-04-26 16:38:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void QmlProfilerStatisticsModel::finalize()
|
|
|
|
|
{
|
2013-08-08 13:28:08 +02:00
|
|
|
// post-process: calc mean time, median time, percentoftime
|
2018-03-23 09:28:57 +01:00
|
|
|
for (QHash<int, QmlEventStats>::iterator it = m_data.begin(); it != m_data.end(); ++it) {
|
|
|
|
|
QVector<qint64> eventDurations = m_durations[it.key()];
|
2013-08-08 13:28:08 +02:00
|
|
|
if (!eventDurations.isEmpty()) {
|
2014-06-16 18:25:52 +04:00
|
|
|
Utils::sort(eventDurations);
|
2016-12-28 18:12:49 +01:00
|
|
|
it->medianTime = eventDurations.at(eventDurations.count()/2);
|
2013-08-08 13:28:08 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// insert root event
|
2018-03-23 09:28:57 +01:00
|
|
|
QmlEventStats &rootEvent = m_data[-1];
|
2016-12-28 18:12:49 +01:00
|
|
|
rootEvent.minTime = rootEvent.maxTime = rootEvent.medianTime = rootEvent.duration;
|
|
|
|
|
rootEvent.durationSelf = 0;
|
2014-06-13 16:34:30 +02:00
|
|
|
rootEvent.calls = 1;
|
2013-08-08 13:28:08 +02:00
|
|
|
|
|
|
|
|
emit dataAvailable();
|
|
|
|
|
}
|
|
|
|
|
|
2015-12-04 15:41:20 +01:00
|
|
|
int QmlProfilerStatisticsModel::count() const
|
2013-08-08 13:28:08 +02:00
|
|
|
{
|
2018-03-23 09:28:57 +01:00
|
|
|
return m_data.count();
|
2013-08-08 13:28:08 +02:00
|
|
|
}
|
|
|
|
|
|
2015-12-04 15:41:20 +01:00
|
|
|
QmlProfilerStatisticsRelativesModel::QmlProfilerStatisticsRelativesModel(
|
2018-03-23 09:28:57 +01:00
|
|
|
QmlProfilerModelManager *modelManager,
|
|
|
|
|
QmlProfilerStatisticsModel *statisticsModel,
|
|
|
|
|
QmlProfilerStatisticsRelation relation) :
|
|
|
|
|
m_modelManager(modelManager), m_relation(relation)
|
2013-08-08 13:28:08 +02:00
|
|
|
{
|
|
|
|
|
QTC_CHECK(modelManager);
|
2015-12-04 15:41:20 +01:00
|
|
|
QTC_CHECK(statisticsModel);
|
2016-04-26 16:38:56 +02:00
|
|
|
statisticsModel->setRelativesModel(this, relation);
|
2013-08-08 13:28:08 +02:00
|
|
|
|
2014-03-06 16:12:02 +01:00
|
|
|
// Load the child models whenever the parent model is done to get the filtering for JS/QML
|
|
|
|
|
// right.
|
2016-04-26 16:38:56 +02:00
|
|
|
connect(statisticsModel, &QmlProfilerStatisticsModel::dataAvailable,
|
|
|
|
|
this, &QmlProfilerStatisticsRelativesModel::dataAvailable);
|
2013-08-08 13:28:08 +02:00
|
|
|
}
|
|
|
|
|
|
2015-12-04 15:41:20 +01:00
|
|
|
const QmlProfilerStatisticsRelativesModel::QmlStatisticsRelativesMap &
|
|
|
|
|
QmlProfilerStatisticsRelativesModel::getData(int typeId) const
|
2013-08-08 13:28:08 +02:00
|
|
|
{
|
2015-12-04 15:41:20 +01:00
|
|
|
QHash <int, QmlStatisticsRelativesMap>::ConstIterator it = m_data.find(typeId);
|
2014-06-13 16:34:30 +02:00
|
|
|
if (it != m_data.end()) {
|
|
|
|
|
return it.value();
|
|
|
|
|
} else {
|
2015-12-04 15:41:20 +01:00
|
|
|
static const QmlStatisticsRelativesMap emptyMap;
|
2014-06-13 16:34:30 +02:00
|
|
|
return emptyMap;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-04-26 11:50:59 +02:00
|
|
|
const QVector<QmlEventType> &QmlProfilerStatisticsRelativesModel::getTypes() const
|
2014-06-13 16:34:30 +02:00
|
|
|
{
|
2016-12-29 14:26:29 +01:00
|
|
|
return m_modelManager->eventTypes();
|
2013-08-08 13:28:08 +02:00
|
|
|
}
|
|
|
|
|
|
2016-12-28 18:12:49 +01:00
|
|
|
void QmlProfilerStatisticsRelativesModel::loadEvent(RangeType type, const QmlEvent &event,
|
|
|
|
|
bool isRecursive)
|
2013-08-08 13:28:08 +02:00
|
|
|
{
|
2016-09-08 18:26:55 +02:00
|
|
|
QStack<Frame> &stack = (type == Compiling) ? m_compileStack : m_callStack;
|
|
|
|
|
|
2016-04-28 16:13:16 +02:00
|
|
|
switch (event.rangeStage()) {
|
|
|
|
|
case RangeStart:
|
2016-09-08 18:26:55 +02:00
|
|
|
stack.push({event.timestamp(), event.typeIndex()});
|
2016-04-28 16:13:16 +02:00
|
|
|
break;
|
|
|
|
|
case RangeEnd: {
|
2018-03-23 10:14:48 +01:00
|
|
|
int callerTypeIndex = stack.count() > 1 ? stack[stack.count() - 2].typeId : -1;
|
|
|
|
|
int relativeTypeIndex = (m_relation == QmlProfilerStatisticsCallers) ? callerTypeIndex :
|
2016-04-28 16:13:16 +02:00
|
|
|
event.typeIndex();
|
2018-03-23 10:14:48 +01:00
|
|
|
int selfTypeIndex = (m_relation == QmlProfilerStatisticsCallers) ? event.typeIndex() :
|
|
|
|
|
callerTypeIndex;
|
2016-04-28 16:13:16 +02:00
|
|
|
|
|
|
|
|
QmlStatisticsRelativesMap &relativesMap = m_data[selfTypeIndex];
|
|
|
|
|
QmlStatisticsRelativesMap::Iterator it = relativesMap.find(relativeTypeIndex);
|
|
|
|
|
if (it != relativesMap.end()) {
|
2016-12-28 18:12:49 +01:00
|
|
|
it->calls++;
|
|
|
|
|
it->duration += event.timestamp() - stack.top().startTime;
|
|
|
|
|
it->isRecursive = isRecursive || it->isRecursive;
|
2016-04-28 16:13:16 +02:00
|
|
|
} else {
|
|
|
|
|
QmlStatisticsRelativesData relative = {
|
2016-09-08 18:26:55 +02:00
|
|
|
event.timestamp() - stack.top().startTime,
|
2016-04-28 16:13:16 +02:00
|
|
|
1,
|
2016-12-28 18:12:49 +01:00
|
|
|
isRecursive
|
2016-04-28 16:13:16 +02:00
|
|
|
};
|
|
|
|
|
relativesMap.insert(relativeTypeIndex, relative);
|
|
|
|
|
}
|
2016-09-08 18:26:55 +02:00
|
|
|
stack.pop();
|
2016-04-28 16:13:16 +02:00
|
|
|
break;
|
2016-04-26 16:38:56 +02:00
|
|
|
}
|
2016-04-28 16:13:16 +02:00
|
|
|
default:
|
|
|
|
|
break;
|
2016-04-26 16:38:56 +02:00
|
|
|
}
|
2013-08-08 13:28:08 +02:00
|
|
|
}
|
|
|
|
|
|
2016-05-24 15:50:31 +02:00
|
|
|
QmlProfilerStatisticsRelation QmlProfilerStatisticsRelativesModel::relation() const
|
|
|
|
|
{
|
|
|
|
|
return m_relation;
|
|
|
|
|
}
|
|
|
|
|
|
2016-04-26 16:38:56 +02:00
|
|
|
int QmlProfilerStatisticsRelativesModel::count() const
|
2013-08-08 13:28:08 +02:00
|
|
|
{
|
2016-04-26 16:38:56 +02:00
|
|
|
return m_data.count();
|
2013-08-08 13:28:08 +02:00
|
|
|
}
|
|
|
|
|
|
2016-04-26 16:38:56 +02:00
|
|
|
void QmlProfilerStatisticsRelativesModel::clear()
|
|
|
|
|
{
|
|
|
|
|
m_data.clear();
|
2016-09-08 18:26:55 +02:00
|
|
|
m_callStack.clear();
|
|
|
|
|
m_compileStack.clear();
|
2013-08-08 13:28:08 +02:00
|
|
|
}
|
2016-04-26 16:38:56 +02:00
|
|
|
|
|
|
|
|
} // namespace QmlProfiler
|