Commit Graph

1631 Commits

Author SHA1 Message Date
Ulf Hermann
fea6580c82 QmlProfiler: get rid of hash strings
Using strings to identify equal events is terribly inefficient. By
keeping a global list of event types we can assign each event a
numerical type index and use that to compare them.

We can also avoid excessive string copying and data duplication by
referring to the global type list where event type information is
needed.

Task-number: QTCREATORBUG-11823
Change-Id: I837bd5d0f5395b0003002ef8dd278fb27679c65d
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-06-17 16:26:06 +02:00
Ulf Hermann
b0d79542b8 QmlProfiler: Replace QStringList with QString in event data
We never have multi-string event data and dragging around the list
everywhere just adds noise.

Change-Id: I4c73543464abea01d342e3f0a296ed1b05ee2a88
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-06-17 16:25:47 +02:00
Ulf Hermann
c7c4be9cb2 QmlProfiler: Remove SingleCategoryTimelineModel
All models are single-category now, so we can merge that into the base
class.

Change-Id: I4eab43ac2b4a77402121f004097e51a29b379aa4
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-06-17 16:25:41 +02:00
Ulf Hermann
3ea13b9b12 QmlProfiler: remove eventType and simplify nesting calculations
With only one category per model we only have one eventType per model
and thus we don't need to differentiate per type anymore when
calculating the nesting.

Change-Id: Ic42a1c5c056f3480b7842a57fbff66a5e907abfb
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-06-17 16:25:31 +02:00
Ulf Hermann
74414bb9e7 QmlProfiler: Parse memory usage events
Change-Id: Id07449345f983d2f2cb2af67540732991f227f71
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-06-17 16:25:05 +02:00
Ulf Hermann
accc92ae47 QmlProfiler: Allow only one category per model in timeline
This simplifies the code a lot and allows for more flexibility
when interacting with the data.

Change-Id: I69630071eee66840e905fcd95ba8c708742d58b6
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-06-16 12:17:49 +02:00
Ulf Hermann
eef83495ea QmlProfiler: Pass model index to QML when selecting in trace view
This allows more precise specification of which event is supposed to be
selected.

Task-number: QTCREATORBUG-11945
Change-Id: Iff2e9bb8569711cc5df72a5ca55956e0091d6163
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-06-16 12:17:15 +02:00
Ulf Hermann
4d812d86c6 QmlProfiler: Restore binding loop markers in overview.
Change-Id: Id0bf7cb9b63c424247f669f21b5782ab99ea873e
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-06-16 12:07:25 +02:00
Ulf Hermann
5a170fc6cc QmlProfiler: Remove useless virtual method from AbstractTimelineModel
It's never called in a virtual way.

Change-Id: Ib3dd8eadd98daf12d29907d46f2699668bff090c
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-06-06 15:30:51 +02:00
Ulf Hermann
1c4db84063 QmlProfiler: Don't convert between QColor and QVariantList
There is no reason to express colors as QVariantList.

Change-Id: I8c816e547b2f9be0f02a9d275791021ac06cff4f
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-06-06 15:29:46 +02:00
Ulf Hermann
94722ec5e7 QmlProfiler: Unify event type definitions
Generally save both the Message and RangeType attributes so that we
avoid clashes between those types. Also keep all the types in one
place and make their names follow qtdeclarative's conventions.

Change-Id: I811bfcc4b72aaa2a0142babc92d96968ed2d4007
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-06-06 15:24:28 +02:00
Ulf Hermann
6d41c6922f QmlProfiler: put all of the traceview in one QQuickView
Having multiple views not only is bad for performance but also creates
difficult to debug problems on some hardware configurations and is
fairly confusing.

Task-number: QTBUG-38222
Change-Id: I885e800b1ededab9137874105e3b2f9ec88a06e8
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-06-06 14:21:28 +02:00
Ulf Hermann
a5863aba87 QmlProfiler: Draw Overview in multiple passes
If there are too many events it takes too long to draw the overview.
By drawing only part of the events in each paint callback and
scheduling multiple paints we can mitigate that. The result is that a
rough outline is visible immediately and the details are filled in bit
by bit.

Task-number: QTCREATORBUG-12341
Change-Id: Id94d914e2926be01cb1635fbd8814c4d2f57d23b
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-06-06 14:21:17 +02:00
Ulf Hermann
617ffe7303 QmlProfiler: Avoid nondeterminism when creating trace time object
If start and end times are initialized by clear() the change signals
may or may not be sent.

Change-Id: Ib50a2bbecf58791c5f93348e7450f4c0324f9d90
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
2014-06-03 17:42:29 +02:00
Orgad Shaneh
03c1d6ee87 QmlProfiler: Pass const vector by reference
Change-Id: I3af38eeeec3c59d52543f28d5e5fa1f4ca604fcd
Reviewed-by: Ulf Hermann <ulf.hermann@digia.com>
2014-05-20 11:42:26 +02:00
Orgad Shaneh
995cb365c4 QmlProfiler: Avoid repetitive calls
Change-Id: Iaf84cccf864b3975e6f6fe282a97fb5ea70e7a93
Reviewed-by: Ulf Hermann <ulf.hermann@digia.com>
2014-05-20 11:41:39 +02:00
Ulf Hermann
9c24a673de QmlProfiler: disconnect the right signals when debug client goes away
Change-Id: I734083f894a8b34d42bffcfe6f698726516d4587
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-05-08 15:24:07 +02:00
Ulf Hermann
a7012c5a87 QmlDebugClient: hide all the socket details from clients
Like this no one will get the idea that the socket state represents
the connection state and we can safely replace the underlying
implementation with something not derived from QAbstractSocket.
All the logging is retained but the connection creates the messages
now.

Change-Id: If84ff42f1fa9785254fbd49c75be867b9f663c83
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-05-08 15:23:56 +02:00
Ulf Hermann
ba5c136a6d QmlDebugClient: Check for gotHello to determine if connection is open
The isConnected() method was misleading as it only checked for the
network socket to be connected. Sending data before the hello message
arrives is a pretty stupid idea and the debug clients need a way to
detect that. The new isOpen method stresses that it's about the
logical protocol, not the network socket.

Change-Id: I84f093d91d7a21d20a8f3d14730c9f189ec35bde
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-05-08 13:40:31 +02:00
Ulf Hermann
776b375540 QmlDebugClient: make QmlDebugConnection::flush() private
There is no reason for any external class to access that. If the call
to flush() from the qml profiler had any effect then it hid a bug that
should be fixed.

Change-Id: I8f655733bd3bff808653cd56b1904aa87c31f6c0
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-05-08 12:51:42 +02:00
Ulf Hermann
0ef1b78724 QmlProfiler: rename logStatus to logState for consistency
Change-Id: Ic9a19028fc4bde03619296a90f8251e2d6ad1240
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-05-08 12:35:20 +02:00
Ulf Hermann
e6792d33c3 QmlDebugClient: Rename "status" to "state" for consistency
"state" is the more widely used term and we should follow that
convention. We also need to distinguish between the state of the
underlying network socket and the client itself. The change makes this
explicit.

As preparation for the upcoming centralized debug support the "State"
enum of the debug client is also moved into the QmlDebugClient class.

Change-Id: Ib9d7e03d23528f16ed696ed3518e813d11ea1c32
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-05-06 12:53:10 +02:00
Tobias Hunger
dc61b989ac Project: Use Utils::FileName as return type for projectDirectory(...)
Change-Id: I3ea10aa204b1ea41702edab09884b416cd6d9e06
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
2014-05-06 11:48:10 +02:00
Eike Ziller
8c1c106a4f Merge remote-tracking branch 'origin/3.1' 2014-04-14 16:53:23 +02:00
Ulf Hermann
c8a814c289 QmlProfiler: Always reset the context before drawing on a canvas
The context is stateful and there could be any kind of junk left in it.
In particular, the W3C spec says that it should be set up with a default
clipping path on creation, but it doesn't say what should happen if the
canvas is resized. Thus, we can never be sure that the clipping path is
sane.

Task-number: QTBUG-38297
Change-Id: If04597234e71574573888ce14deac5cf50df4a3f
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-04-14 10:50:38 +02:00
Daniel Teske
7b52372e3e Qml Profilder Views: Make consistent with other views
Use double click on double click platforms, fix keyboard activation

Change-Id: I36891fb2f733684a1a5c3787e0682cb9ddccb0d3
Reviewed-by: Ulf Hermann <ulf.hermann@digia.com>
2014-04-11 18:39:52 +02:00
Ulf Hermann
88255a6881 QmlProfiler: No need to qualify calls to SortedTimelineModel::clear()
Task-number: QTCREATORBUG-12010
Change-Id: Idad222578a103f135c16d820c2e59172671ee048
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-04-09 16:56:41 +02:00
Ulf Hermann
9e802e3af1 QmlProfiler: Reduce the amount of useless signals on item selection
By passing signals with identification information of varying accurary
between the different views the event being selected could be changed
while it was selected. By checking the current selection against the
information given in the signal and not reselecting when it matches the
situation is improved.

Also, the selection methods are given more appropriate names. We hardly
ever want to select the "next" event, but rather the "best fitting" one.

Task-number: QTCREATORBUG-11945
Change-Id: I659b4929cb88f4c931a0893aa95a3bc92da5a23b
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-04-09 16:36:04 +02:00
Ulf Hermann
3db252ee6d QmlProfiler: Don't try to connect to port 0
Change-Id: I954fadbbe8bf7f2963b94ba45dd47b6846dab1df
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
2014-04-09 15:52:36 +02:00
Eike Ziller
b687658663 Merge remote-tracking branch 'origin/3.1'
Conflicts:
	qtcreator.pri
	qtcreator.qbs
	src/plugins/cpptools/cppcompletion_test.cpp

Change-Id: Ic5e75b3ef164de664a1449ffa8579beaf5b02521
2014-04-08 11:18:40 +02:00
Daniel Teske
18e585b7a7 Remove unnecessary QTreeView includes
Change-Id: I979e4387d8860a9541ad1797bdeeb6adc04ab68e
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
2014-04-07 11:57:51 +02:00
Ulf Hermann
12f5bbcceb QmlProfiler: Guess the trace end time if we don't receive EndTrace
Task-number: QTCREATORBUG-11952
Change-Id: Ie55b616a1fc54e0cccac5560ec66fb7cc496c8e2
Reviewed-by: Robert Loehning <robert.loehning@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-04-04 11:47:35 +02:00
Ulf Hermann
cdfc09f16f QmlProfiler: Prevent integer overflows on contentWidth and contentX
Using the extra window the ZoomControl keeps makes it impossible to
increase contentWidth to a point where it overflows. The drawback is that
the position on the scrollbar doesn't reflect the real position of the
visible part of the trace anymore if you zoom in to such a depth.

Task-number: QTCREATORBUG-11879
Change-Id: I6649f3c139f76c242a91d60364a28a4a00c9acee
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-04-02 16:47:03 +02:00
Ulf Hermann
be1a94ef1f QmlProfiler: Keep an extra time window in ZoomControl
This window is dynamically sized so that no integer overflows can occur
when using it in the timeline view instead of the whole trace time.

Task-number: QTCREATORBUG-11879
Change-Id: Id86faaf614b5f833e47ce26bb859b63eb09e7547
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-04-02 16:46:53 +02:00
Ulf Hermann
8510c848a2 QmlProfiler: Don't ignore ranges of < 500ns in overview
As most of the numbers involved are single precision floats rounding
errors can easily lead to such numbers. Instead of ignoring it set the
range to the smallest allowable value.

Task-number: QTCREATORBUG-11879
Change-Id: If8d08b27cc9e4cf2a63ff4973f519b0d3363178d
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-03-31 12:00:39 +02:00
Ulf Hermann
18ca8139ea QmlProfiler: Guard the overview against recursively changing the range
This is insignificant at lower zoom levels but becomes really annoying
when closer to the 500ns limit.

Task-number: QTCREATORBUG-11879
Change-Id: Ide0069f7c6b135aa31262a4396559fa3ba89f8e3
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-03-31 12:00:32 +02:00
Ulf Hermann
ca78bb358b QmlProfiler: Prevent integer overflows in timelinerenderer
When zooming in the x offset and width of events can be larger than 2^31.
We can restrict them to the visible area, though.

Task-number: QTCREATORBUG-11879
Change-Id: I841300b55cdd583d5c3fa58b196101038f6f6036
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-03-31 12:00:02 +02:00
Ulf Hermann
7238d1e0fb QmlProfiler: remove dead code
Change-Id: I80abc136237917c259fe63b05f783ad1c7601469
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-03-31 11:59:53 +02:00
Ulf Hermann
cc1bedf5b1 QmlProfiler: Increase accuracy of various data types
This prevents some overflows when zooming into the timeline.

Task-number: QTCREATORBUG-11879
Change-Id: I968c4737af8c64798d196a1463268d86146864e7
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-03-31 11:59:47 +02:00
Ulf Hermann
648989daf2 QmlProfiler: Try to make the compiler inline event start comparison
This function is by a large margin the most often called one when
loading a trace. Passing it as a pointer to qSort certainly doesn't
help. Also, qSort is deprecated.

Task-number: QTCREATORBUG-11823
Change-Id: I98d744d1615733de93a8d35bccaa338643a2f6f4
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-03-31 11:59:39 +02:00
Ulf Hermann
84eadb01c8 QmlProfiler: Update selection also when only model changes
Previously, if you selected an event with the same ID from a different
model the rangeDetails wouldn't be updated. Now modelId and itemId can only
be updated together and a single signal is emitted for that. This signal is
then used to update the details.

Change-Id: Ie1e971f5ac8c041b49df347fa0fbb401d5422766
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-03-31 11:59:31 +02:00
Ulf Hermann
fa1b5eebb5 QmlProfiler: unify centering on items and do it only once per click
Change-Id: Ic228a825aebe3d24eeb5b1d84c58499bae4ae69b
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-03-31 11:59:23 +02:00
Ulf Hermann
224210b0fa QmlProfiler: remove dead code
The selectedEventChanged signal was never emitted and aliasing the
selectedItem property was unnecessary.

Change-Id: I2a15ad82bbf20a7ae9a42e17935242fbac7b5129
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-03-31 11:59:14 +02:00
Ulf Hermann
f0e2196869 QmlProfiler: Make sure only hovered events are selected
Task-number: QTCREATORBUG-11824
Change-Id: Ib471f2a04b37e159fb7876e7f5c94ad3e8f368a9
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-03-31 10:55:18 +02:00
Ulf Hermann
20e2d1eb7d QmlProfiler: Avoid indexOf and contains on list of strings
The iteration and comparison done by that takes significant time for
large traces.

Task-number: QTCREATORBUG-11823
Change-Id: I706b42f64ef0fd8b89229f51e52f0faaaf61d87a
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-03-31 10:55:06 +02:00
Ulf Hermann
cdec724ea5 QmlProfiler: Don't rebuild the same key list over and over when saving
Saving a trace is so much faster like this.

Task-number: QTCREATORBUG-11823
Change-Id: I5c68a16739d8bc49bfc0e3bb923ab23058aab6d0
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-03-31 10:54:55 +02:00
Ulf Hermann
13c8478d82 QmlProfiler: Apply some coding style
Change-Id: I34d74254cf677c14538d937a596ff72054f89300
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-03-31 10:40:56 +02:00
Ulf Hermann
fb6bd13d3b QmlProfiler: Show a trace duration of 0 while data is being cleared
Task-number: QTCREATORBUG-11834
Change-Id: Ie93ee7ed79534e86feec5809ef8e91a74da380fa
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-03-31 10:40:10 +02:00
Ulf Hermann
0c9a9348f9 QmlProfiler: Consistently clear when clear button pressed
Several QML properties need extra treatment to avoid stale data
after clearing. Toggling the visibility of the timeline renderer
doesn't really help there.

Task-number: QTCREATORBUG-11833

Change-Id: I1903d7bd69d6fe31ecc4cadca8e30fa2104fa09a
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-03-31 10:39:52 +02:00
Ulf Hermann
85b7d34ea8 QmlProfiler: When clearing, set the trace duration to 0
That is what the code in the main view expects of an empty trace and
it's also logically more coherent.

Task-number: QTCREATORBUG-11833
Change-Id: I78b90ca5332bfb004cabbb32c4eb3e7e83fd7187
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-03-31 10:34:44 +02:00