aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QmlProfiler: Load notes data only after models are availablev4.3.0-beta1Ulf Hermann2017-03-291-1/+0
| | | | | | Change-Id: I1ee13c842a07962d9aec93aaab6959614d7d8a08 Task-number: QTCREATORBUG-17936 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Merge remote-tracking branch 'origin/4.2' into 4.3Orgad Shaneh2017-03-141-0/+1
|\ | | | | | | Change-Id: I4931dcc81be872d7712e67123e94d15ee696459f
| * QRegExp include cleanupSamuel Gaist2017-03-131-0/+1
| | | | | | | | | | | | | | This patch adds the missing include statements for QRegExp. Change-Id: Ibb03b929940adb84ae190b5090cb6b88653cc14c Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* | QmlProfiler: Initialize members inside classRobert Loehning2017-02-281-20/+12
| | | | | | | | | | Change-Id: I8154dad0eef9e11650e257b46840c295cf5e0624 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | QmlProfiler: Integrate QmlProfilerDataModel into model managerUlf Hermann2017-02-241-36/+190
| | | | | | | | | | | | | | | | There is no need to keep them separate as the data model is not accessed from the outside anymore. This removes a lot of indirection. Change-Id: I91da4dfa816295300c8cfcca22430d5c5b3298c0 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | QmlProfiler: Remove references to QmlProfilerDataModelUlf Hermann2017-02-241-6/+22
| | | | | | | | | | | | | | | | | | | | 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>
* | QmlProfiler: Guard against the temporary trace file going awayUlf Hermann2017-02-241-6/+15
| | | | | | | | | | | | | | | | | | If we cannot open a temporary file to cache a trace or retrieve a previously cached trace, the QML profiler won't work correctly. Show an error in this case. Change-Id: I468d74d9c33033b9ad19501bccbd69a9fe164fed Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | QmlProfiler: Improve error and progress handling for loading and savingUlf Hermann2017-02-241-7/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Clear the trace and send the loadingFinished() signal when loading fails or is canceled. loadingFinished() re-enables the UI, which is in fact important. * Check more consistently for whether the operation was canceled and add a separate signal for that. * When saving fails or is canceled, remove the half-written file. * Don't try to guess the number of events for progress reporting when saving. Use the event timestamps and start/end time instead. * Properly initialize the progress range in all cases. * Drop the bool return value from the load methods. Nobody uses that. * Send loadFinished() only after loading a file, not every time we reach the Done state. Change-Id: I507f11c667e20534ea335e84798de11aa06fb6f2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | QmlProfiler: Add text marks for QML/JS types into documentsUlf Hermann2017-02-211-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | QmlProfiler: Move the file finder into the QML modelUlf Hermann2017-02-151-2/+2
| | | | | | | | | | | | | | | | | | 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>
* | QmlProfiler: Move event handling into model managerUlf Hermann2017-02-151-6/+38
| | | | | | | | | | | | | | | | | | | | This is the logical place to do it. Adding the event first to the QML model and then passing it back to the manager in order to have it dispatched to the other models is somewhat backwards. Change-Id: I64b1cb38f97331b62d83fa5ae49b9b2690810d40 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | QmlProfiler: Send loaded events in batches of about 1024Ulf Hermann2016-11-091-2/+2
|/ | | | | | | | | 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>
* QmlProfiler: Don't delete QObjects from outside their home threadUlf Hermann2016-10-261-1/+1
| | | | | | | We cannot do this because the parent object needs to be notified. Change-Id: Id70de2acea4aa241ea0e85b5b02327e1f91b7e68 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* QmlProfiler: Move unrelated code out of QmlProfilerClientManagerUlf Hermann2016-08-051-0/+13
| | | | | | | | | | | 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>
* QmlProfiler: Avoid reloading notes twice on range restrictionUlf Hermann2016-07-061-1/+4
| | | | | | | | | | We need to clear them before we restrict as otherwise the other models will end up with invalid notes. Doing that by calling loadData() is inefficient as we need to call the same method again after finalizing, because the timeline models may have changed. Change-Id: I4cd6e13bfb73804aab8f1cfee6db4069a7b808cd Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QmlProfiler: Add extra metadata to notesUlf Hermann2016-07-061-2/+2
| | | | | | | | | | | This way we can improve the heuristic used for mapping notes to timeline events, by taking the row into account. Also, by marking notes as loaded when loading them we avoid accidentally dropping them by restricting to ranges. Change-Id: I031389880571805788c910728ee89333a5cd4727 Task-number: QTCREATORBUG-16542 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QmlProfiler: Use current restriction range when saving notesUlf Hermann2016-07-061-2/+2
| | | | | | | | | | | We don't want to clear notes outside the current restriction as those are still valid and need to be available for later reloading. Change-Id: If3e75ff2b2ab9a93578c5ca63f1b4a2f539dc802 Task-number: QTCREATORBUG-16542 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com> Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QmlProfiler: clear model manager only after saving the notesUlf Hermann2016-06-031-1/+1
| | | | | | | The notes model wants to resolve IDs from timeline models when saving. Change-Id: I02c6038c8519101f36db95183bfa05d01a531b97 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QmlProfiler: Fix compile warning about implicit conversion to 64 bitsUlf Hermann2016-05-261-1/+1
| | | | | Change-Id: Ia3f24f3b29c3ea4a9322ca21767bb5231b2ca2eb Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* QmlProfiler: Directly pass events from client to modelUlf Hermann2016-05-251-6/+0
| | | | | | | | Running them through the model manager via signals doesn't make much sense anymore. Change-Id: I6103d281dd640493f28acd7e787ea49712ebd8df Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QmlProfiler: Make progress widget more expressiveUlf Hermann2016-05-231-1/+26
| | | | | | | | | Instead of the progress bar we can now show the number of events we have received, and the number of finished finalizers. This should give a the user a better idea of what is going on. Change-Id: I324fefbe6d5e3c24b080bfbc103c4317fa585215 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QmlProfiler: Add a binary trace formatUlf Hermann2016-05-231-8/+21
| | | | | | | | 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>
* QmlProfiler: Rename QmlProfilerDataModel::addEvent()Ulf Hermann2016-05-231-1/+1
| | | | | | | We will get another variant, without type. Change-Id: I06bd47955ef909b2f467425bb9ad8c8b3e3dce27 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QmlProfiler: Use a temporary file to store the master event listUlf Hermann2016-05-231-1/+1
| | | | | | | | | As we only ever iterate the master event list in a linear fashion, we can use a temporary file to store it. This should allow for larger traces to be handled without running out of memory. Change-Id: I0d2aea6f998458fe5f426f6fef0f6937e915ae68 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QmlProfiler: Use data replay feature for saving tracesUlf Hermann2016-05-231-1/+1
| | | | | | | | This removes the last access to the master event list, which allows us to also remove the accessor function. Change-Id: I0e70c2eb23d2b11aa8b131c03eb3adfad1a9b9e7 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QmlProfiler: Drive event loading from the model managerUlf Hermann2016-05-231-34/+54
| | | | | | | | | | | | | | | | | | | | | | We want to get rid of the big master list of QmlEvent in QmlProfilerDataModel, as that gets very large for longer traces. In order to reduce the dependencies on that list we load the events on the fly into the child models while they are being received, rather than having the child models query QmlProfilerDataModel for the event list later. As the trace client so far only emitted rangedEvent() for complete ranges we run into problems with models that need their events sorted. The rangedEvent() signals were sorted by end time, rather than start time which makes it inconvenient to analyze them in a stack based way, for aggregation. This is solved by passing on all the details from the trace client to the models, with the QmlProfilerDataModel aggregating the type information before having the events dispatched to the child models. Change-Id: I5831a20551f21cf91e27d298a709f604ebd96c3e Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QmlProfiler: Methods for dispatching events by featureUlf Hermann2016-05-231-2/+18
| | | | | | | | | When announcing features models have to provide functions that handle events for those features now. The model manager gets a function to dispatch events to the models that subscribe to them. Change-Id: I3fd80443a68ba264a513d8d53ed473cf072f1dc7 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QmlProfiler: Remove detailed progress trackingUlf Hermann2016-05-231-47/+3
| | | | | | | | | | The progress bar in the state widget was rather meaningless. We rarely know how many events we expect and it's rather hard to tell how long each model will take to process them. Instead, we just show a 0-ranged progress bar to tell the user that "something is happening". Change-Id: Icb80840d1f0a1538bcf254faa37cbb36e25d342c Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QmlProfiler: Reset the zoom control only when we're finished loadingUlf Hermann2016-05-101-3/+0
| | | | | | | | | Drop the timeChanged signal of QmlProfilerTraceTime, too, as that doesn't serve a purpose anymore. We don't want intermittent changes of the trace time to be reflected in the UI when loading. Change-Id: I85f18b90fc404ec254c68625104d3e3f9077a1d9 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* QmlProfiler: Apply some code cosmeticsUlf Hermann2016-05-061-12/+8
| | | | | Change-Id: I772713aec3a6c25136174b39b853a9ef3ee42a0b Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* QmlProfiler: Move notes into the notes modelUlf Hermann2016-05-061-3/+2
| | | | | | | | There is not reason to keep them in the general data model and cross reference between the models all the time. Change-Id: Ic77c518928dcd6234555cb3f6a830bcc3dc4a1a4 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* QmlProfiler: Fix the naming scheme for events and event typesUlf Hermann2016-05-041-8/+8
| | | | | | | | | | Move them out of the QmlProfilerDataModel class, drop the "Data" suffix, and rename symbols that refer to them in order to call them by their names. Change-Id: I41151359921b325edb79111371083c4185bd148b Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Move QmlProfiler specific files from qmldebug to qmlprofilerUlf Hermann2016-05-031-16/+9
| | | | | | | | | | 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>
* runAsync: Remove ResultType template parameter.Eike Ziller2016-02-101-2/+2
| | | | | | | | It is now deduced from either the type of the QFutureInterface<ResultType> function argument, or the return type. Change-Id: Iddab3cc329206c649a6e55a44b2de2d406701dee Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* QmlProfiler: Avoid race conditions when loading or saving dataUlf Hermann2016-02-091-19/+32
| | | | | | | | | We cannot assume that the model manager is still available when the operation finishes. Also, accessing the QML model or the trace time from the thread is dangerous. Change-Id: I673c57c09490a0e3e2647f3197929eff1ce4ceb3 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
* QmlProfiler: Avoid QtConcurrentEike Ziller2016-02-081-2/+2
| | | | | | | | QtConcurrent runs everything on a global thread pool, which means that calls of QtConcurrent::run/map/etc can block each other. Change-Id: Ia7a61b5ae1e0919113205a83a43caa1f27015732 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
* Update License according to agreement with Free Qt FoundationTobias Hunger2016-01-191-17/+12
| | | | | | | * Update files in src/plugins Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* Merge remote-tracking branch 'origin/3.6'Eike Ziller2015-11-231-2/+12
|\ | | | | | | | | | | | | | | Conflicts: src/libs/3rdparty/modeling/qmt/model_widgets_ui/classmembersedit.cpp src/plugins/git/gitplugin.cpp Change-Id: I78a21510d484b655e01141a3543e08ee2123f9cd
| * QmlProfiler: Fix traceTime updatesUlf Hermann2015-11-171-2/+10
| | | | | | | | | | | | | | | | If the trace time hasn't been set yet, decreaseStartTime and increaseEndTime should still do something. Change-Id: I626c0df66a5d7327708ada77c78546ad4aafc52b Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
| * QmlProfiler: Initialize the model progress numbersUlf Hermann2015-11-171-0/+2
| | | | | | | | | | Change-Id: I037d0146e20d5fe1681f455fbd5da9ac5e89184b Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | QmlProfiler: Debug messages are no QML events ...Ulf Hermann2015-11-191-0/+8
| | | | | | | | | | | | | | In particular, they can also occur if we're not AcquiringData. Change-Id: Ia310206ee15973fc5b2fa1c607d7c9a48b6f435f Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | QmlProfiler: Include debug messages in traceUlf Hermann2015-11-171-2/+5
|/ | | | | | | A separate model will show them in the timeline for better orientation. Change-Id: I537bac82ddef6a8bcc64ae403731512f8edcc9db Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Merge remote-tracking branch 'origin/3.5'Eike Ziller2015-09-251-1/+3
|\ | | | | | | Change-Id: I889b93611d1762121548fb71d1d3493e4adba313
| * QmlProfiler: Load notes after timeline models are finishedUlf Hermann2015-09-171-2/+3
| | | | | | | | | | | | | | | | Otherwise the notes cannot be associated with timeline events. Change-Id: I9a2f039fddd36c9a6bbaca3c0864c75e33cc479d Task-number: QTCREATORBUG-15077 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | QmlProfiler: Refactor complete() methodsUlf Hermann2015-09-111-27/+14
| | | | | | | | | | | | | | | | | | | | The complete() methods do something more specific. We should call them by what they do. Also, we don't need to signal the finishing of data acquisition via a signal and most of the postprocessing can happen in the worker thread. Change-Id: Iae986aefb8e7e7d4327c481d7a85325bbff7fa48 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | QmlProfiler: Remove QmlProfilerModelManager::count()Ulf Hermann2015-09-111-5/+0
| | | | | | | | | | Change-Id: If520a8575add386e64a7f56b63d0241f15efa2a0 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | QmlProfiler: Eliminate QmlProfilerDataStateUlf Hermann2015-09-111-61/+46
| | | | | | | | | | | | | | | | This class is only accessible through the model manager and there is no real point in keeping it separate. Change-Id: I575d47c08aa8f6731d44739f9604072b95fd1dcd Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | QmlProfiler: Simplify file loadingUlf Hermann2015-09-111-16/+2
| | | | | | | | | | | | | | There is no need to keep a redundant copy of the file name. Change-Id: I407b1e4b92232a5869eade4d52eb7b4468fffa9d Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | QmlProfiler: Don't create widgets in a worker threadUlf Hermann2015-09-111-3/+4
| | | | | | | | | | | | | | | | | | We better call QmlProfilerModelManager::complete() from the main thread. There are too many things that can break if it's called from a worker thread. Change-Id: I92211df7ec072d572ed82dc1203efd2f67b4b540 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | QmlProfiler: Clean up the state widgetUlf Hermann2015-09-011-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Ultimately we want this as jobs for the progress manager, but let's get the logic right before. The state widget should not estimate profiling times and it doesn't have to keep local copies of all the state the model and state managers already have. Also, we need an additional indication for "waiting for application to send data", as that can take significant time. Change-Id: I3677dea4b0561bc83a7bc3c196ce0854c5624f12 Task-number: QTCREATORBUG-12958 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>