Commit Graph

100 Commits

Author SHA1 Message Date
Ulf Hermann
507c2d6b5b Move parts of QmlEvent and QmlEventType to timeline
Timeline will become a generic trace handling library. It needs some
abstract concept of events and event types.

Move operator== and operator!= for QmlEvent into the test as we don't
use them anywhere else.

Move the operators for QmlEventType to QmlProfilerTraceClient. We want
to get rid of the hash there as soon as we can assume that no
application we want to profile doesn't support server type IDs.

Change-Id: Icde4e3e7634e387171dc1d8bef7bbe8e71684a1a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-17 12:15:38 +00:00
Ulf Hermann
e0ba6f91ce Timeline: Add stash() and restore() methods to notes model
Those are needed when manipulating the model in a way that may change
the indices, like restricting to a range or filtering by categories.

Change-Id: I9f218d269cf23104c306960ef77c0fc41591daa1
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-17 09:14:09 +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
Marco Benelli
b9d72a5737 qmljs: remove remaining references to QtQuick1
This patch removes all references to QtQuick1 in qml library,
plugin, designer, profiler and tests.

Change-Id: Ie286fad96060299caae3ef328330597cf53e90d3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-04-03 14:40:30 +00:00
Eike Ziller
cff2cc90e2 Merge remote-tracking branch 'origin/4.5'
Conflicts:
	src/plugins/cpptools/clangcompileroptionsbuilder.cpp
	src/plugins/cpptools/clangcompileroptionsbuilder.h
	src/plugins/cpptools/compileroptionsbuilder.cpp
	src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp
	src/plugins/qmlprofiler/qmlprofilerclientmanager.h
	src/plugins/qmlprofiler/qmlprofilertraceclient.cpp
	src/plugins/qmlprofiler/qmlprofilertraceclient.h
	src/shared/qbs

Change-Id: I364ababc5d41046d17e999096c4a7187c4e4e010
2018-01-09 13:13:00 +01:00
Ulf Hermann
4a5bd323a9 QmlProfiler: Retain event types between sessions on same connection
The server won't re-send the event types. We need to keep them until the
connection goes away. Otherwise we get invalid event types and soft
asserts when trying to look up event types for new events. Also, when
clearing the event types, also clear the server type IDs. Not clearing
those constitutes a memory leak.

Change-Id: I564b0c4cf0ed754549d2b8ede63c97fa01affcec
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-01-03 13:51:47 +00:00
Ulf Hermann
38d00cc8b6 QmlProfiler: Use a Target for populateFileFinder()
The RunConfiguration we were using previously only served to retrieve a
target.

Change-Id: I30628197de3025511a03a53d3119083b980762c8
Reviewed-by: hjk <hjk@qt.io>
2017-09-27 14:22:49 +00:00
Ulf Hermann
9cdb0ec22e QmlProfiler: Don't trust in externally provided timestamps
We might get timestamps that are outside the trace time, negative
timestamps, ranges that go backwards, and other insane things.

In order to deal with this, we clamp all negative timestamps to 0, and
treat the specified trace time as minimum range, that can be overridden
by events.

Change-Id: Iba661f2a4346077871fc62a46759e169b2aad49d
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
2017-09-12 14:25:01 +00:00
Ulf Hermann
47886969cc Drop unused variables and lambda captures
Also, add context to connect() expressions where we are or were
capturing "this".

Change-Id: I6e006ba6f83d532478018550d148ee93eca59605
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2017-09-08 09:06:53 +00:00
Ulf Hermann
6a626595dc QmlProfiler: Rename QmlProfilerDetailsRewriter::clearRequests to clear
It also clears the lookup cache.

Change-Id: I9fdd9136084a17f427336d6ce2d37d724b9b20d2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-08-15 13:37:59 +00:00
hjk
76185b3b09 QmlProfiler: Convert to a RunWorker based setup
This also re-enables the remote linux case and enables
the recording of a single run of events.

Change-Id: I9ea55017c8e5f2f17e6f32c5453df48093e41931
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-30 08:57:08 +00:00
Ulf Hermann
6e5d7e54db QmlProfiler: Use a ranged for loop in QmlProfilerModelManager::dispatch
Change-Id: I852bb4935b529953e677791d32d17c886f22bffd
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
2017-03-31 08:32:30 +00:00
Ulf Hermann
0683281b7b QmlProfiler: Load notes data only after models are available
Change-Id: I1ee13c842a07962d9aec93aaab6959614d7d8a08
Task-number: QTCREATORBUG-17936
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-03-29 15:05:59 +00:00
Orgad Shaneh
da7cb91446 Merge remote-tracking branch 'origin/4.2' into 4.3
Change-Id: I4931dcc81be872d7712e67123e94d15ee696459f
2017-03-14 16:20:14 +02:00
Samuel Gaist
4033471aa9 QRegExp include cleanup
This patch adds the missing include statements for QRegExp.

Change-Id: Ibb03b929940adb84ae190b5090cb6b88653cc14c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-03-13 22:05:30 +00:00
Robert Loehning
e6fd203b76 QmlProfiler: Initialize members inside class
Change-Id: I8154dad0eef9e11650e257b46840c295cf5e0624
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2017-02-28 12:57:20 +00:00
Ulf Hermann
c84f650fb2 QmlProfiler: Integrate QmlProfilerDataModel into model manager
There is no need to keep them separate as the data model is not
accessed from the outside anymore. This removes a lot of indirection.

Change-Id: I91da4dfa816295300c8cfcca22430d5c5b3298c0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-02-24 11:55:53 +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
bf69eb9467 QmlProfiler: Guard against the temporary trace file going away
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>
2017-02-24 11:55:16 +00:00
Ulf Hermann
1ee8d0fb64 QmlProfiler: Improve error and progress handling for loading and saving
* Clear the trace and send the loadingFinished() signal when loading
  fails or is canceled. loadingFinished() re-enables the UI, which is
  in fact important.

* Check more consistently for whether the operation was canceled and
  add a separate signal for that.

* When saving fails or is canceled, remove the half-written file.

* Don't try to guess the number of events for progress reporting when
  saving. Use the event timestamps and start/end time instead.

* Properly initialize the progress range in all cases.

* Drop the bool return value from the load methods. Nobody uses that.

* Send loadFinished() only after loading a file, not every time we
  reach the Done state.

Change-Id: I507f11c667e20534ea335e84798de11aa06fb6f2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2017-02-24 11:55:10 +00:00
Ulf Hermann
548a86f577 QmlProfiler: Add text marks for QML/JS types into documents
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>
2017-02-21 10:43:47 +00:00
Ulf Hermann
827d48db6e QmlProfiler: Move the file finder into the QML model
This is the place where we need it most. In addition, this allows us to
use the DetailsRewriter's cache also on gotoSourceLocation.

Change-Id: I14e0f11ba7c8a2a3888b2e8439a375068b36e29a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2017-02-15 12:38:30 +00:00
Ulf Hermann
5dd25c42cb QmlProfiler: Move event handling into model manager
This is the logical place to do it. Adding the event first to the QML
model and then passing it back to the manager in order to have it
dispatched to the other models is somewhat backwards.

Change-Id: I64b1cb38f97331b62d83fa5ae49b9b2690810d40
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2017-02-15 12:38:21 +00:00
Ulf Hermann
aaca50f705 QmlProfiler: Send loaded events in batches of about 1024
This significantly reduces the number of signals necessary when
loading traces. The overhead of queueing those signals across threads
was responsible for up to 80% of the time required to load a trace.

Change-Id: I461a2ef9944b0be102a29f8ed6b2b3f2f59f3c0f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2016-11-09 11:54:57 +00:00
Ulf Hermann
e07b495b70 QmlProfiler: Don't delete QObjects from outside their home thread
We cannot do this because the parent object needs to be notified.

Change-Id: Id70de2acea4aa241ea0e85b5b02327e1f91b7e68
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-10-26 10:56:23 +00:00
Ulf Hermann
5d6f5ff2c9 QmlProfiler: Move unrelated code out of QmlProfilerClientManager
The client manager should not be bothered with details of QML events,
but rather just connect the client, the model manager, and the state
manager.

Change-Id: Iec4499f8441a06d4ef5cbcf7bfe23da6f5e7f239
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-08-05 10:44:46 +00:00
Ulf Hermann
c08862688a QmlProfiler: Avoid reloading notes twice on range restriction
We need to clear them before we restrict as otherwise the other models
will end up with invalid notes. Doing that by calling loadData() is
inefficient as we need to call the same method again after finalizing,
because the timeline models may have changed.

Change-Id: I4cd6e13bfb73804aab8f1cfee6db4069a7b808cd
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-07-06 10:26:17 +00:00
Ulf Hermann
d12c8806ac QmlProfiler: Add extra metadata to notes
This way we can improve the heuristic used for mapping notes to
timeline events, by taking the row into account. Also, by marking
notes as loaded when loading them we avoid accidentally dropping
them by restricting to ranges.

Change-Id: I031389880571805788c910728ee89333a5cd4727
Task-number: QTCREATORBUG-16542
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-07-06 10:26:12 +00:00
Ulf Hermann
561841b93b QmlProfiler: Use current restriction range when saving notes
We don't want to clear notes outside the current restriction as those
are still valid and need to be available for later reloading.

Change-Id: If3e75ff2b2ab9a93578c5ca63f1b4a2f539dc802
Task-number: QTCREATORBUG-16542
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-07-06 06:28:02 +00:00
Ulf Hermann
3684585839 QmlProfiler: clear model manager only after saving the notes
The notes model wants to resolve IDs from timeline models when saving.

Change-Id: I02c6038c8519101f36db95183bfa05d01a531b97
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-06-03 08:44:18 +00:00
Ulf Hermann
0cd9e81378 QmlProfiler: Fix compile warning about implicit conversion to 64 bits
Change-Id: Ia3f24f3b29c3ea4a9322ca21767bb5231b2ca2eb
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-05-26 08:39:28 +00:00
Ulf Hermann
ebd6d269c2 QmlProfiler: Directly pass events from client to model
Running them through the model manager via signals doesn't make much
sense anymore.

Change-Id: I6103d281dd640493f28acd7e787ea49712ebd8df
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-05-25 13:52:33 +00:00
Ulf Hermann
c39ed2a3b7 QmlProfiler: Make progress widget more expressive
Instead of the progress bar we can now show the number of events we
have received, and the number of finished finalizers. This should give
a the user a better idea of what is going on.

Change-Id: I324fefbe6d5e3c24b080bfbc103c4317fa585215
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-05-23 14:39:24 +00:00
Ulf Hermann
ecd8e764dd QmlProfiler: Add a binary trace format
Storing traces in binary form is preferable as loading and saving is
faster and the trace files are smaller.

Change-Id: Ia7340ac526d5ce9391b1e32fc48fc1fab3ffa13d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-05-23 12:32:10 +00:00
Ulf Hermann
d6d69b811a QmlProfiler: Rename QmlProfilerDataModel::addEvent()
We will get another variant, without type.

Change-Id: I06bd47955ef909b2f467425bb9ad8c8b3e3dce27
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-05-23 12:32:06 +00:00
Ulf Hermann
0f513bc91e QmlProfiler: Use a temporary file to store the master event list
As we only ever iterate the master event list in a linear fashion, we
can use a temporary file to store it. This should allow for larger
traces to be handled without running out of memory.

Change-Id: I0d2aea6f998458fe5f426f6fef0f6937e915ae68
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-05-23 12:32:01 +00:00
Ulf Hermann
914e1e1fe1 QmlProfiler: Use data replay feature for saving traces
This removes the last access to the master event list, which allows
us to also remove the accessor function.

Change-Id: I0e70c2eb23d2b11aa8b131c03eb3adfad1a9b9e7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-05-23 12:31:51 +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
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
71e8c3ffd7 QmlProfiler: Reset the zoom control only when we're finished loading
Drop the timeChanged signal of QmlProfilerTraceTime, too, as that
doesn't serve a purpose anymore. We don't want intermittent changes
of the trace time to be reflected in the UI when loading.

Change-Id: I85f18b90fc404ec254c68625104d3e3f9077a1d9
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-05-10 12:33:25 +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
54b1106f4b QmlProfiler: Move notes into the notes model
There is not reason to keep them in the general data model and cross
reference between the models all the time.

Change-Id: Ic77c518928dcd6234555cb3f6a830bcc3dc4a1a4
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2016-05-06 10:26:13 +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
Eike Ziller
72af6b7834 runAsync: Remove ResultType template parameter.
It is now deduced from either the type of the
QFutureInterface<ResultType> function argument, or the return type.

Change-Id: Iddab3cc329206c649a6e55a44b2de2d406701dee
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-10 10:58:55 +00:00
Ulf Hermann
21d1f6161e QmlProfiler: Avoid race conditions when loading or saving data
We cannot assume that the model manager is still available when the
operation finishes. Also, accessing the QML model or the trace time
from the thread is dangerous.

Change-Id: I673c57c09490a0e3e2647f3197929eff1ce4ceb3
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-02-09 09:53:45 +00:00
Eike Ziller
e307b7eecf QmlProfiler: Avoid QtConcurrent
QtConcurrent runs everything on a global thread pool, which means that
calls of QtConcurrent::run/map/etc can block each other.

Change-Id: Ia7a61b5ae1e0919113205a83a43caa1f27015732
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2016-02-08 15:36:11 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
Eike Ziller
3f63635053 Merge remote-tracking branch 'origin/3.6'
Conflicts:
    src/libs/3rdparty/modeling/qmt/model_widgets_ui/classmembersedit.cpp
    src/plugins/git/gitplugin.cpp

Change-Id: I78a21510d484b655e01141a3543e08ee2123f9cd
2015-11-23 14:25:38 +01:00