Commit Graph

1631 Commits

Author SHA1 Message Date
Ulf Hermann
4f3e1b6024 QmlProfiler: Avoid soft asserts and warnings in details rewriter test
ProjectExplorer::Project wants an ID and a displayName, and Target wants
an IBuildConfigurationFactory that returns a priority >= 0. Give them
what they want.

Change-Id: Iab539d183669729d0e57505143b462ffa92730ad
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-05-28 08:58:07 +00:00
Tobias Hunger
bcbb6e61ef ProjectExplorer: Use unique_ptr to hold targets in projects
Change-Id: I8f793f5e552b65939d6c7c5e0eb42b89f9f45c3d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-05-24 11:39:49 +00:00
hjk
36b835ff0a Finish merging Runnable and StandardRunnable
As all Runnables are known to be StandardRunnables, this here
essentially replaces all .is<StandardRunnable> by 'true'.
.as<StandardRunnable> by no-op, and fixes the fallout.

Change-Id: I1632f8e164fa0a9dff063df47a9e191fdf7bbb2e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-23 08:48:36 +00:00
Ulf Hermann
2522275b69 Tracing: Untangle some includes
Forward declare in the header and include in the implementation where
possible.

Change-Id: Iea54f52fbf1deecab5f5a257821cd6383cf69a91
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-05-15 07:20:41 +00:00
Eike Ziller
e7123b140e Merge remote-tracking branch 'origin/4.7'
Change-Id: I9d433fa6ce4f60a2acfbdb21da9f727cac8d7526
2018-05-14 09:52:58 +02:00
Ulf Hermann
86b368f912 QmlProfiler: Rename all the timeline model data structs to Item
This allows us to define a template for filling a
QmlProfilerTimelineModel without spelling out all the type names.

Change-Id: I97870287a795d95f58a949729afa715f145817bb
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-11 15:41:55 +00:00
Ulf Hermann
9685711cb3 QmlProfiler: Remove accepted() methods
The only place where we used them was handlesTypeId(), and there it was
wrong. Each QmlProfilerTimelineModel has exactly one main feature it
subscribes to. It might additionally accept events of some auxiliary
features for context, but it doesn't really "handle" the respective
types in the sense that you could, for example, attach notes to them.
Therefore, just checking for the main feature is the right thing to do.

Change-Id: If0c00444084b957f3b99d3456cdbf703ae4afc3d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-11 15:41:45 +00:00
Ulf Hermann
3ce528d6af Tracing: Simplify saving and loading
We don't need the success and canceled signals from TimelineTraceFile,
as the future produced by runAsync tells us when a job is finished or
canceled. Also, we can just create the QFile inside the runnable to save
some code.

Change-Id: I7d91c60c1f798077573712cf624243e9f5969fd6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-11 15:41:03 +00:00
Orgad Shaneh
668e8262c7 QmlProfiler: Fix implicit fall-through
Detected by GCC8.

Change-Id: I59d55322eaef631163a56b619ffbf09671758caa
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-11 09:21:31 +00:00
Orgad Shaneh
ef528e1801 QmlProfiler: Avoid memcpy for non-POD object
Replace with assignments/memcpy for members.

Detected by GCC8.

Change-Id: I9866ea0215cf5d43b55ed10d21e4efa371315365
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-11 09:21:04 +00:00
Ulf Hermann
916883e70f Tracing: Move event storage out of trace manager
This is a step toward making the trace manager non-virtual. It should
just juggle the storages for types and events, and manage the threads to
access them. It doesn't need to know what exactly it stores.

Change-Id: I45093c60d8ae921e68aeb09bd48d24d5877ce306
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-08 16:26:55 +00:00
Ulf Hermann
6e0373adb3 Tracing: Move the type storage out of the trace manager
When we replay events we want to keep this constant and pass it to the
event receivers as separate entity. This way we can move the replaying
to a separate thread.

When loading we will have a similar situation, but then the loading
thread will create a new type storage and later assign that to the trace
manager.

Change-Id: I11402ed1e0663da6da5b61b15bba40e1a62adc4b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-08 16:11:25 +00:00
Ulf Hermann
95d7be1b28 Tracing: Generalize event filtering
This allows us to not only filter by ranges, but potentially also by
other criteria.

Change-Id: I7349ceeabbb2781473a3a4c803dab1006b7b8e50
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-08 14:13:43 +00:00
Ulf Hermann
7e9b6f62c6 Tracing: Drop restricted start/end times from trace manager
The only thing we need is a flag for QML profiler to decide if it should
show the "full range" option.

Change-Id: I2437c44c2443d9389239e9af79d0672ee1cadbd2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-08 14:04:39 +00:00
Ulf Hermann
4d8707afa4 Tracing: Don't restore notes for events that have been filtered out
Change-Id: I4dc13e579e7994bb970d121a2baa8169a8dd1b2b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-08 13:19:07 +00:00
Ulf Hermann
22e523e504 Add generic FlameGraphView QML component
This allows us to reduce code duplication, but we first have to put
timeline and flame graph into the same library, so that we can use the
TimelineThere in FlameGraphView.

Change-Id: I72b27ffb1fc5aa6baf6a23d85e5ca6c610896b8c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-08 07:02:05 +00:00
Tobias Hunger
a939ec8244 QmlProfiler: Use override consistently
clang-tidy fixes from modernize-use-override check.

Change-Id: Ide82798f95e07be6c842a1c2fcf28573d9c635ed
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-07 13:37:07 +00:00
Orgad Shaneh
6947639d9f QmlProfiler: Fix signed/unsigned comparison warning
Change-Id: I325ce3490b8ea2d1883fb6ec8eb319b9c9145af8
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-07 09:16:46 +00:00
Ulf Hermann
734611131d Move Timeline and FlameGraph into a common "Tracing" library
This allows us to share code between the two, in particular the QML code
for the Details window, and the theme code. This way we can potentially
deduplicate some code.

Change-Id: I3a0d26b18488bd2a46b5b077b5b5d79ac2dfc5ce
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-05-04 14:08:47 +00:00
Eike Ziller
45f8d221bf Use FileName in TextMark
Change-Id: I3666d95dc8ef3b7da099d6d30f5cb4678a349493
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-05-03 06:51:47 +00:00
Tobias Hunger
6fbf0255eb ProjectExplorer: Remove FolderNode::addNode taking a raw pointer
Change-Id: I53b765d2c3e71889386c76425662bfcc47bdf582
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-02 14:55:29 +00:00
Tobias Hunger
5754d5accf ProjectExplorer: Use unique_ptr for Project::setRootProjectNode
Change-Id: If63a49d0eecfb93adcc6076fcb3208c87603af10
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-02 11:34:35 +00:00
Ulf Hermann
f0baf01a2e ProjectExplorer: Keep RunConfiguration in ISettingsAspect
Any SettingsAspect that doesn't refer to the global settings has a
specific RunConfiguration it is about. This can be very handy to know
when constructing the actual settings. Right now there is no way to find
out about it.

Drop the clone() and create() methods. They weren't used anywhere and a
proper implementation should take care of the runConfiguration member.

Change-Id: Ie505a9b19707f8a1b6bf9cae73513cd3c30d0bca
Reviewed-by: hjk <hjk@qt.io>
2018-04-27 08:55:24 +00:00
Alessandro Portale
1dbdd259be Remove some obsolete code inside QT_VERSION_CHECK sections
With Qt 5.9 as minimal build version, we don't need to handle 5.7 or 5.8

Change-Id: Ie1eed95ab46364452b0633f78bebc565a4a63f4a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-04-27 07:43:49 +00:00
Alessandro Portale
4317e350f5 Update Options dialog icons
A new set of scalable and themable icons with unified look as provided
by Diana.

Task-number: QTCREATORBUG-20325
Change-Id: I68498b034e9e43fbb61511a38d9c7fc0003ab076
Reviewed-by: hjk <hjk@qt.io>
2018-04-24 14:43:35 +00:00
Robert Loehning
ef56d05069 QmlProfiler: Remove unused member
Change-Id: Ia8455ab851f50c9eb1f87ddf0b40c8d3d4e0318f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-04-23 15:01:37 +00:00
Ulf Hermann
3673ebe387 Fix memory usage model details
Use the same format for all memory size strings, don't pack numbers into
QString, and adapt the test.

Change-Id: I13de737992fb64fadc61c3e3243ff83c14446e99
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-04-23 14:42:38 +00:00
Ulf Hermann
59e641f8e6 QmlProfiler: Fix flame graph view test
Clicking in an empty area closes the details window now.

Change-Id: I7108b6339021707097bd2a852230fa60473d18e5
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-23 14:20:35 +00:00
Ulf Hermann
1770c2ffe2 Remove TimelineTraceManager::State
This is redundant, now that we have registerFeatures().

Change-Id: Ia56c28b8892ab6da694570fe4b9ea5c96fe194f1
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-23 14:20:16 +00:00
Ulf Hermann
08ca10de81 QmlProfiler: Rename specific replayEvents to replayQmlEvents
Some compilers cannot discern the two replayEvents methods.

Change-Id: Ide4a893ff3976cb081fbbceefacafb6226f0a73f
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-04-19 11:21:59 +00:00
Ulf Hermann
1c2e0f387f QmlProfiler: Move parts of model manager and trace file to Timeline
This way we can use the trace file loading and saving mechanism for
other profilers.

Change-Id: I98ec1cdde6f7abcea152cabf72e64d4e696dfa59
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-19 08:09:07 +00:00
Ulf Hermann
780d4c6a43 Timeline: Move modelId generation into aggregator
The way the notes model works requires every timeline model to have a
different ID. Conversely no other kind of model actually needs an ID.
Therefore it makes sense to have the TimelineModelAggregator manage the
IDs as every timeline model will sooner or later be associated with an
aggregator.

Change-Id: Ib8b2c88ed883351d4e3e156dd13e1dd113c21808
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-17 14:11:51 +00:00
Ulf Hermann
181ad6671c QmlProfiler: Add some missing override
Change-Id: I79930e6166617d1635d08dade47390ca5ee27268
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-17 13:19:41 +00:00
Ulf Hermann
7f7fe1a9db QmlProfiler: Avoid some 0 as nullptr warnings
Change-Id: I4763a22c6624eaffbb583bf26bf74a3e282b042f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-17 13:19:30 +00:00
Ulf Hermann
dcd8d37f35 QmlProfiler: Don't expose the vector of event types
We always want either the total number of event types or one specific
type. There is no need to expose the fact that we keep them as a vector.

Also, use int as the type of the "number" methods as that aligns better
with Qt containers, and rename the methods. We don't need to state the
fact that we've loaded the events and types at some point.

Change-Id: Iaf680ec9fa10e1070ddee6bcc079800e401775f0
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-17 12:20:57 +00:00
Ulf Hermann
7ca958fa85 QmlProfiler: Integrate TraceTime into ModelManager
We never use it independently and only a subset of its interface needs
to be public.

Change-Id: I97bbc638270bcbb8fb1a4097fcfeacf37e96c048
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-17 12:17:23 +00:00
Ulf Hermann
507c2d6b5b Move parts of QmlEvent and QmlEventType to timeline
Timeline will become a generic trace handling library. It needs some
abstract concept of events and event types.

Move operator== and operator!= for QmlEvent into the test as we don't
use them anywhere else.

Move the operators for QmlEventType to QmlProfilerTraceClient. We want
to get rid of the hash there as soon as we can assume that no
application we want to profile doesn't support server type IDs.

Change-Id: Icde4e3e7634e387171dc1d8bef7bbe8e71684a1a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-17 12:15:38 +00:00
Ulf Hermann
32c54dfdac QmlProfiler: Fix some number conversion issues
Qt containers have int as size type, while std containers have size_t.
We can use auto and decltype to deal with this. Also, memcpy and malloc
expect size_t, not int.

Change-Id: Id2942d14978c8a15f72967962d551ddb20905471
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-17 09:24:08 +00:00
Ulf Hermann
e0ba6f91ce Timeline: Add stash() and restore() methods to notes model
Those are needed when manipulating the model in a way that may change
the indices, like restricting to a range or filtering by categories.

Change-Id: I9f218d269cf23104c306960ef77c0fc41591daa1
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-17 09:14:09 +00:00
Ulf Hermann
1ccd058bdf QmlProfiler: Get rid of processing step
The child models are made aware of possible changes in the details
strings, and in turn, we can do the finalization immediately after
acquiring is done.

Change-Id: Ibe57f158e64e5d01d4c97aa617c9b2bcc8e4e96e
Task-number: QTCREATORBUG-20106
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-17 09:13:04 +00:00
Ulf Hermann
e0cab79965 QmlProfiler: Clean up type selection in statistics model
The statistics have one extra valid event type: "Main Program". This
should not be mapped to typeId -1, as -1 is the invalid typeId. Map it
instead to std::numeric_limits<int>::max() and remove all the hacks
around it.

Additionally, optimize the selection algorithm for the statistics main
view: We don't need to iterate all types to select one. We can rather
use the fact that the row numbers in the source model match the type
indices (except for the two special ones).

Change-Id: I7c4dc4f84fd167f9a21c418466ad2bfce56e441f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-17 09:09:32 +00:00
Eike Ziller
185fe0c705 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/plugins/android/androidrunnable.h
	src/plugins/android/androidrunner.cpp
	src/plugins/qmakeandroidsupport/qmakeandroidrunconfiguration.cpp
	src/plugins/qmakeprojectmanager/qmakeproject.cpp
	src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp

Change-Id: I68093d44cfd672347eab82459ff70c21a32297ce
2018-04-17 10:09:35 +02:00
Ulf Hermann
b135306d9f QmlProfiler: Remove now-unused members from statistics
Change-Id: Ibf56f405dc51a82d0f56ab300905b1137375d5c0
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-16 14:16:03 +00:00
Ulf Hermann
4aa432bb9a QmlProfiler: Eliminate QStandardItemModel from statistics
This resolves the data duplication between model manager and statistics
models, that gets in the way of updating the details strings on the fly.

Task-number: QTCREATORBUG-20106
Change-Id: I1c4881f903402dff936267de03b84d05ab7c39ca
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-16 13:35:44 +00:00
Ulf Hermann
495b9aa9c2 QmlProfiler: Make statistics models QAbstractItemModels
This way we will be able to replace the QStandardItemModels in a next
step.

Change-Id: I863fde958d29c8bf8c36aa1f501cb1224720ad7a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-16 13:35:33 +00:00
Ulf Hermann
17d530d60d Make sure we always quote the qmldebug command line arguments
Change-Id: I5ce68c238e0ab05d19715659a9cc2161e51e1a7e
Task-number: QTCREATORBUG-20260
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-04-16 13:08:45 +00:00
Ulf Hermann
7f2912b036 QmlProfiler: Rename method in statistics model
dataChanged() was too generic and easily confused with other methods.

Change-Id: I68b8bcb609599e56a1a2d3c6cf53d878281f7818
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-16 09:19:28 +00:00
Ulf Hermann
87c12c4e1b QmlProfiler: Store statistics data in a saner way
We don't need to retain the durations after finalize(), and we can use
vectors instead of hashes, as we will cover almost all types anyway.

Vectors allow us to potentially use the position of an item in the data
as its row.

Change-Id: I2c09406f0e0a42f5f517f8444755b1664efb8f3b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-04-16 07:16:35 +00:00
Christian Stenger
c637c66ebb QmlProfiler: Avoid structs with default values
gcc 4.9 and msvc 2015 choke when creating those from initializer lists.

Change-Id: I85936fe33418d5d9ffeb3c910392ad43fbb9a9bb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-04-12 10:30:13 +00:00
Ulf Hermann
1155601da5 QmlProfiler: Move some methods from statistics view into model
This allows us to tighten up the public interface of the model.

Change-Id: Iaa0363993de7cd94c3468d2c939198e65746e829
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-12 10:15:44 +00:00