Commit Graph

314 Commits

Author SHA1 Message Date
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
Ulf Hermann
3cf6f3d5dd QmlProfiler: Don't try to open editor at line 0
There is no line 0, so if the document is already open, the editor
won't move to the beginning. Use line 1 instead, so that we jump to the
location of the corresponding text mark.

Change-Id: I0c5605d2d48b02d73dd97ddc87a527cf1b5dba8f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-02-15 16:00:53 +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
2ad8e27d53 QmlProfiler: Make the views accessible from the view manager
And then, drop some methods we don't need anymore.

Change-Id: I057bdc012072abddca2df83918ee9a0460f78611
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2016-12-28 10:48:14 +00:00
Ulf Hermann
be705a3ea1 QmlProfiler: Disable note search button if timeline is unusable
Change-Id: I4c57f99bdea365b2ade913cb6b44ddf401f47aa8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-12-15 10:29:30 +00:00
Jarek Kobus
05747d7d33 Don't shout in text messages
Change-Id: Ie8d2c6761c87b358f0bc8691e529ba8144e267a4
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2016-11-04 09:51:29 +00:00
Ulf Hermann
2d95057434 QmlProfiler: Open load and save dialogs deferred
This works around QTBUG-56746, by decoupling the dialog from the
context menu.

Change-Id: I2f13b01003a10598e6f69b14bb7eb8e9141acad8
Task-number: QTCREATORBUG-17149
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-10-26 11:46:48 +00:00
Ulf Hermann
879b770277 QmlProfiler: Don't switch to edit mode if editor is invisible
Clicking on something in the QML profiler should never trigger a switch
to a different mode.

Change-Id: I4784e836b0091d44fd046b605c49d2b10b3e8c34
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@theqtcompany.com>
2016-09-08 10:51:08 +00:00
Ulf Hermann
15fbfaf2e9 Move icons to Utils
This way we can use them from libraries, not only from plugins.

Change-Id: Ic35cfd5f04d638d87606bf272b2c00ded1267c1b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2016-08-05 10:52:53 +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
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
hjk
3b233033b9 QmlProfiler: Add a "this" to capture list
Change-Id: I8bd7b0a8e488ee79262a46406f818d86326aabda
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-07-19 14:24:03 +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
51055e6799 QmlProfiler: Don't needlessly defer state transition from dying to idle
Otherwise we can run into an inconsistent state when we try to restart
the process while we're still "waiting" for it to die.

Change-Id: I82afd272a73b3be79328c45c8d027621d1feeace
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-07-05 08:08:01 +00:00
hjk
db9437c2e8 Generalize IDevice::qmlProfilerHost
The idea is to have a way for tools to specify what kind of
control channel they would like to use to communicate with
a device without making the choice explicit dependent on
the exact kind of tool to further decouple device and tool
implementations.

The 'hint' values are there to help the device implementation
to decide on which channel to use exactly in case there are
multiple choices. In any case, the tool is responsible to
check that the returned channel is suitable for its operation.

Currently the only choice is "QmlControlChannel" yielding
a simple wrapper around the former IDevice::qmlProfilerHost()
return value.

Other enum values may potentially be {Tcp,LocalSocket}ControlChannel
(to specify a type of transport) AdbChannel (to specify some
generic helper mechanism). It might also turn out that something
more complex than an enum will be needed, e.g. to express
a set of values with priorities or such, but I'd rather
avoid overengineering for now.

Change-Id: Id386425eb3dd2bb395065f0bdb6f67217cd40a71
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-06-08 08:16:22 +00:00
Ulf Hermann
b3fa768dfd QmlProfiler: Don't populate the file finder if there is no run config
Change-Id: I1cce87162836e0579577616956d9993f26e00a01
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-06-06 14:51:23 +00:00
Ulf Hermann
7ecd0763b9 QmlProfiler: assert that connections are AnalyzerConnections
... before accessing them as AnalyzerConnection

Change-Id: I6f6111ca3b0dede93ac85fbcb5ffbfcf3c7b19aa
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-06-03 08:45:01 +00:00
Alessandro Portale
a6683575c4 Icons: Move "next/prev", "[un]locked" and "zoom" from Core to Utils
They are needed in the timeline view.
The change in qtcreator-project.qdocconf makes sure
that qdoc still finds the referenced icons.

Change-Id: I812fba8e57d06d93efc00c295467c83c08cd1784
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2016-05-31 08:51:12 +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
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
67378a7928 QmlProfiler: Restore feature visibility when starting data aquisition
Some models check the visibility to determine what to load.

Change-Id: I94d42ddc6e531d04f240c66d4b789826d8c17cf6
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-05-23 11:52:32 +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
0f94aa3f4d Merge remote-tracking branch 'origin/4.0'
Conflicts:
	src/plugins/debugger/debuggerruncontrol.cpp
	src/plugins/projectexplorer/projectwizardpage.cpp
	src/plugins/projectexplorer/xcodebuildparser.h
	src/plugins/qmldesigner/qmldesignerplugin.cpp
	src/tools/clangbackend/ipcsource/translationunits.cpp

Change-Id: Ibf0857cf8dbf95fc9ac13d5c2112b3f4a2ca7de6
2016-05-03 11:49:01 +02:00
Ulf Hermann
75d8169e1e QmlProfiler: Repopulate the file finder when loading a trace
We might have opened or closed projects since the last time we
populated the finder, and we will need the files from those projects
to resolve file names in the trace.

Change-Id: I5979702a105c60e1be452b0b029d01d7498bff3d
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-05-02 11:35:52 +00:00
Alessandro Portale
e42dd1eb70 Move "Clear/Clean" icon from ProjectExplorer to Core
And use it in the menu entry for
"Window->Output Panes->Clear"

Change-Id: Iff8c011fde8a21fd10bf52b35163eb3f63659153
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2016-04-27 16:45:41 +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
88476a1435 QmlProfiler: Disable run controls after they are finished
Disabled runControls would still receive and send signals, confusing
the profiler state.

Also, connect lambdas with receiver argument where possible.

Change-Id: I0cd43456d3462efe402e9d68792b67314e9b6e0b
Task-number: QTCREATORBUG-16073
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2016-04-18 08:07:04 +00:00
Eike Ziller
5c87432260 Merge remote-tracking branch 'origin/4.0'
Conflicts:
	src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp

Change-Id: I6ae2d37290643d69390f679a54f7596782f3d97f
2016-04-12 11:34:46 +02:00
Alessandro Portale
b81d624543 QmlProfiler: New Record ON/OFF button icons
Change-Id: I95f4a28de5aeefdd321a5fe131351a6aab5b9498
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-04-08 16:55:25 +00:00
Alessandro Portale
63cbcbc729 Locator: Remove old "Locator" menu icon. Re-use the "search" icon.
This patch removes the locator.png icon and replaces it with a
menu-friendly variation of the zoom icon.

The current ZOOM icon becomes ZOOM_TOOLBAR.

Change-Id: I8817c5c420801351db659caa4c4190a9074be720
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-04-08 15:59:10 +00:00
Eike Ziller
1ae483fc83 Merge remote-tracking branch 'origin/4.0'
Conflicts:
	src/libs/utils/tcpportsgatherer.h

Change-Id: I495f3e05789f09efb8b1e84827893423a5b5b60c
2016-04-05 14:11:47 +02:00
Leena Miettinen
838216ab5b QML Profiler: Fix capitalization of UI text
- Qml > QML
- When an icon tooltip can be considered an action name, use
  book style capitalization and no punctuation.

Change-Id: I7ea6f4976f988c462160a4cdbecf14a792f8ca3f
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2016-04-05 09:55:20 +00:00
hjk
bcf7a11c24 Core: Apply 'static' pattern to Core::FindPlugin
Also, rename it to Core::Find. It hasn't been a plugin for a while.

Change-Id: I845885ccf18bdc1440258d523b033758d5583881
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-03-15 12:43:59 +00:00
hjk
5996ff0ab8 QmlProfiler: Disable start actions during building
Helps to prevent multiple starts of the tool in parallel.

Change-Id: Ibd2d0a66e7ce08ea07604f13fbee6d18a40dfc39
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2016-03-10 13:02:06 +00:00
hjk
92e301a054 Debugger: Merge debug mode and analyze mode
On the user-visible side, only the 'Analyze' mode button disappears,
and instead a combobox to switch between different tools in appears
in the Debug mode toolbar.

Internally, that's quite some re-organzition: The centralized
'Analyze mode is busy' flag is gone, allowing us to run e.g.
ClangStaticAnalyzer and MemCheck in parallel.

Analyzer tools and debugger now share the same mechanism to
generate/load/save dock widgets.

Analyzer tools now create and handle their own start/stop button
when appropriate. In general, Analyzer tools can create/handle more
than one run control at a time.

Further consolidation is possible, e.g. RunControl state handling
could be merged into the base ProjectExplorer::RunControl to
avoid the still existing duplication in ~15 instances.

Change-Id: I91e5940ebc4211f98056d507cf2f7b5f8efe7f07
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-03-07 15:06:10 +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