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>
This commit is contained in:
Ulf Hermann
2018-05-04 17:19:08 +02:00
parent 447befac61
commit 6e0373adb3
14 changed files with 191 additions and 120 deletions

View File

@@ -100,8 +100,9 @@ void QmlProfilerToolTest::testClearEvents()
stateManager->setServerRecording(true);
QCOMPARE(modelManager->numEventTypes(), 0);
QCOMPARE(modelManager->numEvents(), 0);
modelManager->addEventType(QmlEventType());
modelManager->addEvent(QmlEvent(0, 0, ""));
const int typeIndex = modelManager->appendEventType(QmlEventType());
QCOMPARE(typeIndex, 0);
modelManager->addEvent(QmlEvent(0, typeIndex, ""));
QCOMPARE(modelManager->numEventTypes(), 1);
QCOMPARE(modelManager->numEvents(), 1);
stateManager->setServerRecording(false);
@@ -110,7 +111,7 @@ void QmlProfilerToolTest::testClearEvents()
stateManager->setServerRecording(true); // clears previous events, but not types
QCOMPARE(modelManager->numEventTypes(), 1);
QCOMPARE(modelManager->numEvents(), 0);
modelManager->addEvent(QmlEvent(0, 0, ""));
modelManager->addEvent(QmlEvent(0, typeIndex, ""));
QCOMPARE(modelManager->numEventTypes(), 1);
QCOMPARE(modelManager->numEvents(), 1);
}