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>
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>
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>
Holding the engines with EngineControl makes sure we always receive the
full trace before the connection drops.
Change-Id: I32e7d17886cdbc4749e3e54719e198d45169cbfe
Task-number: QTBUG-66269
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
When the connection drops while receiving a trace we can easily process
the buffered events. The trace client test case has some traces with
trailing open ranges that can be recovered this way.
Change-Id: I8b2ecc135b0cabff18923fbc8f3f14b5cb3a96ee
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
The server won't re-send the event types. We need to keep them until the
connection goes away. Otherwise we get invalid event types and soft
asserts when trying to look up event types for new events. Also, when
clearing the event types, also clear the server type IDs. Not clearing
those constitutes a memory leak.
Change-Id: I564b0c4cf0ed754549d2b8ede63c97fa01affcec
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
They are not time-ordered like normal messages, so we need to buffer
them and only insert them when the normal event stream arrives at their
timestamp.
The time ordering is important as the "restrict to range" feature uses
it to determine the start of the range.
Change-Id: If27a3f667c4c39e69efa95fcb9cdfd3dbf01e657
Task-number: QTCREATORBUG-19456
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Rename the method to clear() and make sure all the event types and
pending events are actually cleared.
Change-Id: Ie6c916d374a00025f7d77d21345d039fe8cead80
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
We might get timestamps that are outside the trace time, negative
timestamps, ranges that go backwards, and other insane things.
In order to deal with this, we clamp all negative timestamps to 0, and
treat the specified trace time as minimum range, that can be overridden
by events.
Change-Id: Iba661f2a4346077871fc62a46759e169b2aad49d
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
The trace may contain RangeData and RangeLocation entries that aren't
aligned with any RangeStart. As the trace is generated by an external
process we need to handle that.
Change-Id: I39a524127c9c9059e5c5521797e5effd385ce12b
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
It might be null. We wrap the retrieval of the data stream version in
QmlDebugClient and return the minimum if connection is null. The extra
copy of the connection QmlEngine is dropped as QmlDebugClient already
has one and we don't want to hit a dangling pointer.
Change-Id: Ida8c45d357d46b4942eea99b77065d3c51c7edb9
Reviewed-by: hjk <hjk@qt.io>
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>
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>
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>
We stash the ranges until we receive RangeLocation and RangeData. In
order not to send other messages before the range they belong to, we
need to keep them around, too, until we send the range.
Change-Id: I0ce4ced68ee343c54638ce262216c4bf1e4ddc13
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
It makes more sense to have them in the same location as the actual
type.
Change-Id: Ia27970173d14cfe361d4fc007cb461f788350b21
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
... in turn, make its members private, so that we don't accidentally
change them.
Change-Id: Ibc65b406ee341d33f69647ed1b19e1e34f5cd535
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
You should not change them independently as that is error-prone.
Change-Id: I07890a29b045492fe804b9537094dea763bc1b8d
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
This way we only have to transmit the location and data events once per
type, not once per event.
Change-Id: Ic6ab9619824764fc8b3abf09c7b58200eda2a198
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This way we will be able to use server-provided type IDs for more
efficient lookup of event types.
Change-Id: I37cd592a7829e5f36c6cfc04e400013d1dc37155
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
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>
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>
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>