Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...
While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only
Change was done by running
find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;
Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Setting the data on a non-supported MIME data will fail
and get deleted.
Checking beforehand gets rid of a warning printed by
QClipboard.
Change-Id: I5b5a371ce5b904f61a1aed5ea21a98908155357b
Reviewed-by: hjk <hjk@qt.io>
When selecting an item that has no equivalent in the statistics view, we
should just clear the statistics view's selection.
Fixes: QTCREATORBUG-22262
Change-Id: Id43a46859ab33285fdfb1beafe7137e1bbb3b362
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
The sorted model's rows are not equivalent to typeIDs.
Change-Id: I88868e192079f61bd1d336dac98142fd415d9a4a
Task-number: QTCREATORBUG-20501
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>
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>
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>
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>
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>
None of the fields are ever unavailable, and they are always shown in
the same order, so we can just use the enums directly instead of a
mapping and an extra whitelist. This enables us to also drop some magic
numbers. In addition, none of the items have children. So we don't need
to expand or collapse them.
Change-Id: Ibf3d1933d1fb703f5d8e74ae5043c3d1db462738
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
The statistics view is not called "events" anymore.
Task-number: QTCREATORBUG-19658
Change-Id: Iff4375d3dc0cf5d82d118244698887818f924c07
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Otherwise the percentages and totals don't match. The extra recursive
time is shown in the tooltip, without percentage (as there wouldn't be a
sensible base value for a percentage number).
Change-Id: I47fcf92aac3f60554219f7da9dd2ac90061ce496
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
In pathological cases we might get event types without any calls.
Change-Id: Id5c9f02c95b60fe49a7cbbac511c3727ade71db0
Task-number: QTCREATORBUG-17885
Reviewed-by: hjk <hjk@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>
The text marks are little labels next to the lines in the editor
that tell you how much of total run time was spent in the
respective QML/JS construct during the last profiling session.
This is similar to what the valgrind profiler does.
We add the text marks only when the documents are loaded into an
editor. This keeps the number of text marks manageable. Multiple
events on a single line are shown using a tooltip.
Task-number: QTCREATORBUG-17757
Change-Id: Ie38b8ab880a718a1ef72ef343d84070ab34bc5bc
Reviewed-by: hjk <hjk@qt.io>
They should bei in line with how we call the event types in other
places.
Change-Id: Id6a5a42bdf745d6827deeca713a0e78c5fae4783
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
We should use it for all time printing instead of duplicating the code
everywhere.
Change-Id: I530baa31fd7044aefce6201fec0ab27c99a61a1d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
As there are only two events views we can handle them separately rather
than keeping them in a list. Also, the object names and dock IDs should
match. This breaks the settings, but that shouldn't be a big problem.
Change-Id: Iac46fd7976d1e747fef4b40cead9a54e830d188f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Enforce the presence of a sort role for all items and make sure we
don't call column() during sorting. column() can be very expensive on
large models.
Change-Id: I89555072d8ef051d6e0b4f9819159238a1a40859
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Fix some misnomers and remove an unused declaration.
Change-Id: Ia5e30ccc7c465a10c5214b7fe025aa0f578cdab4
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
... 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>
You should not change them independently as that is error-prone.
Change-Id: I07890a29b045492fe804b9537094dea763bc1b8d
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>
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>
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>
Range restrictions don't persist across profiling sessions, in contrast
to feature selections.
Change-Id: If98a8dae7eed3019e68e361ea69689658241d39d
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This removes the need to pass the QmlProfilerTool instance to all views.
QmlProfilerTool is exported so that we can access the common actions
from plugins.
Change-Id: Ie7072c23ef35763b729f4b87acce47ecbdb76e43
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
You don't see the range you are limiting to in the statistics view, so
I doubt that anyone has ever understood what this does.
Change-Id: Ic9da3c1ac067f76d239a931d316a69a3999884a4
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>