Commit Graph

1631 Commits

Author SHA1 Message Date
Ulf Hermann
5de5794c49 QmlProfiler: Disambiguate parent/child terminology in statistics
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>
2018-04-12 09:13:22 +00:00
Ulf Hermann
f94e048c2f QmlProfiler: Un-pimpl statistics classes
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>
2018-04-12 09:12:10 +00:00
Ulf Hermann
06aa4c573e QmlProfiler: Fix type for restrictToFeatures
Change-Id: Ifdc75c570faf4ae6784decf80a530c0e30d44e1d
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-12 05:53:30 +00:00
Ulf Hermann
1732b6f882 QmlProfiler: Drop some dead code
Change-Id: I43e0803461ff8d6e30fde3c526d62402fedb6f4b
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-12 05:51:42 +00:00
Ulf Hermann
5aaaa7c198 QmlProfiler: Get rid of field/column mapping in statistics view
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>
2018-04-12 05:51:34 +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
Ulf Hermann
27c51ed4c8 FlameGraph: Allow zooming into items
Double clicking an item will now rebuild the flame graph with that item
as root. Double clicking on an empty area will reset the root.

Change-Id: I16dd4b00d0dd09ff922a01acee67f0d553da6323
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-04-06 05:58:54 +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
Tobias Hunger
835d4e92f3 Project: Improve default implementation of Project::needsConfiguration
Change-Id: Ic4d227334d818658f179c0589462551509274c17
Reviewed-by: hjk <hjk@qt.io>
2018-03-09 12:57:59 +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
Thiago Macieira
b5f63a76b2 Fix build: add missing #include for QmlProfilerSettings
qglobalstatic.h:87:18: error: field ?value? has incomplete type ?QmlProfiler::Internal::{anonymous}::Q_QGS_qmlProfilerGlobalSettings::Type {aka QmlProfiler::Internal::QmlProfilerSettings}?
qglobalstatic.h:152:9: note: in expansion of macro ?Q_GLOBAL_STATIC_INTERNAL?
qglobalstatic.h:159:5: note: in expansion of macro ?Q_GLOBAL_STATIC_WITH_ARGS?
qmlprofilerplugin.cpp:79:1: note: in expansion of macro ?Q_GLOBAL_STATIC?

Change-Id: I940917d6763842499b18fffd1514e0f3522f3bbd
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-02-20 06:16:35 +00:00
Ulf Hermann
41017d1bbd QmlProfiler: Use a predictable kit in the QmlProfilerTool test
We may not have a valid kit at all, and then the test would fail.

Change-Id: Ie2613e67309121f0df847e76668bc433fd88c315
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-02-19 17:03:11 +00:00
Ulf Hermann
38064c97b0 QmlProfiler: Prevent kits without device in the attach dialog
We QTC_ASSERT on the chosen kit having a device in
QmlProfilerTool::attachToWaitingApplication().

Change-Id: I04033f032c43f27726545dcdea4533b3ccbe7257
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-02-19 17:02:46 +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
Ulf Hermann
a2581a2a89 QmlProfiler: Use EngineControl to hold engines until we're done
Holding the engines with EngineControl makes sure we always receive the
full trace before the connection drops.

Change-Id: I32e7d17886cdbc4749e3e54719e198d45169cbfe
Task-number: QTBUG-66269
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-02-13 12:16:42 +00:00
Ulf Hermann
89a6611e9e QmlProfiler: Test that server recording changes only clear events
... and not event types.

Change-Id: Ic6c4ac3ef52bf07678d1ff0c0aaaf15242ea472e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-02-13 10:55:34 +00:00
Eike Ziller
5432dd1f5c Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/plugins/coreplugin/locator/locator.cpp
	src/plugins/imageviewer/imageviewerplugin.cpp
	src/plugins/remotelinux/remotelinuxplugin.cpp
	src/tools/clangbackend/source/tokeninfo.cpp
	tests/unit/unittest/data/highlightingmarks.cpp

Change-Id: I74cc3ba3a2836cb9d0e65d3380d8c4f88d720c67
2018-02-07 11:58:23 +01: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
Ulf Hermann
c1a5494594 QmlProfiler: Preserve statistics sorting order across model reloads
Task-number: QTCREATORBUG-19660
Change-Id: I19e20cbeddf91790a4aec056a438e97c96f57735
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2018-02-01 11:14:21 +00:00
Eike Ziller
ecb9fae785 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	share/qtcreator/qml-type-descriptions/qmlproject.qmltypes
	src/plugins/clangcodemodel/clangeditordocumentprocessor.cpp

Change-Id: I35fb652f29a98a798be7c8b4b4c2e581eb175fb6
2018-02-01 09:58:36 +01:00
Ulf Hermann
13ba063696 QmlProfiler: Fix translations and tests for statistics view
The statistics view is not called "events" anymore.

Task-number: QTCREATORBUG-19658
Change-Id: Iff4375d3dc0cf5d82d118244698887818f924c07
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2018-01-26 11:26:48 +00:00
Eike Ziller
32c938c4a0 Merge remote-tracking branch 'origin/4.6'
Change-Id: I724da8f761275865e735e7dce10c3b2b2d99fe94
2018-01-25 10:20:06 +01:00
Friedemann Kleint
f482270432 Introduce Q_FALLTHROUGH()
Silence g++ 7.X warnings.

Change-Id: I9d06d04b496c9ec060e13e1be6f43d8fbadb1f3b
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-01-24 14:50:43 +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
Orgad Shaneh
d3096f0f73 QmlProfiler: Fix build
Resolves a build conflict between e1ad7a1784
and cfd54505eb.

Change-Id: I70baec1ca2f388bc699866a134c9cb6f64203fdb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-01-17 19:44:58 +00:00
Ulf Hermann
cfd54505eb QmlProfiler: Improve robustness of QmlProfilerTool test
The QmlProfilerClientManager will only report connectionClosed() if the
connection was open before it dropped. If the connection never opens,
that is the hello message never arrives, it will retry a few times,
triggering the QTRY_VERIFY timeout.

We don't want the retries to succeed, so close the server after the
first connection. Furthermore we want the hello message to be
transferred before dropping the connection, so check for isConnected().

Change-Id: Ie96c48b2aaf2748d082c4bef3efe85c261ca4812
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-01-17 14:31:09 +00: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
77e28efad6 Timeline: Use some better number types
The scale parameters are converted to single precision float anyway as
soon as we do something with them. We might as well change all the
methods to be single precision, too.

The min/max row values should really be 64bit as 32bit values are not
enough to express memory usage.

Change-Id: I2b058b112286eabb1c077f7e746c48b6b99cb416
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-01-16 09:02:57 +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
ff182d1c97 QmlProfiler: Guard state widget against unexpected deletion order
If the model manager or the state manager disappear before the parent
widget, we might still get a timer update in between.

Change-Id: I6a67868615ef9d570e2ce438d9d9bd88b1035cc2
Reviewed-by: hjk <hjk@qt.io>
2018-01-10 17:04:23 +00:00
Ulf Hermann
bb07cc280c QmlProfiler: Reduce retry params for testConnectionFailure()
This greatly reduces the test execution time, hopefully avoiding the
test function timeouts. As we know that all the connections fail, a 1ms
interval should be enough and retrying twice should be enough to
exercise the retry path.

Change-Id: I24e61aa1957313dc16b7e46f7a7de7ae483e82dc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-01-10 12:14:48 +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
747818291d QmlProfiler: Test that attachToWaitingApplication tries to connect
Change-Id: Ic71cb60b70e9b68e455795511594a6be5739eb5f
Task-number: QTCREATORBUG-19496
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-01-08 15:14:27 +00:00
Ulf Hermann
da1453a13d QmlProfiler: Allow QmlProfilerRunner::stop() without profilerState
This can happen because a run control may already initiateStop when in
Starting state.

Change-Id: Ie872cb1ba5d0ff65eb1c82ff90f9659311e534f4
Reviewed-by: hjk <hjk@qt.io>
2018-01-08 14:50:49 +00:00
Ulf Hermann
8880b32426 QmlProfiler: Show more useful arguments in attach dialog
Without "CanvasFrameRate" the QML profiler won't be very useful.

Change-Id: I8bff2b600db31bd1092c1a5f79e27e4177c97086
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-01-08 09:11:01 +00:00
Ulf Hermann
5bd0ee0b4c QmlProfiler: Process remaining events if connection drops
When the connection drops while receiving a trace we can easily process
the buffered events. The trace client test case has some traces with
trailing open ranges that can be recovered this way.

Change-Id: I8b2ecc135b0cabff18923fbc8f3f14b5cb3a96ee
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-01-04 12:41:04 +00:00
Ulf Hermann
098fc76b63 QmlProfiler: Update traceClient test for queued debug messages
The order of messages changed due to debug messages being queued and
inserted so that the time ordering is maintained now. The updated
check.dat serves as a test for the queueing.

Change-Id: Id4c978a6e7fb9fa50933081217ce34e2cea5c217
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-01-04 12:33:13 +00: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
2b99623605 FlameGraph: Verify that window is exposed in test
Change-Id: I54b434d41f25227b48be21c60e82ff5294aae1c1
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-01-03 10:34:24 +00:00
Oswald Buddenhagen
777ca8e655 Merge remote-tracking branch 'origin/4.5'
Conflicts:
	src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp
	src/plugins/qmlprofiler/qmlprofilertraceclient.cpp

Change-Id: I94647f59d7a9df48168ac066555afe80f5f9b91f
2017-12-21 13:20:24 +01:00
Ulf Hermann
a21a518d38 QmlProfiler: Record debug messages separately
They are not time-ordered like normal messages, so we need to buffer
them and only insert them when the normal event stream arrives at their
timestamp.

The time ordering is important as the "restrict to range" feature uses
it to determine the start of the range.

Change-Id: If27a3f667c4c39e69efa95fcb9cdfd3dbf01e657
Task-number: QTCREATORBUG-19456
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-12-19 09:36:41 +00:00
Alessandro Portale
46a2818ead QmlProfiler: Silence truncation warning
When building Qt Creator with MSVC, this is the only warning I get:
  warning: C4309: 'initializing': truncation of constant value

It would be great to silence it.

MSVC supports the "i8" literal extension, which would be fancier than
the cast, here. But I don't know what other compilers think of it.

Change-Id: I3f1bb4f58f6ab378cbeb44a667aebc5ddee25eec
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2017-12-15 14:58:41 +00:00
Ulf Hermann
3446c0dbd8 Remove accidentally committed fuzzing artifact
Change-Id: I1b9369f68613ab36c57890692e636a15c33ce035
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-11-23 08:16:35 +00:00
Christian Stenger
327b368ab6 QmlProfiler: Fix compile on Windows
Change-Id: I4910a1f8cb36e1cfee6feeef20def6dbc967b66c
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-11-23 06:17:22 +00:00
Ulf Hermann
7b4b56c336 QmlProfiler: Tests for QmlProfilerTraceClient
We run a number of test traces through the trace client and make sure
that it doesn't crash and that the events reappear in the right order.

Change-Id: I45bbeeb978f2ab147551aaafa74631f927c710e8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-11-22 15:10:53 +00:00
Ulf Hermann
bffbae47f1 QmlProfiler: Don't write past end in QmlEvent
If the external data is quint16_max long, we need to stop writing at
quint16_max - 1. So we cannot rely on unsigned integer overflow to
enforce the boundary.

Also, use for (...) rather than foreach (...). This should easily offset
the extra overhead introduced by the bounds check.

Change-Id: I51d1aef1040fbaa8396ca80ec7e30b2fe7b7dd0b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-11-22 11:46:29 +00:00