aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmltooling/qmldbg_profiler/qqmlprofileradapter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Change some unite(const QHash &) to insert(const QHash &)MÃ¥rten Nordheim2020-01-241-1/+1
| | | | | | | | | | None of the other code handles it like a multi hash, so let's change the calls from unite() to insert since we now have an option which won't silently create a multi hash. Change-Id: I520295bde81c4ad1b0665308fcaf5fe41c6c3039 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-04-261-1/+1
|\ | | | | | | | | | | | | | | Conflicts: src/imports/imports.pro src/src.pro Change-Id: Icdc39b6169d15b2102acd0e4d550a8d91e4b0744
| * Make QPacketProtocol independent of QmlUlf Hermann2018-04-231-1/+1
| | | | | | | | | | | | | | | | | | | | Just because we need a data stream version for QQmlDebugPacket, we don't need to add such a huge dependency. Using a template here adds some boiler plate to all users of QQmlDebugPacket, but this is worth it. Task-number: QTBUG-60996 Change-Id: Ibade8757e28ac772942129c22c8721b504da3aee Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | QQmlProfilerService: Drop support for non-location-tracking clientsUlf Hermann2018-02-091-12/+7
|/ | | | | | | All known QML profiler clients track locations by now. Change-Id: I1613da87dab22cfadfc25a35678d3e816ecda189 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Dissolve src/plugins/qmltooling/sharedUlf Hermann2017-11-051-1/+1
| | | | | | | | | QQmlDebugPacket is moved to PacketProtocol, and the other headers to src/qml/debugger. This makes it easier to develop debug plugins in external repositories. Change-Id: I1ab099a304dad793ec13aaef414071cab6d7d408 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QmlProfiler: Avoid race conditions in QQmlTypeLoaderUlf Hermann2017-09-051-10/+22
| | | | | | | | | | | | | We have to make sure all profiler calls to one adapter are done from the same thread. It turns out that all the calls from QQmlTypeLoader are done from the type loader thread. By using a separate adapter for that, we avoid any extra locking. Task-number: QTBUG-62987 Change-Id: I5cffcc30b84dd4154daa0c56312a1141ce2033e1 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Remove the qqmldebugtrace benchmarkUlf Hermann2017-05-081-2/+0
| | | | | | | | | | | | It benchmarks QElapsedTimer and QDataStream. We should do this in qtbase if we need to do it. The test was not in the parent qml.pro, but it was mentioned in some outdated comments in the QML profiler plugins. Remove those comments, too. Change-Id: I0d1341c32f4a2e02a04a958f76be015fe8d927fb Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Cast enums to int before streaming into QDataStreamThiago Macieira2016-10-231-1/+1
| | | | | | | | | | | | | | | | | | | They are decoded as ints, as in QPacket &operator>>(QPacket &ds, QmlObjectProperty &data) { int type; ds >> type >> data.name >> data.value >> data.valueTypeName >> data.binding >> data.hasNotifySignal; data.type = (QmlObjectProperty::Type)type; return ds; } So we should serialize the same, since the required operator<< and >> don't exist. Change-Id: I33dc971f005a4848bb8ffffd1478edcf2e916dfc Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Qml: Create profiler adapters in the pluginsUlf Hermann2016-07-281-1/+1
| | | | | | | This way QtQml doesn't need to know the ctors. Change-Id: Ie74049092b5eb9837537591c0cf37ad1487e4066 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Tooling: Convert connects to Qt5 styleUlf Hermann2016-07-281-13/+14
| | | | | Change-Id: I6746b777f73d047f5cf610bfca9b320ac1e13676 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QmlProfiler: Send RangeData and RangeLocation only once per typeUlf Hermann2016-05-271-26/+42
| | | | | | | This saves time when serializing the data to be sent. Change-Id: Ic8c534d55445934a64dd253273099194b27d98af Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QmlProfiler: Reduce memory usage for file names and URLsUlf Hermann2016-05-021-7/+22
| | | | | | | | | | | | | | | | | | | | | As the various file names are actually not kept as QStrings in the respective objects being profiled, our saving them as QStrings in each and every profiling event is not implicitly shared and causes a huge memory overhead. Avoid that by saving each location only once, indexed by a disguised pointer to the object it refers to. Normally, objects could disappear during the profiling session, and new objects could be allocated in their place, which would mess up our indexing system. We prevent that by referencing the objects when we index them, thus preventing them from getting auto-destructed. Mind that those are not JavaScript objects but rather functions, bindings, components and the like. So, this will only cause a memory leak if you're compiling and dropping QML components over and over. Task-number: QTBUG-52937 Change-Id: Ia4dfb09a71a5c9a2d6ce25c3811bbe2a1036c1c1 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* QmlProfiler: Pass detailType directly, rather than as a bit fieldUlf Hermann2016-04-271-32/+27
| | | | | | | | | | There can only be one detail type for compressed set of messages. This is unlikely to change anytime soon. Also, be more careful about not detaching the data when sending the messages. Task-number: QTBUG-52937 Change-Id: I859b12889b0766543dac00b21784e14b76e458b6 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* QmlDebug: Reuse packets instead of deleting and recreating themUlf Hermann2016-03-111-3/+3
| | | | | | | | | | | | | | | | | | This reduces memory churn as we don't have to reallocate the various QPacket, QBuffer, QByteArray objects and their private classes all the time. Also, subsequent packets often have similar sizes, which makes it beneficial to preallocate the underlying byte array to the size of the previous packet on clear(). In order not to carry the extra reserved space in the lists passed to the debug server, we squeeze the byte arrays before inserting them into the lists. That detaches and copies them, which would have been done anyway when reusing the same packet for the next message. The result is a reduction in the number of temporary memory allocations from QQmlProfilerServiceImpl::sendMessages() by about 75%. Change-Id: Ief98cd7a93a2e8e840e111dee6b346cae00e06bf Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* QmlProfiler: Send events in smaller batchesUlf Hermann2016-03-111-1/+1
| | | | | | | | | | This enables more parallel data processing and limits the memory usage. Benchmarks with the "planets" example from canvas3d show that this change reduces the time between the profiling being stopped and the last events arriving in the profiling client by about 50%. Change-Id: Iea16f9e2ae3adf584ec4a3c7fc766eaa21740f98 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Updated license headersJani Heikkinen2016-01-191-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: Ic36f1a0a1436fe6ac6eeca8c2375a79857e9cb12 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QmlDebug: Restructure QPacket and QPacketProtocolUlf Hermann2015-11-171-2/+3
| | | | | | | | | | | | | | | | | | | | | | We cannot use the same data stream version for the client and server versions of QPacket and QPacketProtocol should not deal with QPackets but with simple byte arrays because the underlying QDataStream is hard to copy. The new QQmlDebugPacket picks its data stream version from QQmlDebugConnector now, which adjusts it when connecting. As there can only ever be one QQmlDebugConnector, we can keep the version static. The clients need to query the connection for the correct version. We may connect to several different servers sequentially or we may have a server running while using a client, and we don't want to confuse the versions between those. With this in place, all remaining occurrences of QDataStream are replaced with QPacket or QQmlDebugPacket. Change-Id: I3f6ba73fcbfad5e8df917c5feb9308116738a614 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* QmlDebug: move QQuickProfiler into a pluginUlf Hermann2015-11-171-1/+2
| | | | | | | | This saves some code in QtQuick and allows us to split up QPacket into different versions for client and server. Change-Id: I9b8c723274fb11d6321c5002910148b193aa6b40 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* QmlProfiler: Remove binding typesUlf Hermann2015-10-281-3/+1
| | | | | | | | | There is only one type of binding left and as all clients check atEnd() before trying to get the bindingType from the stream we can just remove all of this. Change-Id: I4d50ef4a691630b521292cb622ef539b3494a970 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Put QPacketProtocol into its own static libraryUlf Hermann2015-10-151-3/+3
| | | | | | | | | | | | We need it in 3 places in qtdeclarative and we could also use it in QtCreator. We don't want to bundle it with the debug client code as it is also necessary for the server. QPacket replaces QQmlDebugStream as it has the same purpose. This also fixes the inconsitent handling of data stream versions. Change-Id: I650fae353f267511c551b427d9169f4d718aa7f2 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Fix profiling of QML/JS compilationUlf Hermann2015-08-241-1/+1
| | | | | | | | | | | | | | | | | | | The compilation of .js resources was missed and the compile times were underestimated because the dependency resolution and error checking wasn't factored in. In particular we only profiled the done() step for QQmlTypeData. However, JavaScript compilation also occurs in the dataReceived() step of QQmlScriptBlob and QQmlTypeData will already parse the program into an AST at that step. Compile steps can be nested now, but considering the fact that significant time may be spent before and after compiling dependencies for a parent module, this seems to be the best way to model them. Furthermore, in order to not needlessly convert QUrl to QString at runtime, the compilation profiler saves the files now as QUrl. Change-Id: I215a87787f9117c069ecd77b2d913cc0b0ff3c89 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Move profiler and engine control services into a pluginUlf Hermann2015-08-041-0/+123
Change-Id: I12627a07ceedea4aceafa6f0e630c0cab69d156d Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>