Commit Graph

36 Commits

Author SHA1 Message Date
Alessandro Portale
d1df55d128 QmlProfiler: Modernize
modernize-*

Change-Id: Ibdf9c0ae91bf8a622facc7f323112b550f532f15
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-12-02 14:27:29 +00:00
Ulf Hermann
916883e70f Tracing: Move event storage out of trace manager
This is a step toward making the trace manager non-virtual. It should
just juggle the storages for types and events, and manage the threads to
access them. It doesn't need to know what exactly it stores.

Change-Id: I45093c60d8ae921e68aeb09bd48d24d5877ce306
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-08 16:26:55 +00:00
Ulf Hermann
95d7be1b28 Tracing: Generalize event filtering
This allows us to not only filter by ranges, but potentially also by
other criteria.

Change-Id: I7349ceeabbb2781473a3a4c803dab1006b7b8e50
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-08 14:13:43 +00:00
Ulf Hermann
22e523e504 Add generic FlameGraphView QML component
This allows us to reduce code duplication, but we first have to put
timeline and flame graph into the same library, so that we can use the
TimelineThere in FlameGraphView.

Change-Id: I72b27ffb1fc5aa6baf6a23d85e5ca6c610896b8c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-08 07:02:05 +00:00
Ulf Hermann
1770c2ffe2 Remove TimelineTraceManager::State
This is redundant, now that we have registerFeatures().

Change-Id: Ia56c28b8892ab6da694570fe4b9ea5c96fe194f1
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-23 14:20:16 +00:00
Ulf Hermann
08ca10de81 QmlProfiler: Rename specific replayEvents to replayQmlEvents
Some compilers cannot discern the two replayEvents methods.

Change-Id: Ide4a893ff3976cb081fbbceefacafb6226f0a73f
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-04-19 11:21:59 +00:00
Ulf Hermann
1c2e0f387f QmlProfiler: Move parts of model manager and trace file to Timeline
This way we can use the trace file loading and saving mechanism for
other profilers.

Change-Id: I98ec1cdde6f7abcea152cabf72e64d4e696dfa59
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-19 08:09:07 +00:00
Ulf Hermann
780d4c6a43 Timeline: Move modelId generation into aggregator
The way the notes model works requires every timeline model to have a
different ID. Conversely no other kind of model actually needs an ID.
Therefore it makes sense to have the TimelineModelAggregator manage the
IDs as every timeline model will sooner or later be associated with an
aggregator.

Change-Id: Ib8b2c88ed883351d4e3e156dd13e1dd113c21808
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-17 14:11:51 +00:00
Ulf Hermann
7f7fe1a9db QmlProfiler: Avoid some 0 as nullptr warnings
Change-Id: I4763a22c6624eaffbb583bf26bf74a3e282b042f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-17 13:19:30 +00:00
Ulf Hermann
dcd8d37f35 QmlProfiler: Don't expose the vector of event types
We always want either the total number of event types or one specific
type. There is no need to expose the fact that we keep them as a vector.

Also, use int as the type of the "number" methods as that aligns better
with Qt containers, and rename the methods. We don't need to state the
fact that we've loaded the events and types at some point.

Change-Id: Iaf680ec9fa10e1070ddee6bcc079800e401775f0
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-17 12:20:57 +00:00
Ulf Hermann
7ca958fa85 QmlProfiler: Integrate TraceTime into ModelManager
We never use it independently and only a subset of its interface needs
to be public.

Change-Id: I97bbc638270bcbb8fb1a4097fcfeacf37e96c048
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-17 12:17:23 +00:00
Ulf Hermann
1ccd058bdf QmlProfiler: Get rid of processing step
The child models are made aware of possible changes in the details
strings, and in turn, we can do the finalization immediately after
acquiring is done.

Change-Id: Ibe57f158e64e5d01d4c97aa617c9b2bcc8e4e96e
Task-number: QTCREATORBUG-20106
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-17 09:13:04 +00:00
Ulf Hermann
63551d7711 QmlProfiler: Rebuild the flamegraph model when visible features change
This is more expensive than just setting the filtered items' height to
0. However, this way we implicitly also change the size of the root
element, group equal items that end up on the same level by filtering,
recalculate the cutoff for too small items and resort all items by
width.

Change-Id: Ida2c5acd9848c5644ecff052d78e9fe5ad962606
Task-number: QTCREATORBUG-18713
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-08-14 09:39:59 +00:00
Ulf Hermann
afdf0d5ec4 QmlProfiler: Don't add an extra nanosecond to the flame graph bottom
Change-Id: Icda2b69363439de92a012a0cf46b8084b69d777d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-08-11 11:40:01 +00:00
Ulf Hermann
bdecee9feb QmlProfiler: Add some sanity checks to the various models
If we pop an event from the stack, then it should be the same type we
pushed earlier.

Change-Id: If4389cb57fa8996b3772fefca92d27c33dc35c65
Task-number: QTCREATORBUG-17885
Reviewed-by: hjk <hjk@qt.io>
2017-03-23 15:16:14 +00:00
Ulf Hermann
78daf47a25 QmlProfiler: Remove references to QmlProfilerDataModel
We keep it private to QmlProfilerModelManager and proxy the last few
methods that were directly called on the model. This enables us to
remove the QmlProfilerDataModel class by integrating what is left of it
into QmlProfilerModelManagerPrivate in a next step.

Change-Id: Ie9b4e03fb286e5a0040374d00b7b26f810426278
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-02-24 11:55:45 +00:00
Ulf Hermann
65e22d5a0a QmlProfiler: Drop some dead code
Change-Id: I3eead26da7048ecc839edcc946c677da8a7134be
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-02-22 10:17:02 +00:00
Ulf Hermann
39459f98e8 QmlProfiler: Optimize flame graph model
foreach() is slow in hot loops like these. Also, by moving frequently
used children to the front we reduce the effort to find them in
further iterations.

Change-Id: Ib5dceb82511fdd1cb59c50e1ab2485f5035fbef8
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
2017-02-21 15:16:18 +00:00
Orgad Shaneh
c01d7a7540 Merge remote-tracking branch 'origin/4.1'
Change-Id: Ieaddc6093d10c08a54acb9b57cbbfe022bc3c038
2016-09-22 11:01:16 +03:00
Ulf Hermann
fbb45e5a57 QmlProfiler: Keep Compiling events separate in flame graph
The QML compiler can run asynchronously and produce ranges that don't
match up with other QML/JS ranges. The flame graph model assumes that
all ranges are perfectly nested, and produces incorrect data if they
aren't. The compile ranges are perfectly nested among themselves, and
the other QML/JS ranges are also perfectly nested among themselves, so
we can fix this by keeping separate stacks for them.

Change-Id: If4ea251c6a2e74bd04e142cf184937600ea31a87
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2016-09-14 08:34:47 +00:00
Ulf Hermann
61a5f3b3ae QmlProfiler: Add memory and allocations modes to flame graph view
Change-Id: Ic548812378cad92d931e3fa645e11f83a861e00c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-20 11:11:36 +00:00
Tim Jenssen
c13f2f0784 init roleNames only one time
Change-Id: I61e120c2e5c4a036c001b410331e09993d7594d6
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-06-20 08:49:33 +00:00
Ulf Hermann
e10bc709bc QmlProfiler: Provide a sane ctor for QmlEventType and use it
... in turn, make its members private, so that we don't accidentally
change them.

Change-Id: Ibc65b406ee341d33f69647ed1b19e1e34f5cd535
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-06-10 12:43:05 +00:00
Ulf Hermann
472745fb2e QmlProfiler: Make members of QmlEventLocation private
You should not change them independently as that is error-prone.

Change-Id: I07890a29b045492fe804b9537094dea763bc1b8d
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-06-10 09:02:37 +00:00
Ulf Hermann
09b1fe3f20 QmlProfiler: Drop some unreachable code
The model manager will make sure that the flame graph model doesn't get
any events it doesn't accept.

Change-Id: Ibe6e06c558d138cebe6be5dbc76e8f51e9e1fd95
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-06-01 09:20:46 +00:00
Ulf Hermann
4436a1c7f2 QmlProfiler: Add some more consistency to flame graph model
model.parent(someFirstLevelItem) should return the invisible root item.
Methods with default parameter in the base class should also have a
default parameter in the derived class. As rowCount() is Q_INVOKABLE
columnCount() should also be.

Change-Id: I62a0ec6f91d01581fd47a43c97af63c58cdd13fa
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-06-01 09:20:34 +00:00
Ulf Hermann
4a1e5a637a 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>
2016-05-23 12:31:44 +00:00
Ulf Hermann
dd87df7e5d QmlProfiler: Load data event by event in aggregated models
This paves the way for driving the event loading from the model
manager. Also, unify the loading and eliminate the two different
classes for the children models.

Change-Id: Ic89e757963292d75b3b6fd7d6012f09194dff5a9
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-05-23 12:31:28 +00:00
Ulf Hermann
1e8996b438 QmlProfiler: Methods for dispatching events by feature
When announcing features models have to provide functions that handle
events for those features now. The model manager gets a function to
dispatch events to the models that subscribe to them.

Change-Id: I3fd80443a68ba264a513d8d53ed473cf072f1dc7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-05-23 12:30:09 +00:00
Ulf Hermann
1093be0425 QmlProfiler: Remove detailed progress tracking
The progress bar in the state widget was rather meaningless. We rarely
know how many events we expect and it's rather hard to tell how long
each model will take to process them. Instead, we just show a 0-ranged
progress bar to tell the user that "something is happening".

Change-Id: Icb80840d1f0a1538bcf254faa37cbb36e25d342c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-05-23 11:44:13 +00:00
Ulf Hermann
215c0533d2 QmlProfiler: Rename QmlEvent::startTime to "timestamp"
As many events are instantaneous and we're going to drop the duration
property soon, this is more fitting.

Change-Id: I6e13dd076a5b9df16aed44bf9f631ea5760e9cbf
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2016-05-06 10:36:40 +00:00
Ulf Hermann
a53780924d QmlProfiler: Apply some code cosmetics
Change-Id: I772713aec3a6c25136174b39b853a9ef3ee42a0b
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2016-05-06 10:27:09 +00:00
Ulf Hermann
a955537132 QmlProfiler: Fix the naming scheme for events and event types
Move them out of the QmlProfilerDataModel class, drop the "Data"
suffix, and rename symbols that refer to them in order to call them by
their names.

Change-Id: I41151359921b325edb79111371083c4185bd148b
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2016-05-04 09:49:32 +00:00
Ulf Hermann
e5a38bacc4 Move QmlProfiler specific files from qmldebug to qmlprofiler
These file were not used anywhere else and had no business to be in
qmldebug to begin with. Moving them allows us to drop a number of
namespace qualifications and forces us to rename a few local symbols
in other classes in order to avoid name clashes.

Change-Id: I658ed455eec027cbaddacf2980d2ea6827ae6205
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-05-03 15:00:50 +00:00
Ulf Hermann
09908655e1 QmlProfiler: Remove acceptedEventTypes property from flame graph model
It is unused.

Change-Id: I4c2cb02f21ca564d5b783c46b6cce7c4ac8223e5
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-04-29 13:03:47 +00:00
Ulf Hermann
600e1cdcea Merge QmlProfiler and QmlProfilerExtension plugins
Change-Id: Iaa1de7afda664a7a0779f47d104f863a16a34976
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-04-26 14:10:17 +00:00