Commit Graph

1631 Commits

Author SHA1 Message Date
Ulf Hermann
cd4e104a8b QmlProfiler: Disable timeline if it's unusable
Task-number: QTCREATORBUG-16503
Change-Id: I67fe5263ebca865e5ee08571754c1bf763a305d9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-12-15 10:26:54 +00:00
Ulf Hermann
bba1304817 QmlProfiler: Add functions to check if timeline view is usable
We can only use the timeline view if the scene graph is rendered via
OpenGL. This can be checked from Qt 5.8 on by querying the
RendererInterface. Earlier versions of Qt can only render with OpenGL.

Change-Id: I3f77e2a4dee1f9a1df5d6b1946cf7eb05a1bad01
Task-number: QTCREATORBUG-16503
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-12-15 10:26:41 +00:00
Ulf Hermann
233880e99d Timeline: Check for validity of vertexData() after allocating geometry
QSGGeometry itself doesn't check the result of allocations.

Change-Id: I4533d9abbb6dd26b8bd97e2c1b3dff089d827023
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2016-12-15 10:26:25 +00:00
Ulf Hermann
a7a02897e7 QmlProfiler: Clean up view initialization
As there are only two events views we can handle them separately rather
than keeping them in a list. Also, the object names and dock IDs should
match. This breaks the settings, but that shouldn't be a big problem.

Change-Id: Iac46fd7976d1e747fef4b40cead9a54e830d188f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2016-12-14 16:48:36 +00:00
Ulf Hermann
207b5315cf QmlProfiler: Remove QmlProfilerViewManagerPrivate ctor
Change-Id: I7b7845a5943f43c8166424e2ba9045bb5d1f076a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2016-12-14 16:48:29 +00:00
Ulf Hermann
68f0d637a6 Timeline: Expose theme as singleton type
This allows us to look up the colors by their enum values, rather than
by strings. Lookup by string is prohibitively expensive as the whole
QVariantMap of theme values has to be converted into a JS object
repeatedly and the strings have to be converted between QString and
QV4:String all the time..

Change-Id: Id131840b1a6e1eaabbd8966d60b9baf1ebed00c1
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2016-12-13 14:26:28 +00:00
Ulf Hermann
071b1551b3 QmlProfiler: Make sure we can handle inconsistent trace data
Apparently some versions of Qt can produce traces with unmatched start
and end events. We should not crash on those.

Change-Id: Idfb3273f02470156e9f1863c43477d0c3494e0d6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2016-12-13 12:02:21 +00:00
Ulf Hermann
de589042c0 QmlProfiler: Fix sorting of statistics items
Enforce the presence of a sort role for all items and make sure we
don't call column() during sorting. column() can be very expensive on
large models.

Change-Id: I89555072d8ef051d6e0b4f9819159238a1a40859
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
2016-12-13 10:10:54 +00:00
Ulf Hermann
2b49c3b2b3 QmlProfiler: Avoid showing "NaNb" as memory in flame graph details
Change-Id: Ic06885d6c898036efba9b11beb13209351b2629a
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
2016-12-13 10:10:29 +00:00
Ulf Hermann
e826a461c1 QmlProfiler: Drop type from flamegraph details
It is unnecessary as it's already shown in the title, and it wasn't translated,
so it showed as "undefined: <blah>".

Change-Id: I063b78df5778d17db8849f73c470184546e0daeb
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
2016-12-13 10:10:12 +00:00
Ulf Hermann
fcbe75f9e4 QmlProfiler: Unify conditions in binding loop render pass
Invalid events with binding loops could trigger a null pointer access
as the the check for creating the nodes for the binding loops render
pass was somewhat stricter than the check for populating them.

This is largely an academic problem, though, found by coverity.

Change-Id: I7f2681960f23e4a31977faa0d538bc257fa4cf2c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-12-06 09:28:07 +00:00
Ulf Hermann
a228ad7e49 QmlProfiler: Use QML_MIN_LEVEL in DebugMessagesModel
... replacing some magic numbers.

Change-Id: Ib77aa53d6b892867abe337a69b6f8caf89e58a14
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2016-12-01 16:08:44 +00:00
Tobias Hunger
1317beda20 QmlProfiler: Initialize members
Change-Id: Iaac47ff5cbc9b5ec9753cef97e68528f3fb1d456
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-11-29 15:23:32 +00:00
Tobias Hunger
7876f8ee9d QmlProfiler: Initialize fields in PixmapCacheItem
Change-Id: I4ab27b6a122a1a77fad23dfa1a1a8f825fff0765
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-11-29 14:51:30 +00:00
Orgad Shaneh
7b3642cce4 Merge remote-tracking branch 'origin/4.2'
Change-Id: I259a402bc896fc2e359cc96b7510453ac9a9a552
2016-11-28 15:27:51 +02:00
Ulf Hermann
7c07774a04 QmlProfiler: Don't use QML_MIN_LEVEL for expanded row number
You cannot have a row label on top of the category label, so in
expanded mode, the rows have to start at 1.

Change-Id: I89e5219355919dcc9003a46f9caf8f017b37e6cf
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-11-24 14:25:11 +00:00
Ulf Hermann
7d542b82ad QmlProfiler: Don't test for default kit in attach dialog test
The test should also run if there is no kit.

Change-Id: Ia2b5d34f2fc792235fb9da9c77f9235c186addde
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-11-24 13:56:09 +00:00
Ulf Hermann
93ac3a50a6 QmlProfiler: Deduplicate some code
Change-Id: I17dade638202fd4c909020addd6a0a08f3e98c7a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2016-11-24 07:41:25 +00:00
Ulf Hermann
1bb19cc48e QmlProfiler: Suspend timelinemodels while editing them
The models are in an inconsistent state while we're processing data.
The items may have out of range row numbers, we don't get a
contentChanged() signal for each item added, the labels may not be
in place, yet, etc. We don't want the models to be accessed during
that time.

Change-Id: Ibe81e0943de78d5bb45d46d005e847ec2d4ae66d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2016-11-23 16:13:03 +00:00
Ulf Hermann
824f5f443a Timeline: Use the same type for setting and getting a model list
We want to use QVariantList here because that is the only list type we
can pass to QML without special registration.

Change-Id: Ia57f8f0c578388da7603ddb6d62288e9cf61e381
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2016-11-23 16:12:51 +00:00
Orgad Shaneh
9c09ca9e42 Merge remote-tracking branch 'origin/4.2'
Change-Id: Ia98031eb87f1859c3736faa0cdd8b655e8a50689
2016-11-14 11:17:13 +02:00
Ulf Hermann
05746be80d QmlProfiler: Fix tests involving TimelineModel::color()
Change-Id: Ia3d1ab6be249fb7193ce084b7312e2b6192edad6
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-11-10 08:55:15 +00:00
Ulf Hermann
faf77fd0e5 Timeline: Use QRgb and a lookup table for colors
It makes no sense to return a QColor as the only things we are using
are the red, green, and blue components. Furthermore, colorFromHue()
can only generate 360 different colors which we can easily cache
instead of recalculating them on each request.

This significantly reduces the time it takes to update the timeline
render nodes.

Change-Id: I7961014364a1bec5b089285148b2e6c141a6dc7d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2016-11-09 11:55:02 +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
a432683e0c QmlProfiler: Mark various number writing/reading functions inline
The compiler does not necessarily get it automatically.

Change-Id: Id37c20960a66775e34b80cbbe666e22505c5b347
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2016-11-09 11:54:40 +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
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
Eike Ziller
90cf4487a5 Merge remote-tracking branch 'origin/4.1'
Conflicts:
	src/plugins/autotest/qtest/qttestoutputreader.cpp

Change-Id: I4b323f2f3041d015fa04b9a25ec925f3b3e2411f
2016-10-05 15:28:04 +02:00
Ulf Hermann
2689383fd3 QmlProfiler: Fix flame graph model test
The flame graph keeps separate "flames" for compile and other QML/JS
events now. The test has to be adapted to check for this.

Change-Id: Ifdbc3331240d30a3acbb9df62a6a44654466273e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-09-27 08:30:47 +00:00
Orgad Shaneh
c01d7a7540 Merge remote-tracking branch 'origin/4.1'
Change-Id: Ieaddc6093d10c08a54acb9b57cbbfe022bc3c038
2016-09-22 11:01:16 +03:00
Alessandro Portale
e809594fae Core: Make IOptionsPage::categoryIcon a Utils::Icon
This is necessary for themable + HighDPI icons in the options dialog.

Change-Id: I8e3ff87a24591af40bb76b39cd970443d7678fae
Reviewed-by: hjk <hjk@qt.io>
2016-09-20 12:52:49 +00:00
Ulf Hermann
1ff9c71b65 QmlProfiler: Announce correct features from memory usage model
... and make the test pass again this way.

Change-Id: I0854688095af4385c4f57e113e3af03cca22e39f
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2016-09-16 13:30:25 +00:00
Ulf Hermann
6b79bba985 QmlProfiler: Don't accept compile events in memory usage model
As compiling happens asynchronously it messes up the stack based
approach used to attribute memory usage to QML/JS events. Compiling
generally doesn't use the JavaScript heap, so we can ignore it here.

Change-Id: If8cc4b0ad2b8c2e0531260a8b92b7e2cd76a6d56
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2016-09-14 08:36:24 +00:00
Ulf Hermann
257d1990c6 QmlProfiler: Don't handle type IDs in memory usage model
Events in the memory usage model should not be selected when a type
ID is propagated from the statistics or flame graph model. The event
in the respective QML/JS model should rather be selected.

Change-Id: I6646358650f61c424c607e9dd8edb7fd9a61597e
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2016-09-14 08:35:17 +00:00
Ulf Hermann
fbb45e5a57 QmlProfiler: Keep Compiling events separate in flame graph
The QML compiler can run asynchronously and produce ranges that don't
match up with other QML/JS ranges. The flame graph model assumes that
all ranges are perfectly nested, and produces incorrect data if they
aren't. The compile ranges are perfectly nested among themselves, and
the other QML/JS ranges are also perfectly nested among themselves, so
we can fix this by keeping separate stacks for them.

Change-Id: If4ea251c6a2e74bd04e142cf184937600ea31a87
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2016-09-14 08:34:47 +00:00
Ulf Hermann
0eb1301b5c QmlProfiler: Don't lie about the debug messages model's row count
The previous code would crash in the renderer if the type id is smaller
than the detail type of the message. That is rare, but can happen.

Change-Id: I7702284bc61a7c9227c7ad81ecf714255db5db9f
Reviewed-by: Michael Winkelmann <Michael.winkelmann@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2016-09-14 08:04:44 +00:00
Eike Ziller
c635c6b50a Merge remote-tracking branch 'origin/4.1'
Conflicts:
	share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ExtendedFunctionButton.qml
	src/plugins/android/androidrunner.cpp
	src/plugins/debugger/debuggerruncontrol.cpp
	src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp
	src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.h
	tests/system/suite_WELP/tst_WELP03/test.py

Change-Id: Ibac4d71d4f4dbe1e4f05052d2f8a2dcfd82edd4c
2016-09-13 12:15:09 +02:00
Ulf Hermann
0d5f5bdd6c QmlProfiler: Keep Compile and QML/JS statistics separate
The QML compiler can run asynchronously and produce ranges that don't
match up with other QML/JS ranges. The statistics model assumes that
all ranges are perfectly nested, and produces incorrect data if they
aren't. The compile ranges are perfectly nested among themselves, and
the other QML/JS ranges are also perfectly nested among themselves, so
we can fix this by keeping separate statistics for them.

Also, choose a less insane data structure for the relatives model.

Change-Id: I146593b67586e7b5aba6b19d360961c142511289
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2016-09-09 08:21:20 +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
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
Eike Ziller
c56aa52b80 Merge remote-tracking branch 'origin/4.1'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/qmakeprojectmanager/makestep.cpp
	src/shared/qbs

Change-Id: If1787ed23afa786ed2cef57f53c1db642559cbe0
2016-08-31 14:40:38 +02:00
Ulf Hermann
06b2ff604a QmlProfiler: Move output parser into LocalQmlProfilerRunner
In the general case we don't want the QmlProfilerRunControl to parse
the QML debug port from the application output. As for most platforms
the ports are mapped via some remote connection mechanism the parsed
port is almost certainly wrong.

In the case of local connections, however, the port is actually
correct, so we keep the output parser in the LocalQmlProfilerRunner.

Change-Id: Ifdaae85196d8b034e67bc2ba0b8c05be980b62e5
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-08-29 08:39:40 +00:00
Robert Loehning
edb0da7552 QmlProfiler: Use numerous form
Change-Id: I6430c934fa0d5a629a9bb973e4720a38ec183f9c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-08-25 16:35:15 +00:00
Robert Loehning
2847e248e6 QmlProfiler: Use numerous form
Change-Id: I93f58bb50933e44b350e8bca3d99c922c7a66237
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-08-23 16:31:24 +00:00
Ulf Hermann
0c1c54b426 QmlProfiler: Remove pointless QmlProfilerTimelineModel::clear()
Change-Id: Ib0d7f348be11cfdea8d52e1d4aa9ce8a3546517e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2016-08-15 09:50:05 +00:00
Ulf Hermann
6789f50018 Timeline: Unify TimelineModel's emptyChanged and labelsChanged signals
It doesn't make sense to distinguish between them. When the content
changes, the labels, the number of items, and the "empty" state
change.

Change-Id: I65f77f65828626fd76bfd968abf67b608b6e267b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2016-08-15 09:49:43 +00:00
Ulf Hermann
ec28a4b0f3 QmlProfiler: Work around QProcess not emitting errorOccurred
When given an empty string as executable and some non-empty arguments
QProcess might emit error() but not errorOccurred(). This was fixed by
2f0ffba638bdb868a810bc0349c240b6b6e172cd in qtbase, but we cannot rely
on that being present, yet. Thus, avoid passing empty strings as
executable.

Change-Id: Ia1bb5ebceb6edeca1e54489d12b838f3cea8851e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2016-08-11 12:32:27 +00:00
Ulf Hermann
bfe8d5c224 QmlProfiler: Don't use QML_MIN_LEVEL in statistics model
It is meant for the timeline and it makes no sense to start counting
at 1 when aggregating the statistics.

Change-Id: I0faa198da7a6b3316d5c989362247d5e7f3b45ce
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2016-08-10 14:35:50 +00:00
Ulf Hermann
edbd72f0a4 QmlProfiler: Remove unused constant
Change-Id: I1000adaa8b6f5637fd9d5964f7f73a981427c1a0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2016-08-10 14:35:38 +00:00