Commit Graph

353 Commits

Author SHA1 Message Date
Ulf Hermann
27907bc417 QmlProfiler: When retrying to connect, double the timeout
If you are retrying, then probably you want it to be more patient this
time. Also, tell the user how long we have waited and how long we are
going to wait when retrying.

In turn, reduce the number of "internal" retries. Retrying 10 times
should be enough to determine if the given timeout is too short. This
will give us an initial waiting time of 2s, and make the second try 4s.

Change-Id: Ibdfe02d041550eb16cadc59cec1b78ce97289b30
Task-number: QTCREATORBUG-20529
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-06-06 12:44:47 +00:00
Ulf Hermann
92530fd05d QmlProfiler: stop trying to connect when the application quits
Change-Id: I3b33ced218320a19fd4e4e834093c0f3b67a8cba
Task-number: QTCREATORBUG-20499
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-06-04 08:28:18 +00:00
Ulf Hermann
7b08624ae7 QmlProfiler: Only consider data as lost if we are recording
If the server stopped recording before breaking the connection, we're
fine.

Change-Id: Ic6d57cd4eb7c831cdd8aca1f305b44b9ecbd10dc
Task-number: QTCREATORBUG-20530
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-05-31 12:01:29 +00:00
Ulf Hermann
7a68196328 Tracing: Don't change visible features on clearing and replaying
This used to be important for the mockup in the Timeline, but as the
mockup looks just fine with all available features visible, we can drop
it. As TimelineModel::clear() clears the "hidden" flag, we have to
restore that one on initialize(), though.

As a side effect the visibility settings are retained across profiling
sessions now.

Task-number: QTCREATORBUG-20503
Change-Id: I1512ab7e494ed79d20e2097d68f8494990cfecbb
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-31 07:12:04 +00:00
Ulf Hermann
5e66f834e3 QmlProfiler: Keep text marks when replaying events
The text marks are conceptually part of the type storage, not the event
storage. We need to hide them on initialize and show them again on
finalize, though, so that they get updated.

Task-number: QTCREATORBUG-20506
Change-Id: I5fe50110b99ea81b9a7585758a30fcad98bfcaa3
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-30 07:49:38 +00:00
Ulf Hermann
6b9ff15ad5 QmlProfiler: Move action registration out of QmlProfilerTool
This enables us to have multiple QmlProfilerTool instances without
conflicting action registrations. Ultimately there should be a way to
unregister actions, or to add some extra description on which tool
instance they refer to, but this is a minimal first step.

The main problem this fixes for now is the warnings generated by the
tests.

Change-Id: I2193fc48a5a68c52f46e5567919f3035bc93df36
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-05-29 12:14:58 +00:00
Ulf Hermann
bd659b2b99 QmlProfiler: Clear the model manager before deleting it
We cannot have the model manager clear itself from the dtor, as the
order of deletion between the various other objects parented to the tool
is undefined. Make sure we get into a clean state before the model
manager disappears.

This fixes the soft asserts when the tests shut down.

Change-Id: I8fcd52a7c2d0703cbdd215d85aa1d80c2e3296a3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-05-28 12:54:39 +00:00
hjk
36b835ff0a Finish merging Runnable and StandardRunnable
As all Runnables are known to be StandardRunnables, this here
essentially replaces all .is<StandardRunnable> by 'true'.
.as<StandardRunnable> by no-op, and fixes the fallout.

Change-Id: I1632f8e164fa0a9dff063df47a9e191fdf7bbb2e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-23 08:48:36 +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
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
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
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
Orgad Shaneh
eea6a7c3b3 Utils: Purge qtcfallthrough.h
No longer needed.

Change-Id: I9b0bee014df89d4c567f1d2431b5ff9404f5f925
Reviewed-by: hjk <hjk@qt.io>
2018-04-09 09:04:13 +00:00
Tobias Hunger
0153c0000f QmlProfiler: Fix warning about unused lambda capture
Change-Id: Ib5abc199f55f3cf57d3db92c50c85ab303a208b9
Reviewed-by: hjk <hjk@qt.io>
2018-03-06 14:19:06 +00:00
hjk
da33f94e20 QmlProfiler: Pimpl QmlProfilerPlugin class a bit more
... to be able to remove an unneeded use of the global object pool.

Plus some code cosmetics.

Change-Id: Ifdb0ff9cd40820a34a8951563402a50a594e4fdd
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-02-19 10:17:36 +00:00
hjk
75e71d5997 QmlProfiler: Remove a few uses of ActionManager::instance()
The used functions are static nowadays.

Change-Id: I1c7ce9765fba111fd3104cf151a519fd89818081
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-02-02 13:18:27 +00:00
Eike Ziller
0837f974da Merge remote-tracking branch 'origin/4.6'
Conflicts:
	qtcreator.pri

Change-Id: I7dcd8e067b7597144eb3b27d917cb7fe0279aad4
2018-01-19 12:05:11 +01:00
Ulf Hermann
5555b7137b QmlProfiler: Defer chained state changes
If the state is changed again from a signal handler before all handlers
for the signal have been processed, we can get confusing results. Defer
those calls.

Change-Id: I73f7b8faa48ee00c17fdedb4140823d7a1b13435
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-01-17 14:27:29 +00:00
Ulf Hermann
f9a3ac7f08 QmlProfiler: Also handle RunControl::finished() signal
If you force-stop an application by closing the output tab, we don't get
a stopped() signal. In order to properly reset the UI we need to handle
the finished() signal then.

Change-Id: Ibab5faf86542a59c3eb3aa139bb3dc66afe89ce2
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-01-17 11:33:16 +00:00
Ulf Hermann
e1ad7a1784 QmlProfiler: Drop static accessors from QmlProfilerTool
It wasn't really a singleton even before. For testing purposes make the
client/state/model managers accessible.

Change-Id: Ie5efbc47a6b9119495f999e4e05877d4789da407
Reviewed-by: hjk <hjk@qt.io>
2018-01-11 14:04:13 +00:00
Ulf Hermann
58ae456f4b QmlProfiler: Verify attached RunControl stops when connection closes
Change-Id: I2b7bd63c4e84fcb0e78318f810ed54e58468d05e
Task-number: QTCREATORBUG-19496
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-01-09 17:02:05 +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
359e4c88c9 QmlProfiler: Stop run control if connection to external app closes
We don't have control over the application's life cycle in this case, so
we need to use the debug connection as indicator.

Change-Id: I3f30194e12c10c6585a58133c5148dbea9e6761f
Task-number: QTCREATORBUG-19496
Reviewed-by: hjk <hjk@qt.io>
2018-01-03 11:54:23 +00:00
Ulf Hermann
0ebdeccb83 QmlProfiler: Set scheme for URL in attach dialog
Change-Id: I2d96753c52f34f5d1b7a1f5de7792de748b3f507
Task-number: QTCREATORBUG-19496
Reviewed-by: hjk <hjk@qt.io>
2018-01-03 11:54:16 +00:00
Ulf Hermann
7d550cd7c4 QmlProfiler: Eliminate some clang warnings
Explicitly check the user-given port for the right range, drop an
unnecessary switch/default clause, and reorder members for better
memory alignment.

Change-Id: I82e9f4353debd6b211d251ecd83fc642a04bdd87
Reviewed-by: hjk <hjk@qt.io>
2017-11-21 14:55:29 +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
hjk
4342eeab33 QmlProfiler: Don't access QmlProfilerTool from QmlProfilerTextMark
Only QmlProfilerViewManager is needed, so use that, as a step to
reduce the interface of the QmlProfilerTool singleton.

Change-Id: I19e55e3b22b3c64ff98b8ea29cbc5164a60ee15d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2017-09-07 09:46:59 +00:00
Ulf Hermann
dc912be7ea QmlProfiler: Properly prepare the file finder on every start
We want to examine the current list of projects, also if we don't have a
specific runConfiguration. Also, after repopulating the file finder, we
need to clear the cache of file mappings, as they might have changed.

Change-Id: I351789fe999009d443ca5ade9b365bfd490e0e23
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-08-15 13:38:31 +00:00
Ulf Hermann
5dbb4f0907 QmlProfiler: Express record button state in a single function
This way we get a concise description of the inputs it reacts to and we
don't have to dereference the pointer in unrelated code, which lead to
crashes on shutdown.

Change-Id: Ieb75ab95cccc0d1f88420b270909c97867a5c3e0
Reviewed-by: hjk <hjk@qt.io>
2017-08-10 14:41:28 +00:00
hjk
a9d2e64517 QmlProfiler: Move TCP connection initialization to runworker's start()
That makes the high level sequence of operation the same as for the
local socket case.

Change-Id: Ib8af2a7826a482e98b75fe00f3c0e672b98886c5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2017-08-10 13:13:57 +00:00
Ulf Hermann
cca625edea QmlProfiler: Connect to timelabel only after it is created
Change-Id: If9e810cfbd5162f1e40db24db2f8f784accaff4e
Task-number: QTCREATORBUG-18597
Reviewed-by: hjk <hjk@qt.io>
2017-08-10 09:38:40 +00:00
Ulf Hermann
e45c6ebe4b QmlProfiler: Stop the recording timer when the time label is destroyed
Writing to the label is all it does, and that crashes if the label is
gone.

Change-Id: I23bbbe0c46603a8de91143ee6167cb404c1b0004
Reviewed-by: hjk <hjk@qt.io>
2017-08-09 14:18:28 +00:00
Christian Kandeler
be2b3c91ae Add Q_FALLTHROUGH for Qt < 5.8
... and make use of it.
With gcc 7, the new option -Wimplicit-fallthrough is introduced and
added to the -Wextra set, triggering dozens of warnings in our sources.
Therefore, we annotate all obviously intended fall-throughs. The ones
that are still left are unclear and need to be checked by the respective
maintainer.

Change-Id: I44ead33cd42a4b41c28ee5fcb5a31db272710bbc
Reviewed-by: Nikita Baryshnikov <nib952051@gmail.com>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-07-17 07:51:23 +00:00
hjk
0a2032e434 ProjectExplorer: Rename RunControl::finished to stopped
That's what it is.

Change-Id: I8cf9af23bb7cafe1cde8f165fdbf85cdeb79f7e4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-07-12 10:06:34 +00:00
hjk
f82bb1ec3a ProjectExplorer: Remove Connection as concept
It turns out that one "Connection" per RunControl doesn't map
well to the uses we have. Instead, RunWorkers need to know
individually how to connect to the place where they can work,
but they are already specific enough to be able to use a
standard class (like QUrl) as their way to specify the needed
entry point.

In theory one could see a RunControl's connection as an
aggregation of its workers connection bits, but that does
not really seem to be needed in code.

As consequence, replace UrlConnection by a plain QUrl, and also
the HostName connection by a QUrl with hostName set.

Change-Id: I40c97e37779314ac0a77041e864a18eadb78f987
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2017-07-07 06:23:52 +00:00
hjk
6e7a31c4fe Debugger: Move startupRunConfiguration to RunConfiguration
It's not really debugger-specific.

Change-Id: I2246e08d896df1d625ecce9b8b5428e7ea398851
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-07-04 06:48:13 +00:00
hjk
629c137ef2 ProjectExplorer: Remove virtual RunControl start/stop trampolin
Not needed anymore, effectively replaced by RunWorker start/stop.

Change-Id: I7483c841cdd4e05c9e1f7636a27b20ece37947c2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-06-30 13:32:34 +00:00
hjk
56028d2e3e QmlProfiler: Cosmetics
Avoid using remote/local as (not user visible) names. 'internal'
means 'whatever the current target does', i.e. could be a remote setup,
'external' means 'attach to something running or waiting.

Also user setServerUrl() directly on the worker, no need go through
the 'opaque connection' mechanism here.

Change-Id: Id0e694562ce7d3129c7d0b790c91d465de24b4e4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-06-20 07:51:22 +00:00
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
hjk
1a82bedc8b QmlProfiler: Merge LocalQmlProfilerRunner and QmlProfilerRunner
Also streamline code paths in the result.

Change-Id: Id7d96343a8f778ba8f415b1a850cc78576afa475
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-06-12 06:24:36 +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
hjk
89f02cba2c ProjectExplorer: Split Target and ToolRunners into smaller tasks
This increases re-usability of activities like 'port gathering',
and makes their use less dependent on actual device implementations.

Change-Id: I017cb74874f2b38c487ba2d03906a675d5618647
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-15 14:35:03 +00:00
hjk
e063ca68d0 Debugger: Dissolve Debugger::ActionDescription
ActionDescription was a horizontal layer of convenience functionality
covering (only) ex-AnalyzerBase based RunControl start scenarios
and gets in the way of target/tool orthogonalization.

So continue the path chosen with the removal of AnalyzerRunControl:
Remove ActionDescription by inlining into user code, then orthogonalize
tool-by-tool, then generalize again.

Change-Id: Ib597df3f4ad7b06bef06644458fa13ddca53afdb
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2017-04-24 09:52:48 +00:00
hjk
5d97c4871a ProjectExplorer: Remove startRunControl()'s runMode parameter
It is redundant, as a RunControl has a runMode() getter.

Change-Id: Ia048b271a5003356d21f86a3f778827d23466037
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2017-04-12 12:11:49 +00:00
hjk
112e32228a ProjectExplorer: Merge AnalyzerRunControl into RunControl
The change is "conceptually wrong", the AnalyzerRunControl derived
classes' functionality should be provided by ToolRunners based classes
encapsulating/"being" the current Analyzer*Runner classes.

However, the AnalyzerRunControl is only three (empty even) virtual
functions, but a big obstacle in merging attempt due to a lot of
mechanical followup changes in downstream users.

The current construction mechanism of analyzer run controls is actually
two different mechanisms (locally direct RunControlFactories, and a
"generic" createAnalyzerRunControl wrapper for remote cases). The generic
createAnalyzerRunControl makes it difficult to migrated them one-by-one,
due to the various downstream users.

So instead of merging the per-analyzer two uses directly reduce
the "indirection" distance by removing the AnalyzerRunControl
intermediate layer. After that the createAnalyzerRunControl mechanism
can be dissolved by using normal RunControlFactories also for
the remote cases. After that, porting to ToolRunner, and combining
with ther local equivalent can be done one by one.

Change-Id: I0ddace33fcce210cf3a547ac5bb23b3d85013934
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-04-05 13:47: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
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