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>
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>
This allows us to share code between the two, in particular the QML code
for the Details window, and the theme code. This way we can potentially
deduplicate some code.
Change-Id: I3a0d26b18488bd2a46b5b077b5b5d79ac2dfc5ce
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This is redundant, now that we have registerFeatures().
Change-Id: Ia56c28b8892ab6da694570fe4b9ea5c96fe194f1
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Some compilers cannot discern the two replayEvents methods.
Change-Id: Ide4a893ff3976cb081fbbceefacafb6226f0a73f
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
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>
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>
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>
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>
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>
The statistics have one extra valid event type: "Main Program". This
should not be mapped to typeId -1, as -1 is the invalid typeId. Map it
instead to std::numeric_limits<int>::max() and remove all the hacks
around it.
Additionally, optimize the selection algorithm for the statistics main
view: We don't need to iterate all types to select one. We can rather
use the fact that the row numbers in the source model match the type
indices (except for the two special ones).
Change-Id: I7c4dc4f84fd167f9a21c418466ad2bfce56e441f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This resolves the data duplication between model manager and statistics
models, that gets in the way of updating the details strings on the fly.
Task-number: QTCREATORBUG-20106
Change-Id: I1c4881f903402dff936267de03b84d05ab7c39ca
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This way we will be able to replace the QStandardItemModels in a next
step.
Change-Id: I863fde958d29c8bf8c36aa1f501cb1224720ad7a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
dataChanged() was too generic and easily confused with other methods.
Change-Id: I68b8bcb609599e56a1a2d3c6cf53d878281f7818
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
We don't need to retain the durations after finalize(), and we can use
vectors instead of hashes, as we will cover almost all types anyway.
Vectors allow us to potentially use the position of an item in the data
as its row.
Change-Id: I2c09406f0e0a42f5f517f8444755b1664efb8f3b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
gcc 4.9 and msvc 2015 choke when creating those from initializer lists.
Change-Id: I85936fe33418d5d9ffeb3c910392ad43fbb9a9bb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This allows us to tighten up the public interface of the model.
Change-Id: Iaa0363993de7cd94c3468d2c939198e65746e829
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
When talking about call stacks call them "caller" and "callee". Call
the invisible root item of the model "rootItem".
Change-Id: I551b23f1491d391145193901d3f3a29ab3942089
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
They aren't part of any public API and the pimpl pattern just gets in
the way here.
Also, initialize members inline where possible, remove redundant
deletes, prefer explicit ownership over parenting, and use
std::unique_ptr for owned objects and QPointer for non-owned QObjects.
Change-Id: Ibe1e1f88d0e38b6ca26544fccb1db6b809d1556b
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
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>
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>
If we cannot open a temporary file to cache a trace or retrieve a
previously cached trace, the QML profiler won't work correctly. Show
an error in this case.
Change-Id: I468d74d9c33033b9ad19501bccbd69a9fe164fed
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
The total time taken for a program should be the sum of durations of
events on the bottom of the stack. This is also what the flame graph
model does, and it results in useful percentages for total and self
times.
Recursion still has to be accounted for when showing the total time of
a specific event type, but we mark events with recursive calls and
show the time and percentage of recursion in the tooltip. As we already
showed binding loops on bindings and signal handlers before, this
integrates nicely.
Change-Id: Id4654e314bf86ce8bd06ceaaf93a67187c629adc
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
There is no need to keep empty events at the bottom.
Change-Id: I072b50329a9f277005cbfa45350c060abd7e7a36
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
The QML compiler can run asynchronously and produce ranges that don't
match up with other QML/JS ranges. The statistics 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 statistics for them.
Also, choose a less insane data structure for the relatives model.
Change-Id: I146593b67586e7b5aba6b19d360961c142511289
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
... 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>
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 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>
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>
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>
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>
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>
We never use the q pointer and we only show notes in the main model.
Change-Id: I635a97f8d878ba12b9ae55e2b758d1651d5e3aae
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
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>
It is only used for the statistics view.
Change-Id: I71027dd864715b4a2f95c2b11af0c0d83c514229
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>