forked from qt-creator/qt-creator
QmlProfiler: Drive event loading from the model manager
We want to get rid of the big master list of QmlEvent in QmlProfilerDataModel, as that gets very large for longer traces. In order to reduce the dependencies on that list we load the events on the fly into the child models while they are being received, rather than having the child models query QmlProfilerDataModel for the event list later. As the trace client so far only emitted rangedEvent() for complete ranges we run into problems with models that need their events sorted. The rangedEvent() signals were sorted by end time, rather than start time which makes it inconvenient to analyze them in a stack based way, for aggregation. This is solved by passing on all the details from the trace client to the models, with the QmlProfilerDataModel aggregating the type information before having the events dispatched to the child models. Change-Id: I5831a20551f21cf91e27d298a709f604ebd96c3e Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
@@ -68,7 +68,7 @@ public:
|
||||
QmlProfilerStatisticsModel(QmlProfilerModelManager *modelManager, QObject *parent = 0);
|
||||
~QmlProfilerStatisticsModel();
|
||||
|
||||
void setEventTypeAccepted(RangeType type, bool accepted);
|
||||
void restrictToFeatures(qint64 features);
|
||||
|
||||
const QHash<int, QmlEventStats> &getData() const;
|
||||
const QVector<QmlEventType> &getTypes() const;
|
||||
@@ -77,16 +77,15 @@ public:
|
||||
int count() const;
|
||||
void clear();
|
||||
|
||||
void limitToRange(qint64 rangeStart, qint64 rangeEnd);
|
||||
void setRelativesModel(QmlProfilerStatisticsRelativesModel *childModel,
|
||||
QmlProfilerStatisticsRelation relation);
|
||||
QmlProfilerModelManager *modelManager() const;
|
||||
|
||||
signals:
|
||||
void dataAvailable();
|
||||
void notesAvailable(int typeIndex);
|
||||
|
||||
private:
|
||||
void loadData(qint64 rangeStart = -1, qint64 rangeEnd = -1);
|
||||
void loadEvent(const QmlEvent &event, const QmlEventType &type);
|
||||
void finalize();
|
||||
|
||||
@@ -133,11 +132,11 @@ protected:
|
||||
QmlProfilerModelManager *m_modelManager;
|
||||
|
||||
// for level computation
|
||||
QHash<int, qint64> m_endtimesPerLevel;
|
||||
QHash<int, qint64> m_startTimesPerLevel;
|
||||
int m_level = Constants::QML_MIN_LEVEL;
|
||||
|
||||
// compute parent-child relationship and call count
|
||||
QHash<int, int> m_lastParent;
|
||||
QHash<int, int> m_typesPerLevel;
|
||||
const QmlProfilerStatisticsRelation m_relation;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user