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:
Ulf Hermann
2016-04-28 16:13:16 +02:00
parent dd87df7e5d
commit 4a1e5a637a
24 changed files with 471 additions and 635 deletions

View File

@@ -48,11 +48,11 @@ class QMLPROFILER_EXPORT QmlProfilerTraceTime : public QObject
Q_OBJECT
public:
explicit QmlProfilerTraceTime(QObject *parent);
~QmlProfilerTraceTime();
qint64 startTime() const;
qint64 endTime() const;
qint64 duration() const;
bool isRestrictedToRange() const;
public slots:
void clear();
@@ -60,10 +60,14 @@ public slots:
void setTime(qint64 startTime, qint64 endTime);
void decreaseStartTime(qint64 time);
void increaseEndTime(qint64 time);
void restrictToRange(qint64 startTime, qint64 endTime);
private:
qint64 m_startTime;
qint64 m_endTime;
qint64 m_restrictedStartTime;
qint64 m_restrictedEndTime;
};
} // End internal namespace
@@ -124,13 +128,11 @@ signals:
public slots:
void clear();
void restrictToRange(qint64 startTime, qint64 endTime);
bool isRestrictedToRange() const;
void startAcquiring();
void addQmlEvent(Message message, RangeType rangeType, int bindingType, qint64 startTime,
qint64 length, const QString &data, const QmlEventLocation &location,
qint64 ndata1, qint64 ndata2, qint64 ndata3, qint64 ndata4, qint64 ndata5);
void addDebugMessage(qint64 timestamp, QtMsgType type, const QString &text,
const QmlEventLocation &location);
void addQmlEvent(const QmlEvent &event, const QmlEventType &type);
void save(const QString &filename);
void load(const QString &filename);