Commit Graph

96 Commits

Author SHA1 Message Date
hjk
232fb7a425 QmlProfiler: Split server url passing from custom startup request
Orthogonal concepts, that only happen to coincide.

Also, make the server directly settable instead of relying
on the runControl's connection().

Change-Id: I2472acafcc50aede2cb6f99421901f0e67531b91
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-06-16 12:55:21 +00:00
hjk
25a75d3fa3 Debugger, QmlProfiler et al: Replace AnalyzerStartParameter
... and QmlProfilerRunner::Configuaration by PE::UrlConnection,
and call it 'serverUrl' on the user side.

That's the only variant we ever had and avoids "translations"
between three structures that are essential the same.

Change-Id: I33386b2b8d2a7985ff934f6f8f840de0831bf9c1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-06-16 12:19:16 +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
6a2e11940f QmlProfiler: Start connection timer before connection
The QmlDebugConnection might immediately signal a connection failure
on connectToHost() or startLocalServer(). If the timer is not running
then, we trigger the QTC_ASSERT in qmlDebugConnectionFailed(), which is
meant to make sure that we don't silently give up. In this case, we
haven't even given up, yet, as the timer is in fact started afterwards.

Change-Id: Ia2c107d9b511092eaf32380203a3b4628139d320
Reviewed-by: hjk <hjk@qt.io>
2016-09-07 08:26:39 +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
67b176b76f QmlProfiler: Avoid crash on dtor of client manager
Change-Id: Ie4b625a9ae871d56b9d0b59560bfdf6912323b81
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-07-25 12:21:47 +00:00
Christian Stenger
97a465ae18 QmlProfiler: Fix compile with Qt5.6
Change-Id: I4394530321db3a2081d49b4e243b37c1840c2227
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-07-20 08:51:13 +00:00
Ulf Hermann
62b1217818 QmlProfiler: Add some sanity to the client manager
Remove the PIMPL pattern, use smart pointers, add asserts for
important preconditions, add a timeout also to the local server case,
make sure all signal/slot connections to the old connection objects are
cleared when retrying to connect, make retry intervals configurable.

Change-Id: Ica7df0eaddc48778f13905795871d522401617ed
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2016-07-20 08:17:54 +00:00
Ulf Hermann
ba9825625d QmlDebug: Decouple log messages from connection failures
A socket error is not the only possible reason for a connection failure
and exposing socket error codes to the upper layers is unnecessary.

Change-Id: I27e9f21160ecea5b0d811b83b7ab0ab9071cacff
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2016-07-18 12:01:12 +00:00
Ulf Hermann
1cc8cd7f02 QmlProfiler: Move connection failure message to QmlProfilerTool
and show it on any kind of connection failure, not only on timeout.

Change-Id: I6b9c44cd3455d5dd383a552f9b422d3d236b67c4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2016-07-15 09:22:45 +00:00
Ulf Hermann
48395b0e43 QmlProfiler: Rename registerProfilerStateManager()
... to follow the convention for setters.

Change-Id: Id471a93a1be1beed0438fed710fa09afa5ee2832
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2016-07-13 13:58:55 +00:00
Ulf Hermann
80e6bf1ef5 QmlProfiler: Terminate waiting processes when Complete arrives
Previously, in AppStopRequested state we would wait until we are done
processing the data. This is problematic as when aggregating traces
this doesn't happen spontaneously. If we've explicitly asked the
process to terminate it's safe to do so after receiving Complete as
we won't need any more data after this.

Change-Id: I64111ce6039ffc7f6815425c6b7e4432ac528c86
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-07-05 08:08:09 +00:00
Ulf Hermann
bcbfd93ee7 QmlProfiler: Remove QmlProfilerPlugin::debugOutput
I doubt that anyone has ever used it.

Change-Id: Icf8c6513f5cdd10a9aa790e7373df9eba7c12ef2
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-06-06 14:51:46 +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
5ee38fda5b QmlProfiler: Remove duplicate method
Change-Id: Iad8420e5836ad8bc3efc9ecf67bf85b005ede7d5
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-05-24 07:44:03 +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
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
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
ee8bf341c6 Merge remote-tracking branch 'origin/4.0'
Conflicts:
	src/plugins/projectexplorer/session.cpp
	src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp

Change-Id: I6946139f5e5fa3a9cdbb322fd50be248e2c0133f
2016-04-20 14:58:48 +02:00
Ulf Hermann
385237dbbd Use Utils::Port where possible
This solves the ambiguity between 0 and -1 being the "invalid" port.

Change-Id: I3bac11dd4117bb1820fbd58186699925b73df1c5
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-04-20 11:06:34 +00:00
Ulf Hermann
f0b7a73f33 QmlProfiler: Properly clear any pending connections before reconnecting
Otherwise we might end up waiting forever for a previous session's
connection.

Change-Id: I695d7a1ce21bc9720cc84436a7c4e6ba4616b0ab
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2016-04-15 14:39:12 +00:00
Eike Ziller
f4e87a7e0c Merge remote-tracking branch 'origin/3.6' into 4.0
Conflicts:
	src/plugins/projectexplorer/applicationlauncher.cpp
	src/plugins/projectexplorer/applicationlauncher.h
	src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp
	src/plugins/qmlprofiler/qmlprofilertool.cpp
	src/plugins/qtsupport/uicodemodelsupport.cpp
	src/plugins/qtsupport/uicodemodelsupport.h

Change-Id: I6f6ae77422d99f4f422b108ade6b64273df9dd57
2016-03-03 16:10:04 +01:00
Ulf Hermann
09c4ae8ed5 QmlProfiler: Limit hard resetting of QML debug connection
On windows it can take a long time to establish the connection. On OSX
we want to throw away the first connection after trying for 200ms. We
don't want to introduce #ifdefs here, so after throwing away two
connections stick to the third one.

Change-Id: I407120244747ac39429786e371c93a7d1e29933d
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-03-01 12:04:40 +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
Ulf Hermann
a841dcebfc QmlProfiler: Deobfuscate connection mechanism
Whenever we create the connection we as well try connectToHost()
immediately instead of deferring it until the next timeout. The
else branch in tryToConnect() would never be executed because if
the connection is there and not connecting or connected, then
the socketState must be != ConnectedState.

Change-Id: I6736b35348671961fbb3a48edb5e9c6c1d7ce915
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-12-02 09:24:34 +00:00
Ulf Hermann
ff1e2150e4 QmlProfiler: Fix bogus disconnect() calls
Change-Id: I8caa5a2a45682e7472b9ebac9050c1a9a2a6f932
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-11-27 16:25:57 +00:00
Eike Ziller
9099a37d4b Fix merge issue
Change-Id: I414a72ba77ea5218711fb9a8b0d3d160670a93d2
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2015-11-26 12:22:04 +00:00
Eike Ziller
fa227a4eef Merge remote-tracking branch 'origin/3.6'
Conflicts:
	src/libs/qmldebug/qmldebugclient.cpp
	src/libs/qmldebug/qmldebugclient.h
	src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp

Change-Id: I9594b4e9befc78f8138deb121f0bfc4212f7edbf
2015-11-26 13:01:20 +01:00
Ulf Hermann
35ed93fe2d QmlProfiler: replace TCP connections after 200ms of failing to connect
Sometimes it takes very long to establish a TCP connection to the debug
server. If the connection hasn't been established after 200ms we
probably don't want to wait for it any longer. If, however, the TCP
connection is there and the "hello" hasn't arrived yet, we keep the
connection in order not to trigger an unexpected state in the
application.

Change-Id: I1a64493fefc759f526cdebff434a2557077f9246
Task-number: QTCREATORBUG-15383
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-26 11:40:51 +00:00
Ulf Hermann
e3c16259ed QmlProfiler: When showing connection error, cancel any connects
The device can exist without being open, which makes the disconnect()
when the message box finishes ineffective. Also, disconnect() merely
trashes the signals and slots, but doesn't remove the device.

Task-number: QTCREATORBUG-15383
Change-Id: I8eb8ca3db496c9841156c0949c3e3bfd92329056
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-26 10:36:55 +00:00
Ulf Hermann
ffc11d5e9e QmlProfiler: allow for multiple sequential traces to be aggregated
Task-number: QTCREATORBUG-13317
Change-Id: Ic7d1d5c94d8d522741b6c4207a21a43f521da5fb
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-11-19 12:16:44 +00:00
Ulf Hermann
030acfdf73 QmlProfiler: Send the client recording state to new engines
Otherwise some engine can stop recording by sending a "Complete" event
and that will be the state we send to any new engines, although the
recording button was checked when the recording started.

Also, don't redirect state changes and the associated recording state
sending through a signal and slot. This allows us to remove the
"enabled" property of QmlProfilerTraceClient and adapt the signature
of sendRecordingStatus() to facilitate the redirection of newEngine()
through the client manager.

Task-number: QTCREATORBUG-13317
Change-Id: Ie9dc6785eb761514bc96aaf5724f7b23d3c2932e
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-11-19 12:16:41 +00:00
Ulf Hermann
d7f6dec98e QmlProfiler: Use correct coding style and remove dead code
Change-Id: I10967ee080076d40cf54aaf4ae28c63d78b7f216
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-11-19 12:16:38 +00:00
Ulf Hermann
d58b714a3a QmlProfiler: Debug messages are no QML events ...
In particular, they can also occur if we're not AcquiringData.

Change-Id: Ia310206ee15973fc5b2fa1c607d7c9a48b6f435f
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-11-19 12:16:35 +00:00
Ulf Hermann
7b4e253a1e QmlProfiler: Support local connections on Qt >= 5.6
This removes the need to receive messages from the application via
stderr. The "Connecting to socket" is still parsed, but only for
diagnostic purposes. If it doesn't arrive, the profiling will still
work.

Change-Id: I022691293da2a1e671ba1263bc76e4044bf1a5b7
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-11-19 11:33:20 +00:00
Ulf Hermann
81eea72d44 QmlDebug: Simplify error and state signaling
There is no point in sending two signals for every state change and
error. Also, the signals only reflect events in the socket, not in the
logical connection.

Change-Id: I617a925c69164aa1a02a7781b9da7dca55daa304
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-11-19 11:32:46 +00:00
Ulf Hermann
47317eff60 QmlDebug: Rename some members of QmlDebugConnection
This is to adopt the naming to the code in src/qmldebug in
qtdeclarative. Once we can require a version of Qt that has qmldebug
for building QtCreator we can then remove our own version of this code.

Change-Id: I573f0703871b5812789c5c7a6287567d5c2875e6
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-11-19 11:32:42 +00:00
Eike Ziller
81e9b96148 Merge remote-tracking branch 'origin/3.6'
Change-Id: Ic7cba72e7bec10e4fc0099b97e3317e391a6aa5d
2015-11-03 13:06:35 +01:00
Ulf Hermann
ccc4fe54e5 QmlProfiler: Delete debug connection on error or if params change
Now that we don't recreate the debug connection anymore when (re)trying
to connect, we have to do it explicitly when changing the connection
parameters or when a connection attempt fails and we need to cancel the
"Connecting" state.

Change-Id: Ib2b6b4fb1e39e64fe3c9f2bf90b6e43043d05a9e
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-11-03 10:44:56 +00:00
Ulf Hermann
b4e6591188 QmlProfiler: Convert connections to Qt5 style
Change-Id: I1a490add706cd0cfce3f243e4ebc32a8c9a975c7
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-11-02 10:12:42 +00:00
Ulf Hermann
ccb6d6131e QmlProfiler: Don't needlessly delete debug connections
If we're already trying to connect when the "Waiting for ..." message
arrives we don't want to start from scratch, but rather reuse the
existing connection.

Otherwise the handshake may be interrupted in an arbitrary state,
either leaving the remote QML engine waiting for the local QML profiler
to send the recording status, or prompting the local profiler client to
stop recording as the connection "broke".

The local QML profiler will only send the recording status if new QML
engines show up, which doesn't happen on the second successful
connection. That may be a different bug.

Change-Id: Ia17fcf9d0a28edf700274bcd88c2b7030220c290
Reviewed-by: Robert Loehning <robert.loehning@theqtcompany.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-10-30 12:47:58 +00:00
Ulf Hermann
05388a7229 QmlProfiler: Simplify application state handling
Only half of the states are useful for anything.

Change-Id: I4591ccda6eec902e929e07947bad6c3f7b967ef9
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-09-15 13:06:40 +00:00
Ulf Hermann
89f1c0bf53 QmlProfiler: Remove some dead code
Change-Id: I2efd48a4dc13cc3996eda994eb4a046c101ad3e9
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-09-11 12:26:53 +00:00
Ulf Hermann
fe2d9e2a3b QmlProfiler: Remove QmlProfilerClientManager::serverRecordingChanged
It doesn't do anything useful. Also the qmlDataReady member is
write-only and can be removed.

Change-Id: I667b05611cfc5960eb2fd73254a7b3c621ae98a3
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-09-11 12:26:49 +00:00
Ulf Hermann
fdbed834fa QmlProfiler: Refactor complete() methods
The complete() methods do something more specific. We should call them
by what they do. Also, we don't need to signal the finishing of data
acquisition via a signal and most of the postprocessing can happen in
the worker thread.

Change-Id: Iae986aefb8e7e7d4327c481d7a85325bbff7fa48
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-09-11 12:26:45 +00:00
Ulf Hermann
408ac55741 QmlProfiler: Remove OST connection mode
Whatever that is, it definitely didn't work.

Change-Id: Ib15b9dcad6e22d52285a253b234989e55d817268
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-09-10 13:10:30 +00:00
Ulf Hermann
f1ede40500 QmlProfiler: Expose flush interval to user
Flushing data while the application is running can distort the results
because the flushing itself takes time. However, not flushing leads to
longer load times in the end and higher memory usage. The best strategy
depends on the application being analyzed and the users should decide
if they want to flush or not.

The settings infrastructure also paves the way for preserviing the
layout of the timeline and statistics views as well as the category
filters across sessions.

Change-Id: I2cdc37c7fc7eb9b05b6870955ddffaa712d6c956
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-08-31 09:19:32 +00:00
Ulf Hermann
054f03e165 QmlProfiler: Track requested, recorded, and displayed features
This way we can have a central filter menu to hide and show features
in any connected views.

Change-Id: I8142da0062a23f8166555016de6c7cb38060f725
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-07-08 13:59:49 +00:00
Eike Ziller
37a13732bc Merge remote-tracking branch 'origin/3.5' 2015-07-08 14:32:13 +02:00
Ulf Hermann
45b5f7341e QmlProfiler: Don't try to disconnect connections that don't exist
Change-Id: Ic87b3808a9d6aae12dfa6fe8664a4669d56fe37d
Task-number: QTCREATORBUG-14698
Reviewed-by: Robert Loehning <robert.loehning@theqtcompany.com>
2015-07-07 14:22:15 +00:00